Re: renaming files in Finder
Re: renaming files in Finder
- Subject: Re: renaming files in Finder
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 4 Feb 2002 17:56:43 -0500
At 22:28 +0000 2/4/02, Mr Tea wrote:
This from Stephen Swift
>At 2/4/02 11:06 AM, William Porter (email@hidden) Wrote:
Why would you need the subroutine in the first place?
Hey, subroutines are all the rage. Haven't you heard? :-)
Wouldn't this be a much easier approach?
on run
set myFolder to choose folder
--asks you what folder
tell application "Finder"
repeat with x in every file of myFolder
set name of x to ("temp " & name of x)
end repeat
--adds "temp" to all file names in myFolder
end tell
end run
Easier, perhaps, but no more effective on my OS 10.1.2 with AS 1.8.2b.
The Finder likes it better if the files in the folder are put into a
variable first...
Actually, I think it likes only if the files are in a variable. It
does not work any other way.
And I am talking about AS 1.8.1
set myFolder to choose folder
tell application "Finder"
activate
set theFiles to every file of myFolder
repeat with x in theFiles
set name of x to ("temp " & displayed name of x)
end repeat
end tell
Note that I have used the 'displayed name' property when getting the
Thanks very much. I did not look at the dictionary.
I just learnt something!
Regards
Mr Tea
"Always remember to warm the pot."
Regards
--
Deivy Petrescu
http://www.dicas.com