I have some folders with folder actions on them. If I copy those folders (manually), I want the same folder actions on those new folders. But the actions don’t seem to be copied with them automatically. Is there a way? I seem to have to apply them each time I copy the specific folders, can’t be the way to go…
It’s basically a script that sets a label if a folder isn’t empty. If there are other ways to do is, also good. I’m very new to Applescript, the syntax is no problem but I lack some knowledge in to what’s possible and not.
Nobody? I searched all over the net, and I keep finding ways to copy folders with applescript, but none of the info tell me if it’s possible to copy applescript by duplicating a folder…
attached folder actions are not copied automatically with the Finder.
Get the folder action parameters of the source folder with System Events and assign them to the destination folder
set sourceFolder to choose folder
set destinationFolder to choose folder
set actionScript to missing value
tell application "System Events"
repeat with anAction in (get folder actions)
if path of anAction is sourceFolder then
set actionScript to path of script 1 of anAction
exit repeat
end if
end repeat
end tell
tell application "Finder" to duplicate sourceFolder to destinationFolder
if actionScript is not missing value then
tell application "System Events"
attach action to destinationFolder using actionScript
end tell
end if