I have folders named “x” and folder actions scripts named “x.scpt”. Is there way to automate attaching those scripts to folders?
thanks
From the System Events dictionary
FOLDER ACTIONS SUITE
Folder Actions Suite: Terms and Events for controlling Folder Actions
ATTACH ACTION TO
attach action to i[/i]Attach an action to a folder (from Folder Actions Suite)
FUNCTION SYNTAX
set theResult to attach action to folder ¬
using unicode text
RESULT
folder action
PARAMETERS
Parameter Required Type Description
direct parameter required folder The folder to which the action is to be attached.
using required unicode text a file containing the script to attach
Thanks, StefanK. I was actually looking in the “Folder Actions Setup” dictionary and found nothing for “attach”. Was there anything in the “Folder Actions Setup” dictionary that should have prompted me to look in the “System events” dictionary?
set afile to "<some file>"
set afolder to "<some folder>"
tell application "System Events"
set theaction to attach action to folder afolder using afile
end tell
I’ve never scripted the Folder Actions Setup Utility. All functions are included in System Events