• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reliable move & rename
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Prev by Date: Finder's update
  • Next by Date: Re: Owner/User Name in OSX
  • Previous by thread: Finder's update
  • Next by thread: Scripting Entourage 2001
  • Index(es):
    • Date
    • Thread