Hi, I’m trying to develop a script to take affect when a alias of a certain document file type is dropped into a drop box. It then copies the parent folder of the alias into another location.
Here’s the script I have come up with so far:
on adding folder items to this_folder after receiving added_items
tell application "Finder"
-- Gets alias which has been added
set f_sel to added_items as alias
-- Gets type type
set f_type to file type of f_sel
-- Gets file path
set f_path to f_sel as alias
-- Gets folder for enclosed file
set f_parent to container of f_path as string
if f_type = "PDF " then
duplicate (f_parent as alias) to folder (":Users:james:Desktop" as alias) with replacing
end if
end tell
end adding folder items to
When I’m running it through the script editor it works fine. However when I save this as a folder action to my drop box. Instead of copying the parent folder of the alias, it copies the dropbox folder.
Has anybody got a clue?
Thanks