I suggest two options (for running a script):
Option 1 Take this code (provided that it does what you are planning) and save it as an application (using the Script Editor).
Then just drag this application onto the window toolbar (you need the toolbar to be visible). To do this, hold the key while dragging.
Option 2 : use Butler: http://manytricks.com/butler/ (there is a free version, I donβt know your OSX version).
It allows you to define system-wide nodal keys for applescript.
Create a smart element (applescript); paste the code there and add the keyboard shortcuts in the name Script: example: create folder here β§β₯βN
EDIT:
According to your comment, I understand your problem, and I can tell you that you are missing the path (the current folder in your case is theLocation )
So, in each case, if (exists folder archivesFolder) then you need to add of theLocation as follows: if not (exists folder archivesFolder of theLocation) then
Finally, knowing that you will not do anything if the folder exists, just check the false case.
I tested this code and posted it here:
property archivesFolder : "Archives" property imagesFolder : "Images" property proofreadFolder : "Proofreading" property proofFolder : "Proofs" property sourceFolder : "Source" try tell application "Finder" to set theLocation to (folder of the front window as alias) end try tell application "Finder" if not (exists folder archivesFolder of theLocation) then make new folder at theLocation with properties {name:archivesFolder} end if if not (exists folder imagesFolder of theLocation) then make new folder at theLocation with properties {name:imagesFolder} end if if not (exists folder proofreadFolder of theLocation) then make new folder at theLocation with properties {name:proofreadFolder} end if if not (exists folder proofFolder of theLocation) then make new folder at theLocation with properties {name:proofFolder} end if if not (exists folder sourceFolder of theLocation) then make new folder at theLocation with properties {name:sourceFolder} end if end tell
source share