• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: renaming files in Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: renaming files in Finder
      • From: Andy Wylie <email@hidden>
References: 
 >Re: renaming files in Finder (From: Stephen Swift <email@hidden>)
 >Re: renaming files in Finder (From: Mr Tea <email@hidden>)

  • Prev by Date: quick postscript re coercing integer to real
  • Next by Date: Re: Shutdown Script In X
  • Previous by thread: Re: renaming files in Finder
  • Next by thread: Re: renaming files in Finder
  • Index(es):
    • Date
    • Thread