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 19:29:46 -0500
>
on 8/30/03 5:24 PM, Michelle Steiner at email@hidden wrote:
>
>
> On Saturday, August 30, 2003, at 03:33 PM, Bob.Kalbaugh wrote:
>
> set name of thisFile to newName
>
> end repeat
>
> set fContents to (every item of theList)
>
>
setfContents to (every folder of thelist)
>
Thanks for your response, Michelle.
Yes, that is what I had originally wrote but for some reason it didn't do
what I had intended. I thought it would list all of the folders inside of
the folder that was dropped and then work on those but it doesn't. So, with
the script written that way only the folder dropped gets a name change then
the script quits. Because I am just dropping one folder that contains other
folder and files, I think I need to get at the items inside. Which is why I
rewrote it the way that I did. I'm not sure if it's correct, but it works,
albeit slowly.
Taking into consideration your other suggestions, which make perfect sense,
the script now looks like this however, still s l o w:
--
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
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
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
end tell
set AppleScript's text item delimiters to oldTIDs
end doUnderScore
--
Thanks again,
--
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.