Re: Folder Action - duplicating files
Re: Folder Action - duplicating files
- Subject: Re: Folder Action - duplicating files
- From: Yvan KOENIG <email@hidden>
- Date: Tue, 28 Feb 2006 11:19:02 +0100
Le 28 févr. 2006, à 00:17, Robert Ladle a écrit :
I have a simple folder actions script that works fine for duplicating items to a second folder when new items are added to the original folder. However, items being deposited into the original folder can be new and some are just updates to existing items. The script as written does not react to updates causing the second folder to be "out of date", which I'm sure is due to the "adding" folder items statement. Essentially I want to synchronize the second folder to the first with AppleScript.
What do I need to add/modify to accomplish this? I've tried various iterations with no luck. I need the second folder to contain duplicates to stand on their own and not be aliases.
--------------
on adding folder items to this_folder after receiving these_items
set theFolder to "Mini:Users:me:Desktop:aFolder"
repeat with this_item in these_items
tell application "Finder"
try
duplicate this_item to folder theFolder with replacing
on error
--do stuff
end try
end tell
end repeat
end adding folder items to
----------------
Hello
I think that a responce is to deposit the files in a folder and move them to TWO different folders.
So the script may delete the files in the original folders and the two folder will always be up to date.
--------------
on adding folder items to this_folder after receiving these_items
set theFolder to ((path to desktop) as text) & "aFolder"
set theFolder2 to ((path to desktop) as text) & "aFolder2"
repeat with this_item in these_items
tell application "Finder"
try
duplicate this_item to folder theFolder with replacing
duplicate this_item to folder theFolder2 with replacing
delete this_item
on error
--do stuff
end try
end tell
end repeat
end adding folder items to
--------------
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden