Re: Renaming recursively
Re: Renaming recursively
- Subject: Re: Renaming recursively
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 19 Jun 2005 20:11:05 -0700
- Thread-topic: Renaming recursively
On 6/19/05 7:45 PM, "Patrick Collins" <email@hidden> wrote:
> I haven't messed with applescript for a while, and just was wondering if
> anyone has written anything already that does what I am looking for...
>
> I ran an audio format batch conversion utility that somehow messed up,
> and I have about 500 files that are ending in .#0 rather than .wav --
> so I am wondering if anyone has written a script that can recursively go
> through multiple levels of a directory and search for filenames that
> contain a specific thing (in this case a file like
> "HBE_12Z-Splash_Pa-Sch_f_D-na.#0" and rename it as
> "HBE_12Z-Splash_Pa-Sch_f_D-na.wav" )
>
> Otherwise, I'll just start working on writing something from scratch.
Actually you don't need a recursive routine. If you're in OD 10.2 or so or
later, 'entire contents' property in the Finder now works:
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
--
Paul Berkowitz
_______________________________________________
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