Multi batch renaming with automator

Hi, everybody!
Hope I can find help in this section. Else, please forgive me if I posted in the wrong place...
I find myself in this situation.
I have many pdf's I need to transform into JPG's, but of course I need the name to be "meaningful". Each pdf contains 30 to 100 "sheets", that is to say it will produce from 30 to 100 jpgs
No problem with Automator and pdf-to-jpg.
Original pdf name: meaningless (something like "Scan_01")
JPG needed format: PREF_XXXXXX_EYY_S#
prefix is (by now) fixed: MAD
XXXXXX : a 6-digit progressive number BUT it has to increase each 4 jpg's
EYY: a progressive number that could be even set by hand, as it indicates the "Envelope" from which pdf's were scanned
S# : a number ranging from 1 to 4
Just to be clear (I hope), here is an example of how a correct output should look like:
MAD_123456_E01_S1
MAD_123456_E01_S2
MAD_123456_E01_S3
MAD_123456_E01_S4
MAD_123457_E01_S1
MAD_123457_E01_S2
MAD_123457_E01_S3
MAD_123457_E01_S4
MAD_123458_E01_S1
and so on.
Of course the point is not to prepend "MAD_" or whatever, and the "EYY" thing can go anywhere in the name (even after "MAD_"): I really don't know how to set a counter to switch from xxxxx1 to xxxxx2 each time S# reaches "S4" and, meanwhile, to reset "S#" to "S1".
Any advice on how to do that?

If I understand you correctly, you have a bunch of files that have been converted to jpg, and just want to rename them starting with a specified sequence.  The folowing Run AppleScript added to your workflow should be close - it extracts the name pieces from a dialog so that they can be manipulated and reassembled.  There isn't any error checking, it just assumes the format of the name is the same as the default answer:
property divider : "_" -- the character dividing the name pieces
on run {input, parameters}
     set output to {}
     set theAnswer to text returned of (display dialog "Enter starting sheet name:" default answer "MAD_123456_E01_S1")
     # break the name apart at divider - format is assumed to be the same as the default answer
     set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, divider}
     set {prefix, survey, envelope, page} to text items of theAnswer
     set AppleScript's text item delimiters to tempTID
     # extract numbers
     set envelope to text -2 thru -1 of envelope
     set page to (text -1 of page) - 1
     repeat with anItem in the input
          set page to page + 1
          if page > 4 then
               set page to 1
               set survey to survey + 1
          end if
          set theEnvelope to "E" & text -2 thru -1 of ("00" & envelope) -- leading zero
          set thePage to "S" & page
          tell application "Finder"
               set name of anItem to prefix & divider & survey & divider & theEnvelope & divider & thePage & ".jpg"
               set end of output to anItem as alias
          end tell
     end repeat
     return output
end run
Edit: I am a he, by the way.

