Jump to content

Script to Create Folder Structure then put images into folder based on extension?

3 posts in this topic

Recommended Posts

Hello all,

My goal is to be able to drag folders from my camera's memory card into a parent folder. Then run a script and have the folders renamed appropriately, move the .CR2 and .JPG files from the camera into a new subfolders based on extension, and create another new empty folder.

Folders from camera example:

- Parent Folder
                 - 100EOS5D  --Contains .CR2 raw image files. May contain .JPG files depending on camera settings. (Numbers change based on when the photos were taken)
                 - 101EOS5D
                 - 102EOS5D


Folder structure that I want:


-Parent Folder
                - Position_01 (Renamed from first folder)
                 - Position_01_Raw        --contains the .CR2 files

                                - Position_01_Jpg         --contains the .JPG files (if there are any)

                                 - Position_01_Stitched  --Empty folder

                - Position_02 (Renamed from second folder)
                   - Position_02_Raw        --contains the .CR2 files

                                 - Position_02_Jpg         --contains the .JPG files (if there are any)

                                 - Position_02_Stitched  --Empty folder





Ideally this would be a script where I could run when I'm ready to sort the folders. Can anyone help me out?

Model: Macbook Pro Retina
AppleScript: Version 2.9 (191)
Operating System: Mac OS X (10.10)

Share this post

Link to post
Share on other sites

Do you want to learn how to write scripts or do you need someone for you to write it?

I want to learn how to do this. I will probably want to script other folder related tasks in the future.


I have minimal programming skills. I took a C++ course like 10 years ago, so most of that knowledge is lost but the basic principles are intact.


Like I kinda get what I want to do:

Look in this folder

If folder name Contains "Position" but does not contain "Raw", "Jpg", or "Stitched" (If this is even the best way?)

then create new folder FolderName_FolderNum_Stitched

Look for .CR2 files. If found create new folder FolderName_FolderNum_Raw. Move CR2 files into said folder.

Repeat for .JPG files.



Look at next folder, run again.


I need support learning the syntax, and sort of how to approach the problem. Like how to get finder to look into multiple subfolders, 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.