Renaming files in Finder: why so slow?
Renaming files in Finder: why so slow?
- Subject: Renaming files in Finder: why so slow?
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Sat, 30 Aug 2003 17:33:07 -0500
Hi all,
I'm attempting to script the renaming of folders and files. I want to
replace spaces with an underscore. I want recursion. I've created a droplet
that works, but it's very s l o w. It took about 30 seconds for a folder
containing about 35 files and folders OMM.
OS9 on a PowerPC 7300 - AS v1.4
Is there a way to speed up this script?
--
on open fileList
doUnderScore(fileList)
end open
on doUnderScore(theList)
tell application "Finder"
activate
set oldTIDs to AppleScript's text item delimiters
repeat with thisFile in theList
set AppleScript's text item delimiters to {" "}
set oldName to text items of (get the name of thisFile)
set AppleScript's text item delimiters to {"_"}
set newName to (oldName as string)
set AppleScript's text item delimiters to {" "}
set name of thisFile to newName
end repeat
set fContents to (every item of theList)
repeat with anItem in fContents
if kind of anItem is "Folder" then
my doUnderScore(anItem)
end if
end repeat
set AppleScript's text item delimiters to oldTIDs
end tell
end doUnderScore
--
Thanks for your time.
--
Bob.Kalbaugh
_______________________________________________
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.