Re: Renaming files in Finder: why so slow?
Re: Renaming files in Finder: why so slow?
- Subject: Re: Renaming files in Finder: why so slow?
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Sat, 30 Aug 2003 22:41:02 -0500
on 8/30/03 8:48 PM, Michelle Steiner at email@hidden wrote:
>
On Saturday, August 30, 2003, at 06:53 PM, Bob.Kalbaugh wrote:
>
>
> Well, it did work. Thank you! However...
>
>
>
> I had to move the if statement to the top of the repeat loop as it was
>
> testing for a folder on the file that was being name changed. It kept
>
> reporting that "couldn't get folder of folder... of finder." I think
>
> because
>
> it was busy. Moving it up top worked.
>
>
So you tested for it being a folder first, then processed the contents
>
of the folder before changing the folder's name? I don't think it was
>
because it was busy, but because the name was changed.
>
Yes. Exactly. I couldn't have said it myself. ;)
>
> And you were also right about cutting the time in half!
>
>
That pretty much stands to reason; it loops only once instead of twice.
>
>
> You're the best.
>
>
Nah. just above average.
>
>
--Michelle
>
You may be modest, but you're definitely high post in my book. Your
suggestions helped make my original script twice as fast. Many, many thanks.
For anyone else interested the final script follows. Athough it is still
fairly sluggish on my (6 year old computer) it may prove faster on newer
machines. If someone has any suggestions for making it faster I'd be happy
to hear it.
--
on open fileList
doUnderScore(fileList)
end open
on doUnderScore(theList)
set oldTIDs to AppleScript's text item delimiters
tell application "Finder"
repeat with thisFile in theList
if kind of thisFile is "Folder" then
set fContents to every item of thisFile
my doUnderScore(fContents)
end if
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 name of thisFile to newName
end repeat
end tell
set AppleScript's text item delimiters to oldTIDs
end doUnderScore
--
--
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.