(* Kontrollierter Datentausch (C) Hado Hein 1998, Berlin,FRG Parts are (C) Apple Computer - published Scripting Samples of MacOS Idle Filing - that does work everytime - not only at Finders Idle Times Difference between Move Folder (one-Way sync) and classic sync SEE ALSO LABEL FILING *) on quit tell application "Finder" speak "bewitched idle filing has quit" end tell continue quit end quit on SyncFolders(folder1, folder2) SyncEm(folder1, folder2) SyncEm(folder2, folder1) end SyncFolders on SyncEm(folder1, folder2) tell application "Finder" set Folder1Contents to list folder folder1 set Folder2Contents to list folder folder2 repeat with x in Folder1Contents if x is not in Folder2Contents then duplicate alias ((folder1 as text) & x) to folder folder2 set label index of item ((folder1 as string) & x) to 5 set label index of item ((folder2 as string) & x) to 5 else if kind of alias ((folder1 as text) & x) is "folder" then SyncFolders(((folder1 as text) & x) as alias, ((folder2 as text) & x) as alias) of me else set date1 to modification date obsolete of alias ((folder1 as text) & x) set date2 to modification date obsolete of alias ((folder2 as text) & x) if date1 > date2 then duplicate alias ((folder1 as text) & x) to folder folder2 with replacing set label index of item ((folder1 as string) & x) to 5 set label index of item ((folder2 as string) & x) to 5 else -- anyway show that idle filing was there set label index of item ((folder1 as string) & x) to 5 set label index of item ((folder2 as string) & x) to 5 end if end if end if end repeat end tell end SyncEm on MoveEm(folder1, folder2) -- OHNE subfolder tell application "Finder" set Folder1Contents to list folder folder1 set Folder2Contents to list folder folder2 set Heute to current date repeat with x in Folder1Contents if x is not in Folder2Contents then duplicate alias ((folder1 as text) & x) to folder folder2 set label index of item ((folder1 as string) & x) to 7 set label index of item ((folder2 as string) & x) to 7 else set date1 to modification date obsolete of alias ((folder1 as text) & x) set date2 to modification date obsolete of alias ((folder2 as text) & x) if date1 > date2 then duplicate alias ((folder1 as text) & x) to folder folder2 with replacing set label index of item ((folder1 as string) & x) to 7 set label index of item ((folder2 as string) & x) to 7 end if end if if modification date obsolete of alias ((folder1 as text) & x) < (Heute - (21 * days)) then set label index of item ((folder2 as string) & x) to 6 set comment of file ((folder2 as string) & x) to (Heute & " wurde dieses File auf " & folder1 as string) & " durch IdleFiling gel–scht" set locked obsolete of file ((folder2 as string) & x) to true delete alias ((folder1 as text) & x) else if modification date obsolete of alias ((folder1 as text) & x) < (Heute - (7 * days)) then set label index of item ((folder1 as string) & x) to 6 -- this label says "to be del" to mark that this file is backed up and will be deleted in some time end if end repeat end tell end MoveEm on idle tell application "Finder" if (list disks) contains "HD" then set srcfolder to "HD:Dokumente:MEMO:" set destfolder to "MacHD:Dokumente:MEMO:" SyncFolders(srcfolder, destfolder) of me end if set srcfolder to "MacHD:SystemFolder (7.6):Shutdown Items:" set destfolder to "MacHD:SystemFolder (8.1):Shutdown Items:" SyncFolders(srcfolder, destfolder) of me end tell return 900 -- do it all 15 minutes end idle -- could be on run but works without -- needs on on run when there is also a on load tell application "Finder" speak "Bewitched Idle Filing has launched" end tell