How can Automator or Applescript rotate 500,000 images in folders and subfolders.

Hi Everyone,
I have very specific question.
I've got 500,000 images that sit in 98 subfolders. Some of the subfolders contain 25,000 images.
Now my question: is there any script/automator workflow that I can use?
I was trying to create a workflow:
1. Ask for Finder Items
2. Get Folder Contents (tick repeat for each subfolder found)
3. Rotate images
It works OK, but only for these folders where there is less than 4,096 files:
I normally receive following error message:
'Rotate images failed - 1 error
too many arguments (12019) -- limit is 4096'
Is there any way to increase this limit or create completely different apple script?
I really hope that someone will help me with this one.
By the way my OS is Mountain Lion
Thank you

well, there are a couple of possibilities here:
system events is quitting (it will do that on its own after a few minutes of inactivity) and he script is getting confused when it has to restart
the file 00353391301.JPG is not a valid image file (corrupt data, or an unsupported file format with the wrong extension, or the wrong type of file entirely, or something like that).
so, covering the bases, try this revision:
set folderToProcess to choose folder with prompt "Choose a folder to process"
set folderPath to quoted form of POSIX path of folderToProcess
-- 13 is a spotlight constant for images that I can't find documented anywhere (I got it by saving a spotlight image search in the Finder and examining it in a text editor).  FYI.
set fileList to paragraphs of (do shell script "mdfind -onlyin " & folderPath & " '_kMDItemGroupId == 13'")
tell application "Image Events"
  -- tell image event not to quit itself
          set quit delay to 0
          repeat with thisImageFile in fileList
                    try
  -- open the image file
                              set openedFile to open thisImageFile
                              tell openedFile
  -- you didn't specify which way or how much you wanted to rotate.  this rotates them 90° clockwise
                                        rotate to angle 90
  -- save back to same file
                                        save
                              end tell
                    on error errstr
  -- image events had an error - dislpay alert, then skip this file
                              my displayError(thisImageFile, errstr)
                    end try
          end repeat
  -- reset Image Event's automatic quitting
          set quit delay to 900
end tell
on displayError(thisImageFile, errstr)
          tell application "System Events"
                    display alert "Image Events Error" message "file : " & thisImageFile & return & return & "error: " & errstr
          end tell
          set imageAlias to POSIX file thisImageFile
          tell application "Finder"
                    set label index of item imageAlias to 1
          end tell
