I have a workflow that does the following:
- gets the contents of a specified folder (1 item) (automator action)
- sets a variable “source to copy” to the result of step 1 (automator action)
- creates a list of destination folders using “Find finder items” (automator action)
- sets a variable “common folders” to the result of step 2 (automator action)
NOW, using applescript (cause I cant find an automator action to do it) I want to copy the first item (source to copy) into the multiple folders in “dest folders”
I have this in the applescript action currently and it’s giving me errors:
on run {input, parameters}
set destFolders to (get value of variable "common folders" of front workflow)
set sourceFile to (get value of variable "source to copy" of front workflow)
set folder_list to items of destFolders
tell application "Finder"
repeat with this_folder in destFolders
duplicate file sourceFile to folder this_folder with replacing
end repeat
end tell
return input
end run
This seems like it should be easier, I’m just not making the connection. Thoughts?