Re: Photo List - again
Re: Photo List - again
- Subject: Re: Photo List - again
- From: has <email@hidden>
- Date: Fri, 7 Sep 2001 11:17:28 +0100
Regular Expressions are wonderful, wonderful things which are great for
stuff like this. This one uses the very wonderful RegEx Commands OSAX.
http://www.lazerware.com/software.html
set names to "Background Sky 00659.jpg
Sunset 00660.jpg
Clouds 00664.jpg
Sunshine 00665.jpg"
--change lines which match "[name] [number].jpg" to "[number].jpg [name]"
REReplace names pattern "(.+) ([0-9]+)\\.jpg" with "\\2.jpg \\1"
If you want to do a folder full of files, use the following:
tell application "Finder"
activate
every file in (choose folder)
repeat with eachfile in result
REReplace (name of eachfile) pattern "(.+) ([0-9]+)\\.jpg" with "\\2.jpg \\1"
set name of eachfile to result
end repeat
end tell
(If any of the lines get wrapped in the email, make sure to fix them before
running.)
HTH
has