Similar Messages

  • Batch Renaming with Counter

    I am trying to do batch renaming with a counter. Unfortunately every time I try to use a counter, it stays the same number.
    For example/
    I have two clips that I want to rename Ceremony 1 and Ceremony 2. When I do the batch renaming, the clips change to Ceremony 1 and Ceremony 2. The counter doesn't work.
    I could do keyword collections or rename them individually, but I have too many clips.
    I hope someone could help me.

    I figured it out. As you saw above, I wasn't having a problem batch renaming the title of the clips. I was having a problem with the counter. I learned in a previous posting that when you change the name of a subclip of a clip, it changes the name of both the original clip (clip in event browser, not hard drive) and the other subclips associated with it. It doesn't matter how you rename the clip (changing the name in the Name box of the Inspector, change it by clicking the name of the clip once in the event browser and typing it in, or using custom naming (click on the gear button in Inspector to find it), the name will always change correctly. For some reason (I guess a FCPX thing lol), you can't use the counter in custom naming correctly unless you change the original name through custom renaming. If you change the original name of a clip the other two ways, then try to change the new name of the clip using custom renaming with the counter, the counter will always stay the same number.

  • Batch rename in automator with step

    I'd like to rename a large number of files in Automator with alternate numbers. For example, files 1-10 would be renamed 1,3,5,7,9,11 etc, and 2-10 would be renamed 2,4,6,8,10,12 etc. I'm familiar with rename finder items but cannot think of a way to make it rename with alternate numbers. Any help would be greatly appreciated.

    Try BatchRename'Em - CNet Downloads or MacUpdate.

  • Batch rename with minimum numeber of digits in sequence number

    I'm pretty sure I remember this working how I wanted in previous versions of Bridge, but at least since cs4, it has not worked as I would like. I've tried searching for an answer or a setting that I'm missing, but have come back empty-handed.
    Here's my situation. Let's say I'm renaming 18 files. Each file has a sequence number. I want the sequence numeber for the first 9 to be one digit, and for the second nine to be 2 digits.
    i.e. image_1.jpg, image_2.jgp, image_3.jpg...image_10.jpg, image_11.jpg...
    The best way I've found that I can do this is to select all 18 images, and assign a 2-digit sequence number. Then, once that is complete, select the first 9 and repeat, but with a 1 digit number.
    In the past, I could select all 18 images, and choose a 1 digit number, and after 9, it would switch to 10, instead of going back to zero. Is there still a way to do that? I know it's only one extra step, but that one extra step is actually kind of two, because each time I have to reset tho starting number back to 1 or 10, and switch the setting from 2-digits to 1-digit and back again. And I usually have to rename multiple groups of files at once, so it does add up. Granted, much better than renaming one at a time, but not as convenient as I feel it could be, and as it once was.
    Am I missing something?
    Thanks,
    iLan

    While I certainly can understand the way in which computers work, I also understand that in a program as complex as any of the components in Adobe's Creative Suite, there is most certainly a way to override the computer's numerical logic so that it can remove the initial "0" from a 2-digit number. Granted, that may not be possible in the current version of Bridge, theoretically it is "Possible". And I'm quite sure it functioned that way in previous versions, although I really don't know which version I was using when it worked that way. Maybe cs2?
    As a developer, the whole reason for this question is to avoid having to create extra code in my applications to add an unnecessary "0" to digits 0-9 in any filenames of any files I want to load. Although it looks as though adobe changed the default behavior of the batch rename function, and removed (or in some peoples' minds improved) some functionality without an option to get it back.
    Unfortunately for me anyways...
    Thanks for the help,
    ilan

  • Batch Rename with additional "."s, drops the file extension. Request for "Keep File Extension" option...

    I NEVER name files with extra "." s in the name. I realize that all OS's (even Windows) will recognize it, but I haven't gotten out the old mindset of 8.3 filenaming... Although I do use longer names. So... I was surprised to see that when I was renaming files as per a clients naming preference to add a period within the name, the file extension is removed.
    For example: 
    original file -  2014_10_31_1643.CR2   when batch renaming to "2014.31" + sequence, drops the "CR2" extension.
    but.... if I change it to "2014_31" + sequence, the ".CR2" remains
    Since adding multiple "." is a legitimate naming convention, shouldn't the file extension remain?  Or, possibly this could be made more flexible by adding a check box "Keep file extension"
    just a thought.

    Refer to this stackexchange article:
    http://apple.stackexchange.com/questions/47319/how-can-i-make-os-x-recognize-new -file-extensions
    The finder will only select the filename only for "known" file types.

  • How to batch rename with index/counter all files in a project?

    I have a project with files named with an index (I believe that is the correct term).  For example, the files are named XX1, XX2, and so on.  However, some files have the same name because I imported from two different memory cards, without thinking to set the starting number for the second import into the same project.  I would like to batch rename all of the files (masters and versions) with a consecutive index (1, 2, 3, and so on).  How can this be done?  I have found in the manual the way to do this on import, but not how to correct my mistake now.  Thanks!

    I would like to batch rename all of the files (masters and versions) with a consecutive index (1, 2, 3, and so on).
    Select the images in the project and then use ( from the main Aperture application menu)
         Matadata -> Batch Change (Shift-Command-B)
    Set the Version Name format to one of the "Custom with Index ..." or "Custom with Counter ..." formats and check "Apply to Master Files". Make sure you disable all other changes that you do not want, like Time Zone correction, or keywords.
    Regards
    Léonie

  • Batch Rename with String Replacement?

    Is there a convenient way to batch rename files after they've been imported? The template mechanism seems to work well for creating new names, but not for renaming. For example, I originally imported and renamed my images to look like this:
    Zemke_YYMMDD_NNN-O1.CR2
    I decided I would rather have DRZ (My initials) instead of "Zemke" as the prefix. I was able to get it done with some contortions:
    Metadata/XMP/Export
    Remove all files from Lightroom
    Rename all the external files to start with DRZ
    Reimport all the files
    Delete the XMP files
    I think what is needed is for Rename to include string replacement (and string deletion) functionality. Is it already there?
    Dan

    Stefano, nonadjacent selection can be done by holding down Control and manually selecting the additional image. If you want to select a lot of separate ranges, the way to do it is to add each range to the quick collection (press the B key), then go to the quick collection and select all. It's exactly for those kinds of scenarios that quick collection exists. Once you get used to doing it, it's easier working with a "sticky" selection like the quick collection rather than the contortions required to extend standard selections.
    To slightly add to Rory's comments: two-digit year plus spelled out month names and day of the week names are also available. Combine into any order you want, with any additional supporting text anywhere you want it, and you've got huge flexibility there. And no matter how complex it is, you can save it as a preset so it's readily accessible later.

  • Batch Renaming with Bridge

    Hi,
    Well I've never posted in the Bridge forum, but here goes!
    I work on a publication in which I have a long series of PDFs with the following names:
    p-1.pdf
    p-2.pdf
    p-3.pdf
    etc.
    I won't go into the details of why they're named like this, but I use Bridge to rename them into the following format (required by my printer):
    001PubName.pdf
    002PubName.pdf
    003PubName.pdf
    etc.
    The problem that I have is that if I have a long series of files (p-1 through p-200 for example), the Batch Rename process will only capture some of them.  It might do the first half (p-1 through p-100), and those will be renamed with the correct number.  Then, suddenly a few more pages will be named with something like p-565 (or other wrong number), then the last set will be left in their original p- names.
    What I'm trying to find out is how Bridge renames these.  Meaning, what does it look for to choose the rename process?  Usually if I do these in batches of no more than 50, it will rename them correctly (meaning the new numbered name will match the previous file number (p-25.pdf becomes 025PubName.pdf for example).  But if I do a longer list, a lot of them will be messed up.
    I eventually have to enlarge the thumbnails to their maximum size and compare the file name with the page numbers on every page (though that's still faster than manually renaming all the files).
    Any ideas?  Or suggestions on doing this?
    Thanks, Phyllis

    phyllisj9 wrote:
    Their download link is broken, but I'll see if I can find it on another site.
    So it is!
    I just googled "the rename" and picked cnet because they are well known.
    You've probably found it by now.

  • Batch renaming with droplets

    I'm trying to create a Photoshop droplet that will:
    (1) resize a set of images
    (2) append a suffix to their document names and save them as a .jpg in a specific folder
    (3) repeat actions (1) and (2) so that I end up with several different-sized copies of each image, each saved under an appropriate name.
    For example, if I start out with a file called Image.jpg, I want to end up with a large version of the image called Image-large.jpg, a medium version called Image-medium.jpg, and so on.
    What I can't figure out is how to record an action that will rename images in batches. I tried Save for Web and Devices - using the file naming option in the "Saving Files" pane under "Edit Output Settings" - but that doesn't seem to have any effect. The file names that I input don't seem to get recorded - they don't show up in the actions pane - and I end up with a file that's just titled Image.jpg.
    I also tried editing the file naming in the Create Droplet pane. That gives me a file with the right title (Image-large.jpg), but it also means that I can't repeat the file-renaming action within the same droplet. In order to create separate images called Image-large.jpg and Image-medium.jpg, I would have to create two different droplets and run my images through both of them each time I want to process an image. I'd much rather have one droplet that can do it all.
    The other problem with using the Create Droplet pane to name my files is that I can't specify that I always want to save the file as a .jpg, no matter what format it's in originally. Save for Web and Devices seems to allow me to do that (and it also has some other options that I'd like to keep, such as the quality), but as I said, it won't allow me to rename the files the way I'd like to.
    Can someone help?

    I copied this from the CS3 help file:
    Saving Files output settings
    You set the following options in the Saving Files set of the Output Settings  dialog box:
    File Naming
    Choose elements from the pop‑up menus or enter text into the boxes to be  combined into the default names for all files. Elements include document name,  slice name, rollover state, trigger slice, file creation date, slice number,  punctuation, and file extension. Some options are relevant only if the file  contains slices or rollover states.The text boxes let you change the order and formatting of the filename parts  (for example, letting you indicate rollover state by an abbreviation instead of  the full word).
    In particular:
    ...enter text into the boxes to be  combined into the default names for all files
    Unless I am horribly confused, these settings apply to the save name of the file itself and allows one to include slice names if desired. However, I also see the following:
    Some options are relevant only if the file  contains slices or rollover states.
    I take this to mean that one cannot add a slice or rollover name if no such element exists however this should not prevent one from adding text or file creation date, punctuation, etc.

  • Batch printing with automator or applescript

    Hey all,
    I would really appreciate any help people could offer. I've looked at a bunch of forums and can't seem to find a solution to this problem though many people have similar problems that haven't been solved. I need to print a set of about 50 documents (mix of pdfs and docs) in a fixed order, multiple times throughout the week. I'd like any of the documents that are multiple pages to be double sided and stapled (we have a Ricoh 6000 that can staple) and for some of the items I need multiple copies (sometimes 4 copies, sometimes 2). I'm comfortable coding but new to automator and applescript so I'm having trouble finding the right combination.
    I tried using automator as follows:
    *do shell script*
    defaults write com.apple.print.custompresets com.apple.print.lastPresetPref 2SidedPacket
    *get specified finder items*
    *print finder items*
    with the idea that the shell script would change my printer settings to use the saved preset 2SidedPacket which is double sided and staples. i used get specified finder items and dragged the items that i needed from the finder. for items that i needed multiple copies, i just dropped them in "get specified finder items" the appropriate number of times. then "print finder items" speaks for itself.
    The problem is that while the appropriate number of copies prints, the settings are not used and so i get a bunch of single sided sheets that aren't stapled.
    Please help! This will save me quite a bit of time if I can get it to work.
    I'm happy to hear any ideas; scrap mine entirely if you want and start from scratch if you think you have a solution that will work. or add to mine. whatever you want.
    I appreciate your help.
    -Jake

    Hey all,
    I would really appreciate any help people could offer. I've looked at a bunch of forums and can't seem to find a solution to this problem though many people have similar problems that haven't been solved. I need to print a set of about 50 documents (mix of pdfs and docs) in a fixed order, multiple times throughout the week. I'd like any of the documents that are multiple pages to be double sided and stapled (we have a Ricoh 6000 that can staple) and for some of the items I need multiple copies (sometimes 4 copies, sometimes 2). I'm comfortable coding but new to automator and applescript so I'm having trouble finding the right combination.
    I tried using automator as follows:
    *do shell script*
    defaults write com.apple.print.custompresets com.apple.print.lastPresetPref 2SidedPacket
    *get specified finder items*
    *print finder items*
    with the idea that the shell script would change my printer settings to use the saved preset 2SidedPacket which is double sided and staples. i used get specified finder items and dragged the items that i needed from the finder. for items that i needed multiple copies, i just dropped them in "get specified finder items" the appropriate number of times. then "print finder items" speaks for itself.
    The problem is that while the appropriate number of copies prints, the settings are not used and so i get a bunch of single sided sheets that aren't stapled.
    Please help! This will save me quite a bit of time if I can get it to work.
    I'm happy to hear any ideas; scrap mine entirely if you want and start from scratch if you think you have a solution that will work. or add to mine. whatever you want.
    I appreciate your help.
    -Jake

  • Batch Rename causes error with 1000 files

    If I perform a batch rename with  more than 1000 files or more I get an error filled batch rename.
    I may have  6 difference sets of model poses with unique numeric names.  I select all files and rename with model's name and named sequentially with a 3 digit series.  What I get is a mix of the pictures in the sets with names that act like duplicates with a (1) in some of them.
    If I have less than 1000 files I have no problems. 
    Has anyone else experienced this?

    Paul
    Interesting but does not work here.  Tried it on a few test jpeg images.  Have enclosed the screen shot.  Unless I am doing something wrong, always a possibility, it does not list the old name, uses the new name,  and look at the extension.  It adds the sequence number after the extension so it is .jpeg003.  Which won't fly.

  • No batch rename?

    I like to re-arrange photos (i.e. weddings into ceremony, reception, etc.) before renaming. The stacking feature will be excellent for this. Is import the only place in aperature to re-name files other than manually doing it in list view? I am hoping that I am just overlooking this somewhere. If batch re-naming after import, stacking, and rearranging master images is not available, aperture's usefulness is greatly reduced for me. Might as well go back to Bridge and ACR.

    thanks for replying. I am still having a problem though. After sorting (stacking) by image date, time taken, I then manually sort some of the images (groups and formals taken after ceremony with formals before, etc.) In other words, sorting by time taken gets me in the ballpark but then I further re-sort some images the way I want them, some may actually be out of order from time taken. Then, when I batch rename with metadata batch, aperture still renames all files by the date and time and ignores any manual sorting I did. Bridge did not work this way - after manually sorting and getting images in the order I wanted them, the batch rename would sequentially name them in the order I arranged them in. It's all just a new workflow for me, I may eventually figure it out. I really want to like aperture! Unlike some others, I do like the raw conversions I am getting (Canon 5D and 1DMkII)

  • Batch rename of version name to fix a typo?

    When I import images, a have Aperture give them a version name that is composed of the date, the master file name and a custom part. (I know this is a bit redundant, but hang on for now).
    E.g. a version name would be "20101022-hopsack-DSC_1234". Note: no extension!
    Now suppose that fter importing I notice that I've got the custom name wrong; instead of "hopsack" it should've been "debrem".
    So I do a Batch change on those images, selecting the same version name format as in import, and type in the proper custom name, and voila, fixed, right? Wrong! The version name now contains the file extension, like so:
    Rename -> "20101022-debrem-DSC_1234.NEF".
    This is not what I wanted. Even worse, when you export this image with the current version name as file name, you'll get "20101022-debrem-DSC_1234.NEF.jpg". Looks rather stupid.
    Why does the [master file name] building block have different behaviors in Import and batch rename? Am I missing something?
    You could fix the version name with the Metadata inspector, but then you'd have to do it image by image.... OK for a few images, but not very practical for many.
    So, apart from making no mistakes during import, are there other ways to fix this?
    Oh, about that silly version name... I wanted to change the version names into something more sensible, but you can't batch rename images and re-use the custom name they have to make a new version name. So that would become a tedious process as well. Suggestion on how to handle this are welcome as well. (I could filter the images on custom name 1, batch rename with that name, then filter on custom name 2... and so on. Slightly less cumbersome.)
    Hints? Tips? Suggestions?
    Thanks,
    Peter.

    Sounds like the coder who implemented the code for this in file import didn't consult the corder doing it in the Batch change section
    Seriously, this isn't right, it should be one way or the other, ideally there should be two separate options, one with just the filename part and another with the extension, Then you could put them together any way you like.
    I'd send feedback to Apple concerning this.
    As for the situation you're in now, can't think of any easy way to make the change you want to.
    Sorry

  • Batch rename without sequence number

    In LR3 I originally named imported images with the date, custom
    word, and sequence number.  I now want to batch rename with just the date, and cust
    om word - no sequence number.  Yet the rename includes the
    numbers anyway, and they are different than the original sequence numbers.  How do I get rid of
    the unwanted numbers?  Thanks

    I don't think LR provides a way to cut characters from the end of an existing filename.
    Beat Gossweiler
    Switzerland

  • Quandary with batch rename  of photos

    This seems like it ought to be a simple task, but I'm stumped. I've got a couple hundred photos in an Event that I want to rename with a title + number. This part is easy using iPhoto's "Batch Change".
    But then some time later, I need to be able to add more photos to that Event and rename them with the same scheme. The problem is that the Batch Change doesn't let me specify what number I want the new photos to start at. It just starts them at 1 so I end up with duplicate titles within the event. Is there some clever way to do this that I haven't found yet?
    The Batch Change feature does allow for renaming the Title to match the Filename, but I've read that messing about in the Finder (to actually rename the files themselves) is a big NO-NO, so I don't think I want to go that route. But I haven't been able to find anything within Automator or any plug-ins that will allow for this changing of the photo title while specifying a starting index number.
    Hoping someone can point me to a way to do this. Thanks.

    I thought I'd follow up here in case others run into this. It turns out that you can achieve this as long as you sort it properly before the rename. An easy way to do this is to rename the newly added photos to something alphabetically after the set that is already in the event. Then just sort by title, Select All in the Event and do the batch rename again. All the original photos will retain their original titles (including the appended number) and the new ones will get new names that begin numerically after those.
    It would still be way better if the batch change just let you specify the number you want to start with.

Maybe you are looking for

  • Need help with MySQL Query...Again

    Ok so I get this error when I enter "springfield" and "MA" for the city and state. This server program accepts either a 'zipcode' or 'city, state' depending on the choice # passed to it. I just need to be able to perform the query. Thanks!! java.sql.

  • Major Aperture 3 memory leak

    Well, I've completed the migration of my A2 library over to A3, but it still needed to do some processing. I left it overnight and awoke to find a "Warning: Your startup disk is almost full" message, Aperture 3 paused, and everything else paged out o

  • Error in Infopackage- retrieve error data

    Hello experts, During execution of infopackage to extract data from ECC i had this error : "Error in codepage mapping for source system" read some thread i understand there was some idoc in error therefore i found the problem in BD87 in source system

  • Combine 2 rows

    I have result of a query as : emp_id emp_name wife_1 wife_2 wife_3 12   abc      xx 12   abc          yy 34  xyz         tt 34  xyz           pp 34   xyz                  uu I want to combine these reords so that the result should be like this : emp_

  • HT1657 How do I download a rented movie on Apple TV?

    I rented a movie, started it and had to stop it.  My Apple TV tells me to download it.  How?