Reliable move & rename
Reliable move & rename
- Subject: Reliable move & rename
- From: John McAdams <email@hidden>
- Date: Sun, 28 Apr 2002 10:23:39 -0400
I'm crashing with remarkable frequency when asking the Finder to rename
and delete some files. My last post started to go up in flames after I
tested the script a dozen times. I'm now trying to use List Folder but
that crashes too. The crash comes when I try to rename a file. I usually
get error -43, File not found.
tell application "Finder"
if not (exists folder "FMP Recover" of desktop) then
set recFold to make new folder with properties {name:"FMP Recover"}
else
set recFold to folder "FMP Recover" of desktop
end if
open dbFold
update dbFold with necessity
move (every file of folder dbFold whose (name ends with "
Recovered") or (name ends with " Recovered.fp5")) to recFold
set recFold to recFold as alias
set the dblist to list folder recFold without invisibles
repeat with i from 1 to number of items in the dblist
set dbFile to item i of the dblist
set dbPath to ((recFold as string) & dbFile) as alias
set AppleScript's text item delimiters to the " Recovered"
set reName to every text item of the dbFile
set AppleScript's text item delimiters to ""
set reName to reName as string
set the name of dbPath to reName
end repeat
empty trash
move every file of recFold to folder dbFold with replacing
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.