Page 1 of 1

Searching for content then moving the folder?

PostPosted: Mon Mar 12, 2007 5:39 pm
by aussieoc
Hello I want to set something up where Hazel searches for content, lets say .doc, within folders on my desktop then move the folder where the content is located to another location. Is this even possible right now with this current version of Hazel?

Thanks,
Cesar

PostPosted: Mon Mar 12, 2007 10:23 pm
by Mr_Noodle
With the stock move action, it's not possible. The action is meant to operate on the file that matched the rule, not its parent folder. Instead, you can do it via an external script or workflow.

I have been thinking about a way to redirect actions to their parent folders but am still working on a solution that doesn't clutter the interface too much.

PostPosted: Tue Mar 20, 2007 7:31 pm
by IDontDoWindows
I whipped up a little something.

PostPosted: Fri Mar 23, 2007 9:33 am
by aussieoc
Awesome this looks exactly what i was looking for. I am not a very big applescripter so when I get home after work today I'll play around with it and post my outcome.

Thanks again

Code from IDontDoWindows
Code: Select all
my hazelProcessFile(leFiche)

on hazelProcessFile(leFiche)
   try
   tell application "Finder"
      activate
      set leDossier to container of (selection as alias)
      move leDossier to folder "users:me:documents:" of startup disk
   end tell
   on error
   display dialog "Ummmm.... What?"
   end try
end hazelProcessFile

Action based on folder contents

PostPosted: Mon Nov 26, 2007 8:12 pm
by kenny_garlic
I´ve been using Hazel a lot recently and I love the way it brings order to my harddrives. But the more I come to love Hazel, the more I seem to require one specific kind of function to fill a big gap -> moving subfolders based on their content kind. I have a server running and moving unarchived stuff manually is very tedious (as is scripting, frankly)...

What I would really, really like Hazel to do is to support this kind of rule:
- FOLDER CONTENTS
- contain / dont contain
- at least [input number] / at max [input number] / only
- extension [input field] / kind [input field]

The idea is as follows:
For the main download folder, one would start with a standard "run rules on folder contents" rule. The second rule would be the one above, for example, it could go:
- FOLDER CONTENTS
- contain
- at least "1"
- extension "MP3"
... and the action would be "move to folder /audio".

Does this sound reasonably implementable? I have seen this feature being requested occasionally and I would really, really appreciate this one.

Thanks
Kenny

PostPosted: Wed Nov 28, 2007 3:50 pm
by Mr_Noodle
Some way to operate on the containing folder is definitely being looked into but I can't say when it will go in or how it will work just yet.

For now, you could have it execute a script that operates on the parent folder. Not ideal but might be suitable for now.