• 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: Photo List - again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: counter
  • Next by Date: Re: Read Text File to Rename Images - Please help!
  • Previous by thread: Re: Photo List - again
  • Next by thread: OSAX for mouse click?
  • Index(es):
    • Date
    • Thread