Hi,
I want to archive files within a folder into a folder on another volume, or server, but the script I wrote won’t recognize the the folder on the other volume. It will work if I move from folder to folder on the desktop. Any suggestions? Here is what I have so far:
tell application “Finder”
move (every folder whose name contains “GAMES”) of folder ¬
“TO BE ARCHIVED” to folder named “GAMES PAGES” in localVolumes
end tell
Thanks in advance
JDG
Model: Mac Cougar
AppleScript: 2.1.1
Browser: Firefox 1.5.0.6
Operating System: Mac OS X (10.4)
assuming you want to copy all folders of folder “GAMES PAGES:TO BE ARCHIVED:” to “myDisk:Folder:” on a server,
try this
property localVolume : "myDisk:Folder:"
property theServer : "afp://username:password@afpaddress/myDisk"
if "Volume" is not in (do shell script "ls /Volumes") then mount volume theServer
tell application "Finder" to move (every folder of folder "GAMES PAGES:TO BE ARCHIVED:" whose name contains "GAMES") to folder localVolume
Notes: the “root” folder of the Finder is the desktop of the current user, so the folder “GAMES PAGES:TO BE ARCHIVED:” is a subfolder of the desktop.
Or you must specify the whole path, starting with the name of the disk (unlike a POSIX path also if it’s the start volume) or
you use a relative independent path like path to documents folder which points to the documents folder of the current user
Hi,
I’ve tried your script several times and many other versions, but can’t get it to work. I want to drop a folder named “TO BE ARCHIVED” into the scrip droplet and all the various named folders be sent to another volume or server, into folders on this volume that have corresponding names. I.E. every folder that contains the name “GAMES” is archived to the other volume’s folder named “GAMES PAGES.” Whatever script I use, I get a prompt that the other volume: "cant’ get ‘GAMES’ ", like it doesn’t recognize it. I’m lost. Appreciate any suggestions. Thanks.
jdg
If you want to copy the folders of a specified folder to an specified place,
you need something like this
property localVolume : "myDisk:Folder:"
property theServer : "afp://username:password@afpaddress/myDisk"
on run
set archiveFolder to choose folder with prompt "Choose folder to be archived"
processFolders(archiveFolder)
end run
on open theseFolders
processFolders(item 1 of theseFolders)
end open
on processFolders(theFolder)
if name of (info for theFolder) is not "TO BE ARCHIVED" then return
if "Volume" is not in (do shell script "ls /Volumes") then mount volume theServer
tell application "Finder"
set subFolders to (get folders of theFolder)
repeat with oneFolder in subFolders
set fName to name of (info for oneFolder as alias)
if fName contains "GAMES" then
move oneFolder to folder (localVolume & "GAMES PAGES:")
else if fName contains "PICTURES" then
move oneFolder to folder (localVolume & "PICTURES PAGES:")
end if
end repeat
end tell
end processFolders