Reputation: 13
I know this should be easy, but I'm just not finding it. We have a program that creates a new folder automatically in Users/Shared/. The folder is a different name every time. So that's the variable.
I need a folder action that will do the following:
When new folder is copied or created in Users/Shared/,
Create (or copy from another location) two new folders inside that new folder, one named "To" and one named "From".
I tried "recording" one, but it did nothing.
Thanks for any help!
Upvotes: 1
Views: 101
Reputation: 11238
Try:
on adding folder items to theFolder after receiving droppedItems
repeat with anItem in droppedItems
tell application "System Events" to get kind of (contents of anItem) = "Folder"
if the result then do shell script "mkdir -p " & (quoted form of (POSIX path of anItem)) & "{\"To\",\"From\"}"
end repeat
end adding folder items to
Upvotes: 2