Page 1 of 1

Create folder if folder doesn't exist

PostPosted: Fri Jul 31, 2015 2:48 pm
by toothpaste
It thought this was easy with Hazel but can not get it to work. It runs one time and that is it.

Goal:
Create new folder "output files" in "Downloads" when there is none.

Script:
If
Kind is Folder
Full Name is not "output files"

Do the following
Run Applescript
Code: Select all
tell application "Finder"
   set folderpath to "Harde schijf:Gebruikers:toothpaste:Downloads"
   make new folder at folderpath with properties {name:"output files"}
end tell

Re: Create folder if folder doesn't exist

PostPosted: Fri Jul 31, 2015 3:23 pm
by Mr_Noodle
Are you going to put something in it via a Hazel rule? If so, why not just have it created automatically when you file it (Sort into Subfolder creates it for you)?

This doesn't quite work because you are having it trying to match the folder being monitored itself. You'd have to monitor one level up and have the rule match the Downloads folder. You should do the above first though as that's far easier and clearer.

Re: Create folder if folder doesn't exist

PostPosted: Fri Jul 31, 2015 4:15 pm
by toothpaste
THX! That did the trick.