end displayError
This makes three changes - it tells Image Events not to quit itself during script execution, it expands the error handling block to cover all the Image Events functions (this will report more detail and not interrupt further processing), and as a convenience labels any problematic file orange in the finder so it's easier to find. 
Also, I should point out that adayzdone and ludwip are presenting orthogonal approaches (one that finds files using the unix 'find' utility rather than mdfind, and one that's entirely unix-based using the underlying sips utility).  Treat each approach as its own thing; don't get confused and try to implement parts of each of them. People on this forum sometimes forget how confusing help can be when helpers are working off of different models and fail to thoroughly contextualize their posts.

Similar Messages

  • How can I better improve the color of images between Photoshop and Premiere?

    I have trouble getting true colors between Photoshop and Premiere CS6.
    What can I do to solve this situation?

    Premiere Pro works internally with colors in an RGB (red, green, blue) color space. If you want to edit video clips you create in Photoshop in Premiere Pro, create the clips in RGB.
    If you want to broadcast the final movie it is best to ensure, in Photoshop, that the colors in your image are broadcast-safe. Assign the appropriate destination color space—for example, SDTV (Rec. 601)—to the document in Photoshop.
    You can refer to some suggestion as below:
    http://help.adobe.com/en_US/premierepro/cs/using/WS6693F22C-C06E-431a-A634-62343C65BA7B.ht ml#WS4AF3A4A1-D276-4f3b-A5B2-D3C19D3269DA
    Let me know if you have any more questions on this.
    Cheers!
    Mandhir

  • How to export images into folders and subfolders

    I've been using Aperture as an orgianizer basically. Now I want to export everything into a sane folder structure, but I haven't been able to figure out a way. Currently I have a setup something like this:
    [Folder 1]
    --Project 1
    --Project 2
    --Project 3
    [Folder 2]
    --Project 4
    --[Folder 3]
    ----Project 5
    ----Project 6
    --Project 7
    And I want export everything exactly like that. For example Project 4 and Folder 3 should both be subfolders of Folder 2.  Does anyone know how to accomplish this?

    You can define an export preset for the subfolder names, but I do not think you can get so deeply nested as your structure is. You may have to do several exports, separately for the different parts of your library.
    An example for an export preset, that names subfolders is here:
    This will name the subfolders based on containing folder and project name.
    Regards
    Léonie

  • How can I use Applescript to copy a file's icon to the clipboard?

    Hello,
    How can I use Applescript to copy a file's icon to the clipboard?
    Thanks.
    Lennox

    there is no way to do that that I know of. but you can extract an icon of a file to another file using command line tool [osxutils|http://sourceforge.net/projects/osxutils]. you can then call the relevant command from apple script using "do shell script".

  • How can I save a rotated pdf file?

    I have received a pdf file of many pages in landscape orientation that need to be saved in portrait orientation.  I know how to rotate the file, but how can I save the rotated document?
    [This is my first entry, so apologies if I have got my entries mixed up]
    Laurie

    Hello Laurie,
    Unfortunately this does not work with Adobe Reader, but with Adobe Acrobat or similar programs (Google could be your friend ) BUT you could try Acrobat free for 30 days, if you'd like. See www.adobe.com/products/acrobat.html for more information.
    Hans-Günter

  • How can u have lock rotation off and mute feature off at the same time

    How can u have lock rotation off and mute feature off at the same time

    Maybe this will help. The link at the bottom is the same one that was posted above.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • How can I use AppleScript Studio to display an image

    How can I use AppleScript Studio to display an image in a dialog?

    Add an image well to your window in Interface Builder.
    You can also add an image file to the Resources group of your Xcode project and then set the image to be displayed inside the image well directly in Interface Builder. No AppleScript code is needed if the image is contained within your app bundle and can be set ahead of time like this.
    If the image is contained in your app's bundle but you need to set or change the image at run time then you can use a line of AppleScript to load it into the image well using just it's filename:
    set image of image view "yourImageView" of window "yourWindow" to load image "YourImageFile.jpg"
    If you need to load an image from an arbitrary location outside your app's bundle then use a path to the image file...
    set image of image view "yourImageView" of window "yourWindow" to load image "/path/to/YourImageFile.jpg"
    Steve

  • HT3702 How can I just prepay say 500 dollars on my itunes account, so that I dont need to have multiple transactions on my credit card...?

    Hello There! How can I just prepay say 500 dollars on my itunes account, so that I dont need to have multiple transactions on my credit card...? Cheers Dilip

    Hello DilipVenkat,
    Welcome to the Apple Support Communities. If you want to have a purchase iTunes Gift Cards to have credit on your account, just purchase an iTunes Gift Card at your local Apple Online Store or through iTunes. Store.
    iTunes: Sending iTunes Gifts
    http://support.apple.com/kb/ht2736
    iTunes Store: How to redeem a code
    http://support.apple.com/kb/HT1574
    Regards,
    -Norm G.

  • How can I transfer/copy my entire iPhoto library from one iMac to another iMac whilst keeping all the folders and subfolders intact?

    We recently purchased a new iMac for our office (8 GB memory, 2.7 processor, version 10.9.2) and we need to copy the iPhoto library from our other iMac (version 10.9.4) onto the new one. The photos are essential for our work and there are around 53,000 of them all organised into folders and subfolders and then the photos are manually ordered within the albums.
    We have tried connecting the computers but when we tried to access the iPhoto library on the new iMac it says that iPhoto is locked and we do not have permission to view it. We updated iPhoto on the old iMac as we thought that might be the problem but the message still appears. We've been advised to use an external hard drive but we're worried that will corrupt the organisation of the library. We have also been told not to do it over AirDrop / the Server because of the sheer quantity of photos.
    Any advice on how to safely do this would be much appreciated.

    No idea exactly what you did
    if you followed the instructions
    Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
    Then launch iPhoto. That's it.
    This moves photos, events, albums, books, keywords, slideshows and everything else.
    then you have exactly the same thin on your new system that you had on the old
    If you do something differently - like import the library instead of simply opening it - then it will not work
    did you dimply drag the iPhoto library from the pictures folder of the old machine to the pictures folder of the new machine and then launch iPhoto on the new machine?
    and to help it is important to use word correctly since that is the only communications method we have - in iPhoto folders do not contain photos - you view photos in events and you can organize them using albums (which view photos) and folders (which hold either albums or other folders - folders never have photos in them) so your description of the problem is not at all clear since it uses folders incorretly
    LN

  • How can I tell which catalog a missing image belongs to?

    How can I tell which catalog a missing image belongs to?
    Beating a dead horse.....Everytime I need "missing images" in LR4.2, I cannot access them, even though I am looking right at the location they presntly occupy because thye image is ALREADY IN ANOTHER CATALOG.
    HOW frustrating is this...going on 8 months now. But I need the images and I suppose I could just go back and reprocess 10,000 images that are missing in my collections but I have tried many solutions offered over the months that are just impractical.
    So Now I want to approach this thing from the other direction...
    If let's say one image is already associated with another catalog that houses that collection, ( and the collection is important because it has the edits), i want to go to that catalog instead.
    How do I do this?
    Any Ideas?

    So Now I want to approach this thing from the other direction...
    If let's say one image is already associated with another catalog that houses that collection, ( and the collection is important because it has the edits), i want to go to that catalog instead.
    How do I do this?
    It sounds as if you have been using separate catalogs for sets of images which are in separate folders. Perhaps you have had good reason to do that. But I would now make three linked observations:
    It seems that you are now more able to both find, and distinguish, things via a folder structure - rather than via whatever classification of different catalogs you may have thought were going to be helpful to you
    accordingly, having these mutiple catalogs is now getting in your way
    using folders works just the same inside one big catalog, as it does inside each of two smaller catalogs.
    The solution to the first two, IMO, is to merge your separate catalogs into one catalog. Then the third will kick in. You can still keep the current separate catalogs for archive or reference purposes, but the "Import from Another Catalog" function will MERGE copies of all their contents into a combined, larger catalog that you can use going forward. (The images and folders themselves, do not change in any way when you do this.)
    If you wish to track which catalog each image is currently inside, you could apply some kind of keyword across all images in that catalog, before carrying out the merge. However, it sounds to me as if your folder arrangement currently mirrors the different catalogs in some way anyway - and will continue to convey the same information once combined.
    Lightroom is designed to be able to work with large numbers of images more or less the same as with small numbers; and this has been anecdotally confirmed in many cases. AFAICT the main performance  issue is not  the size of the database, but the size and nature of the image data involved and the complexity of things you do with that, per image, also the ability of your computer system to carry these operations out, per image. (Another overall productivity issue is: do you need to keep navigating to and opening different catalogs; or... not!)
    Even if you merge catalogs and then change your mind about all or some of that, you can either: retain and go back to the previous un-merged catalogs - or: to preserve further work done since merging, you can use Export as Catalog to copy out a certain highlighted set of images. Then you can Remove what you wish from the main catalog - using the exact same means of identifying which images require this - for example, the image set you have only just exported to a new catalog will still be highlighted inside the source catalog.
    RP

  • Cache problem is the limitation of 500,000 images. REMOVE

    Mac Pro OSX 10.6 thru 10.9.
    I have Bridge CS6.
    I have a DEDICATED HARD DRIVE for nothing except Bridge Cache.
    My problem is....
    Bridge only allows for 500,000 images to be cached.
    I have nearly 3 million image files.
    1. Is there a way to remove this limitation?
    If not....
    PLEASE !!!!
    Provide an option in Bridge Preferences that allows this limitation to be removed.
    Simply include a Dialog Warning explaining that Bridge Cache can use up huge amounts of disk space.
    Warn the user that this "No Limit" option requires a Dedicated Cache Hard Drive (internal or external) otherwise there will be crashes and hangs and the potential to use up a system boot drive's space.
    For those of us who have more than 500,000 images, this change (suggested Bridge Upgrade) would be extremely helpful.
    Please do not make me repeat myself.
    I have a DEDICATED HARD DRIVE for nothing except Bridge Cache.
    This Bride Cache Hard Drive is huge.
    My only problem is the limitation of 500,000 images.
    This restriction needs removal.

    I understand your frustration, but then I'm not Adobe. 
    This is not a conduit to communicate with Adobe.  Remember, you are not addressing Adobe here in the user forums.  You are requesting help from volunteers users just like you who give their time free of charge.
    Supposedly there are dedicated Adobe forums for feature requests and for reporting bugs.  I lost track of where those are, probably because posting there is as futile as posting here. 
    Perhaps searching the forums directory or searching the forum itself may provide you with a link.

  • How can I take an item from one image and move it to another image?

    How can I take an item from one image and add it to another image, and rotate it to fit?

    Carefully select the objects of interest in one image and then copy, scale and position them into the other image. Then touch up the composite.
    Have to Love Photoshop for Retouching Images!

  • How can I create an csv/excel file using pl/sql and then sending that file

    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.

    968776 wrote:
    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.You are trying to do it at a wrong place..
    Whay do you want database (pl/sql) code to do these things?
    Anyhow, you may be interested in :
    {message:id=9360007}
    {message:id=9984244}

  • I am trying to use powerpoint but when I open a document I want to work on it does not open on my desktop. It appears as open on mission control but it disappears offscreen. How can I get it to open where i need it and can work on it?

    I am trying to use powerpoint but when I open a document I want to work on it does not open on my desktop. It appears as open on mission control but it disappears offscreen. How can I get it to open where i need it and can work on it?

    It's almost certainly too late.
    The time to create a backup is before a catastrophe.  After a catastrophe, it's too late.

  • How can I set up Cinema Display as a main screen and leave my macbook pro as a second screen instead?

    How can I set up Cinema Display as a main screen and leave my macbook pro as a second screen instead?

    I learned that the Dock is positioned at the chosen edge of whatever Display is positioned farthest to that side.  E.g. for the Dock to be positioned on the right side of the Cinema Display (instead of the right side of the MacBook), the Cinema Display must be oriented (by dragging) to the right of the MacBook monitor on the "Arrangement" tab of the Displays Preference Panel.

Maybe you are looking for