• 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 recursively
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming recursively


  • Subject: Re: Renaming recursively
  • From: David Marshall <email@hidden>
  • Date: Mon, 20 Jun 2005 08:24:02 -0400

On Sun, 19 Jun 2005, Paul Berkowitz wrote:

set theFolder to choose folder
tell application "Finder"
set allMangles to every file of (entire contents of theFolder) whose
name extension is "#0"
repeat with theFile in allMangles
set theName to name of theFile
set name of theFile to (text 1 thru -3 of theName) & "wav"
end repeat
end tell

Before running this script, the OP might want to do a Get Info on on of the allMangles to be sure that the name extension and the _displayed_ extension are one and the same; as an experiment, in Finder I changed the name of an audio file from filename.mp3 to filename.#0, and was bemused to find iTunes still specified as the default app in the Open With contextual menu item.


Further investigation revealed the file's Name & Extension was now filename.#0.mp3 (I have Show all file extensions unchecked in Finder's Advanced prefs; the file in question included the extension in its name when sent by a friend via iChat).

I mention this simply because in such a case the script above will fail to rename such files, since their true name extension remains .mp3 and thus none of them will meet the 'whose name extension is "#0"' condition (assuming .mp3 instead of .wav here, but I think the point remains the same).

- - - - -

Dave

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Change color of pad in Image Events
  • Next by Date: Re: How to manipulate MP3 file in QuickTime Player
  • Previous by thread: Re: Renaming recursively
  • Next by thread: How to manipulate MP3 file in QuickTime Player
  • Index(es):
    • Date
    • Thread