Page 1 of 1

Copy/move to latest folder?

PostPosted: Mon Nov 21, 2016 4:28 pm
by theDanielJLewis
I want Hazel to automatically move or copy raw podcast audio files from an SD card to the latest podcast-episode folder in my projects folder. But I'm running into problems with the destination folder.

I would be happy if I could simply set "Sort into subfolder" to "Latest subfolder" or something like that.

Here's what the process would look like.

I have an "Audio Editing" folder. In it, I make a subfolder for each episode of my podcast (for example, tap291, tap292, tap293, and so on). I need Hazel to put the files into whatever folder is the most recently created (though I would be happy with more intelligence, like "highest number").

It seems the "Sort into Subfolder" option only works for creating new folders with text from different attributes. It doesn't seem to let me match an existing folder with certain attributes. (The "…" looked like it is supposed to help with this, but it doesn't seem to make any difference.)

Is that possible? If so, how can I do that?

Re: Copy/move to latest folder?

PostPosted: Tue Nov 22, 2016 1:21 pm
by Mr_Noodle
This looks like specialized logic that might require a script. Not sure how well versed you are with either AppleScript or other scripting languages but at the moment, it's the only solution that comes to mind.

Re: Copy/move to latest folder?

PostPosted: Tue Nov 22, 2016 1:45 pm
by theDanielJLewis
That's what I was starting to suspect. It's too bad Hazel doesn't have a variable that can be passed between rules, or set with AppleScript and then passed on.

Re: Copy/move to latest folder?

PostPosted: Wed Nov 23, 2016 1:33 pm
by Mr_Noodle
You can have AppleScript export attributes back out to Hazel. Search the help on AppleScript as it has more details on that.