I’m struging with what used to be simple.
I cannot get the terminolgy right when trying to set a folder action via Applescript, under Sierra.
The Bold text shows what concerns me. If I put in the folder name, how does the script know which folder action to use?
Very frustrating, and nothing on the net.
Santa.
set pathToFolderActionscripts to (path to Folder Action scripts folder from user domain) as text
tell application "Finder"
set theDesiredFolderActionScriptPath to pathToFolderActionscripts & "ftp Downloader.scpt" as text
tell application "System Events" to display dialog theDesiredFolderActionScriptPath as text
set theList to folders of folder ((path to desktop) & "ftp Downloads" as text) as alias list
repeat with eachFolder in theList
try
tell application "System Events" to enable folder action {enabled:true, name:"ftp Downloader", path:eachFolder} # Adding ‘.scpt’ crashes
on error errmsg
tell application "System Events" to display dialog errmsg
end try
end repeat
end tell
(*
folder action n : An action attached to a folder in the file system
elements
contains scripts; contained by application.
properties
enabled (boolean) : Is the folder action enabled?
name (text) : the name of the folder action, which is also the name of the folder ??? How can we have a name of a folder action, that is the same as a folder name????
path (text, r/o) : the path to the folder to which the folder action applies
volume (text, r/o) : the volume on which the folder to which the folder action applies resides
*)
And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably
Sri Aurobindo