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 20:53:39 -0500
>
on 8/30/03 7:24 PM, Michelle Steiner at email@hidden wrote:
>
So you can simplify the script as follows:
>
>
> on doUnderScore(theList)
>
> set oldTIDs to AppleScript's text item delimiters
>
> tell application "Finder"
>
> 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 name of thisFile to newName\
>
>
if kind of thisFile is "folder" then
>
set fContents to every item of thisFile
>
my doUnderScrore (fContents)
>
end if
>
>
> end repeat
>
> end tell
>
> set AppleScript's text item delimiters to oldTIDs
>
> end doUnderScore
>
>
I didn't test this (or even try to compile it), but I think it should
>
work. It should cut the time in half, because it iterates through the
>
list only once instead of twice.
>
>
--Michelle
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.
And you were also right about cutting the time in half!
You're the best.
--
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.