Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)



I am writing an applescript to synchronise two folders, one local and one on a network.  Each folder should have the same data, one is local (on a MacBook Pro) and the other on a windows network.

I have this script which works, but does not identify the most recent file:

property local_foldername : "~home/Documents"
property destination_foldername : "smb://some/ networked/location"
property eject_when_done : true
property confirm_backup : true
on clicked theObject
tell application "Finder"
if not (exists folder "Backups" of home) then
make new folder at home with properties {name:"Backups"}
end if
set source_folder to folder local_foldername of home
set the alias_list to every alias file of the source_folder
if (count alias_list) > 0 then
try
duplicate every file of local_foldername to destination_foldername with replacing
duplicate every file of destination_foldername to local_foldername with replacing
end try
end if
end tell
end clicked

If I run this only from the mac, any work done on a PC desktop which writes to the destination_foldername will be overwritten by files from the local_foldername.  Unlike my backup scripts which only have changes to the original file, these files will be changed in both locations.   I need to identify and replace only files that are older than the source files.  Is this possible?




Peter Baxter




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.