I am looking for a script to synchronise the contents of folders, and believe that there was one with 9.1. Does anyone have this, or is there a site with the originals all on?
RJ
This script predates OS 9.1 but should be effective through the latest version of OS 9.x:
on run
tell application "Finder"
activate
try
set folder1 to choose folder with prompt "Select the first folder:"
on error --<I> e.g. user cancelled</I>
return
end try
try
set folder2 to choose folder with prompt "Select the second folder:"
on error --<I> e.g. user cancelled</I>
return
end try
SyncFolders(folder1, folder2) of me
end tell
end run
on open x
tell application "Finder"
set ErrorString to "Syncronization process needs 2 folders. " & ¬
"Please try again with 2 folders."
if (count items in x) ? 2 then
display dialog ErrorString buttons "OK" default button 1
return
end if
set y to item 1 of x
if last character of (y as text) is ":" then --<I>it's a folder</I>
set x to item 2 of x
if last character of (x as text) is ":" then --<I>it's a folder</I>
SyncFolders(x, y) of me
else
display dialog ErrorString buttons "OK" default button 1
end if
else
display dialog ErrorString buttons "OK" default button 1
end if
end tell
end open
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
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 of alias ((folder1 as text) & x)
set date2 to modification date of alias ((folder2 as text) & x)
if date1 > date2 then
duplicate alias ((folder1 as text) & x) to folder folder2 with replacing
end if
end if
end if
end repeat
end tell
end SyncEm