Applescript Date/Time File Renamer Folder Action

Thu, 2005 Nov 24, 1:58pm

This is version 1.0 of the renameToDateTimeAndMoveToDateFolder Applescript Folder Action. I created it in order to rename photos taken using a Palm Zire 71, which doesn’t have very configurable file naming conventions for the photos taken. The Deyel photo gallery engine that I created in PHP reads jpg photos from directories named with the day that the photo was taken, and the file names must reflect the date/time stamp. So, I wrote this Folder Action to do the job of renaming them appropriately.

Place this applescript in the _root/Library/Scripts/Folder Action Scripts/ directory. Then apply it to a folder of your choice by command clicking on the folder and choosing Attach Folder Action (you must have folder actions enabled).

When the action has been applied to a folder, the script will take any files matching the extension list or the type list and rename them according to the creation date using the format “YYYYMMDDHHMMSS.EXT” and will place them in a folder (create it if necessary) for the day the file was created with the format “YYYY-MM-DD” inside the folder to which the action is applied.

This is handy for organizing digital photos, since most digital cameras give the photos non-meaningful names. This script does NOT use the jpeg EXIF metadata tag. The name is created using the creation date assigned to the file, which may or may not be passed to the file when syncing with the desktop machine. (This was originally created to rename photos synced from the Palm Zire 71). Use at your own risk.

Version 1.0 (Nov. 24, 2005)

Download :: renameToDateTimeAndMoveToDateFolder.zip

Entry Filed under: applescript, plasticware

4 Comments Add your own

  • 1. ruby tuesday  |  July 30th, 2007 at 2:45 am

    thank you so much! i’ve been losing sleep over how to get exactly this done .. seems simple enough until i try to pull it off in applescript. i’m more of a C++ / Java person i guess. kudos to you

  • 2. ryan  |  July 30th, 2007 at 9:21 am

    Cool. Good to know it helped. I’ll have to check and see what I’ve updated since then. And, yes, applescript is very verbose in some ways and somewhat counterintuitive at times. The best way to find out what syntax to use sometimes is just to find something similar that someone has done — it’s really hard to just find a reference guide online…

  • 3. Perroboy  |  September 9th, 2007 at 4:47 am

    Hi,
    Been searching for something like this for quite some time and was very excited to find yours.

    Thanks a mil!

  • 4. Perroboy  |  September 9th, 2007 at 5:03 am

    Sorry, but there’s one thing I don’t understand, and that’s the odd padding at the end of the filenames.

    For instance, an mpg created on 2003-12-02 is renamed: 20031202191812.mpg.

    What’s 191812? The precise timestamp? Can I truncate this somehow?

    Sadly, still doesn’t give me a workaround for files created on my videocam, which frequently dies and experiences date reset, producing files taken 1904-01-01 :(

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to the comments via RSS Feed


Site Decryption

info = { PlaIns: "the section of the PlasticStare site, the digital external brain-repository of Ryan Todd, whose brain otherwise occupies space in San Francisco, CA", ryota: "mungified version of ryan's name", haikuBio: "robotic from birth. hears sounds - listens to music. makes pixels act." }

Calendar

November 2005
S M T W T F S
« Oct   Dec »
 12345
6789101112
13141516171819
20212223242526
27282930  

Most Recent Posts