Special Batch Rename; remove trailing characters and make sequential

Hello,
I'm looking to make an Automator droplet which
Accepts a handful of files
Removes the last three characters while preserving the extension
Applies a trailing set of numbers to make the files sequential
In my googling, I have found several workflows that come close, but none which does all three. Here are a few:
https://discussions.apple.com/thread/3366373?start=0&tstart=0 -- only removes the first file if given a list
http://stackoverflow.com/questions/10040085/use-automator-applescript-to-crop-fi lenames-after-certain-character -- returns an error
I would appreciate any help, 
Thanks, 
Mitch

Something may have changed since it was written, so I guess it’s time for an update.
Ah I see; thanks for looking into it.
The solution would be to change the original script to one that strips the text and renames each item one at a time.
I feared as much. Sadly, this is beyond my Applescript knowledge. While I might be able to retrofit an ugly python script, I was hoping for the connivence and transparency of Automator.
Will the sequence be set to a specific starting value, or are you looking at adding the next available number?
Personally, I just need the sequence to start at 001.
Granted, my “ultimate” script would take an entire folder, parse out each unique instance of COMPANY_YEAR and rename the groups individually. The sequential renaming would dedifferentiate between Medicare_2008, Medicare_2007, and Regence_2008.

Similar Messages

  • Batch Rename - Remove Characters

    I have a large number of NEF files with the name JCC0nnn.NEF. Want to do a rename to DJN0nnn.NEF.  Is there any way to replace selected characters (e.g., JCC to NEF) or delete some characters (e.g., delete JCC) then add DJN in its place? I have changed the JCC prefix to DJN in the camera but still have several hundred downloaded files to change.

    An alternate script - it may provide clues for other manipulations of file names (add, delete, replace characters, strings and regular expressions in file names).
    # Collect a list of JCC*.NEF files.
    var str list ; lf -r -n "JCC*.NEF" > $list
    # Process files one by one in a loop.
    while ($list <> "")
    do
        # Get the next file path from the list.
        var str filepath ; lex "1" $list > $filepath
        # Get just the name.
        var str filename ; stex -p "^/^l[" $filepath > $filename
        # File name is, for example, JCC0123.NEF.
        # Create a new name by replacing JCC with DJN.
        var str newname ; sal -p -c "^JCC^l" "DJN" $filename > $newname
        # $newname is now DJN0123.NEF. Rename file.
        system rename ("\""+$filepath+"\"") ("\""+$newname+"\"")
    done
    This is in biterscripting ( http://www.biterscripting.com ) . Convert the algo to another language of your choice.
    I am wrapping $filepath and $newname in double quotes in the system command in case they contain spaces, etc.
    Richard

  • How do i remove a user and make myself the main user?

    I originally bought this MacBook Pro for me and my boyfriend. He entered in all of his information into the computer and now I am the only user of the Mac but i can't figure out how to stop getting all of the notifications for his facebook and twitter, as well as make my apple ID the primary ID for the laptop, any idea on how to fix this?

    Is your account an Admin account? Open Users & Groups or Accounts preferences. See if your account is an admin account:
    If you are, then just delete any other user accounts on the computer. Open Sharing preferences where you can change the computer's name if you wish.
    What version of OS X are you running? Select About This Mac from the Apple menu. The version will be displayed in the dialog.

  • How do you remove error 0X00000709 from your computer? I just removed one printer and added another!

         I have a HP Pavilion Elite HPE computer and had an HP 6500 printer as my default.  I purchased a LaserJet Pro CM1415 and loaded it into my computer and removed (I thought) was the software for the HP 6500. 
          However when I try to make the CM1415 my default it gives me an error 0X00000709 and tells me I can not do it.  I no longer have any other printer listed, however I noticed some programs (Adobe for instance) don't even recognize the new printer, just the 6500 which got removed.  I have already removed the drivers (software) for the new printer and reloaded it. Also I checked the registry and the 6500 is listed there.  I did nothing with the registry at this time.
         I would like to know how I can remove this error and make my new printer the default (only one listed) one?  Thanks in advance for any and all answers

    Hello Porgeman,
    You may want to try the solution that is mentioned on this Microsoft Answers thread.
    http://goo.gl/y3mtw
    Method: Try to change the default printer value in registry key and check if it helps.
    Registry Disclaimer: Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 .
    How to back up and restore the registry in Windowshttp://goo.gl/UPP7r)
    a) Click on Start.
    b) Type regedit in the start search and click Enter.
    c) Move to the location mentioned below.
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
    d) In the right column, you will find key Device, change the value to your Printer name.
    e) It is of the format for example: "HP LaserJet 4250 PCL6,winspool,Ne03:".
    f) Right click on the value and click on Rename, change it to your printer name.
    If I have helped you in any way click the Kudos button to say Thanks.
    The community works together, click Accept as Solution on the post that solves your issue for other members of the community to benefit from the solution.
    - Friendship is magical.

  • Batch renaming setting xmp to read-only

    Doing some batch renaming of audio files and it seems like randomly xmps are being set to read-only, losing the previous filename preservation in the process.
    Purging the cache for the folder seems to reset the xmp back from read-only, but i dont know
    why it is happening.

    Hi Felco,
      In the method IF_CRM_BSP_MODEL_ACCESS_IL~READ of the class associated with your structure(MAC) you have a parameter ET_FIELD_ATTRIBUTE in this you can mark the fields with this properties:
    A     Not Changeable
    B     Not Relevant
    C     Mandatory Field
    Regards.
    Manuel

  • Can I batch rename to remove prepended characters?

    I know the basics of batch renaming files, but can't seem to figure out if this is possible:
    I have a number of files scattered across different projects and folders.
    These files are named ABC-DEF-xxxxxxx
    The xxxxxxx is unique to each file, and non-sequential (sometimes just text words).
    So I am wondering is if there a way to batch remove the "ABC-DEF-" from the master file name and leave everything else in the name unchanged?
    I should say...without doing a tremendous amount of work like exporting the files from Aperture, changing the names somehow, then re-importing (which I think would be lots of work, esp since the files are scattered across different projects/folders).
    Thanks much everyone!

    This script will rename all the selected versions in the form XXX-YYY-FinalName to FinalName
    Doesn;t matter what XXX and YYY are or how long they are as long as the format is exactly three groups of chars separated by a dash.
    tell application "Aperture"
              set imageList to (the selection)
              if imageList is {} then
                        error "Select IMages."
              end if
              set {oldTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "-"}
              repeat with i in imageList
                        set n to (name of i)
                        set name of i to text item 3 of n
              end repeat
              set AppleScript's text item delimiters to oldTID
    end tell
    to run it select all the text in the box above right click it and select make new applescript. This will copy the script into the AppleScript editor.
    Start Aperture and select the images you want to rename.  I strongly advise you do this first on a test library to make sure it is doing want you want. Export some of the images as a new library and test with that.
    Note this will only change the version names no the original file names. If you also want to change the original file names once the versions are renamed select them and run  MetaDatat->Batch Change. Select Version Name Format: Current Version Name and select the Apply to Originals checkbox.

  • Error while handling special characters ( and &) in Sender File adapter

    Dear All,
    Scenario: Third Party System --> (File adapter) SAP PI 7.1 (SP05) --> (Proxy) ECC
    We are receiving CSV file and no mapping is required in PI as all the processing is being done by third party tool. But we are receiving special characters like ',",>,< and & in the csv file.
    When we are using File Type as TEXT and File Encoding as ISO-8859-1 than we are getting error. We changed File Type to BINARY and than we are able to handle ',",> but having issue in handling < and &.
    Any idea how we can handle it.
    Please note trhere is no Mapping in SAP PI so cannot uise Java mapping.
    Thanks a lot
    Chanakya

    Hey,
    You can add ABAP Script in Receiver Proxy for eliminating or replacing with NULL or empty. Since you dont have mapping for formatting these kind of junks you can follow the above approach.
    Else, you can remove the junks at OS level while running a small script and make it available to PI.
    Or else, you need to create mapping for sender and recevier structure though it is same, then you add a very simple UDF for fine tune.
    Use this UDF
    Here a is the input value.
    String b = "";
    b = a.replaceAll(",", "0");
    b = a.replaceAll("@", "0");
    Like all the special characters you can take and replace with zero.
    return b;
    Thanx
    Pothana

  • Batch rename does not remove original filename

    Bridge CS4 ver 3.0.0.464
    Not sure what I am doing wrong but when I try to batch rename my files for some reason I cannot remove the origanal filename,
    I have checked the preferences and searched for a solution and have come up with nothing.
    Any help would be great. Thank you.

    This has fixed the issue, however it is not really an ideal solution as it deletes all custom preferences, was there not a way to to reset just the renaming preferences?
    Thank you anyway, I forgot about cntrl bridge!

  • How do I remove a number sequence using batch rename

    Hi
    I know I've done this in the past but cannot seem to work it out today.
    I have a series of images "_####_[layercompName].png".  I would like to remove the underscores and numbers.  The underscores removal is easy, but how do I remove the numbers (####) when they are different for each filename?  I would like the end result to be [layercompName].png
    The reason I have these filenames in the first place is that I have run the photoshop script "layer comps to files", and this adds a number sequence prefix.  I have tried to alter the script following various instructions I've found from trawling the internet (this one included How do you remove the number sequence when exporting layer comps to files? CS6. Windows 8.) but without any luck.  So now I'm resorting to batch renaming in Bridge.
    Thanks!

    Here you go, taken straight from: DesignEasy: How to Remove Sequence Numbers and Empty Spaces When Exporting Layers and Layer Comps
    Run Adobe Bridge and navigate to the folder with exported files.
    Select all files which have sequence numbers.
    Go to Tools > Batch Rename.
    Choose: String Substitution from the first drop-down list in New Filenamessection. From the second drop-down choose: Original Filename. In the Find: text field type: _\d{4}_ (underscore, backslash, letter d, open bracket, number four, closed bracket, underscore). Leave Replace with: text field blank. Ensure that you have Replace All and Use Regular Expression checked as shown on the screenshot below.
    Click on the Preview button in the top right corner and ensure that files will be renamed as you want.
    Click on Rename button and you are done.
    In case you are first time doing this and you still have doubts if everything will work as expected, check Copy to other folder option when renaming files. This option is located near the top left corner under: Destination Folder.
    Another thing I want to mention is to remove everything that you have below String Substitution options. In case you see additional renaming options just click on minus (-) sign on the right side to remove them.
    How to remove/substitute empty spaces in the file name using Adobe Bridge
    It is pretty similar process. The only difference is that you should type: \s (backslash followed with letter s) in the Find: text field. You can leave Replace with: text field blank or to type underscore.

  • Batch Rename and Restructure Folders and Pictures within

    Hello, I have been messing around with Automator trying to get Automator to batch rename my pictures. It seems that Automator is a little limited in renaming the way I would like to.
    I would like to rename all of my pictures to have a folder structure (I don't believe Automator can do this part for me) of:
    "Pictures/Nikon Transfer 2/Date Taken yyyy - dd- mm/DSC_xxxx"
    Currently, after trying one of the programs out, I have altered the filename over several of them to a mess of something like "2012-01-24-DSC_0295.JPG.JPG" where the folder structure  I was trying to achieve was put into the filename and the extension was added into the filename.
    I have tried several programs (freeware and open source) to achieve this to no avail. I would like to stay away from trail software and paid software.  If anyone knows of any Automator tricks or other free, non-trial programs that can do such a thing please let me know! It would be greatly appreciated. Thank you very much for any feedback! PSkilton

    There are several renamers on the appstore. I use one that is called "A Better Finder Rename", which for me is very good: you find the download button here:
    http://www.publicspace.net/ABetterFinderRename/troubleshooting.html
    It is not free but still cheap.

  • Batch rename song titles and/or change case

    Importing cd's makes a mess of my song title format.
    The most common problem is a mix of cases: Proper Case (Capital for each new word) is the most common, but sometimes it's all lower case or all upper case. Especially the last one requires a lot of typing, title by title. Using an external renaming program does not affect the titles within iTunes. Is there a way to do that?
    Similar problem often happens to classical music. Some cd's mention the composer and/or performer in the title field, followed by the 'song' (track name). I want to delete the composer/performer or transfer them to the appropriate fields. Can I do that in one 'batch rename' action within iTunes?
    Thanks,
    Wim

    reposted the question, so marked this one as answered

  • Aperture batch file rename: remove dashes from date?

    Just wondering if it is possible to change the format of the date from YYYY-MM-DD to YYYYMMDD when you rename files as they are imported into Aperture 3? I In Aperture 3, the date format used includes dashes. I would like to have the file renamed without the dashes in the date. Is this possible?
    This question was previously asked and answered in 2010, however Aperture does not seem to have an option for this it the batch rename edit menu. Thanks

    It is not possible in the Aperture naming presets to remove the dashes or in any way change the date format.
    The reason is that it is not possible to access the individual components of the date. When you drag an Image Date or Current Date token to form the filename you can't just get the day or the month or the year which is what you would have to be able to do to remove the dashes.
    There is no technical reason this couldn't be allowed, Apple has just made the decision that it won't be allowed. You can try sending feedback to Apple requesting this, see Aperture->Provide Aperture Feedback.
    It is possible to do what you want either before you import the files or with an Applescript eitehr beforre import or within Aperture.
    For doing it before import you would basically copy the image files from the  camera card to a folder and then import from there. There are several programs that you could use to do the rename, Name Mangler has been mentioned here a few times. I've never used it so I can;t vouch for it.
    As for an in Aperture Applescript solution if you are familair with programming and/or Applescript it isn't to difficult to do but would be easier with some prior knowledge.
    regards

  • Batch renaming lots of files without zeroes (0065) and without 1(2), 2(2)

    Hi there,
    When renaming say 100 images, you can select three digits, and create something like:
    Image _001
    Image _002
    Image _003
    Image _004
    Image _005
    Image _067
    Image _068
    Image _069
    and so forth.
    But if you select one digit it comes out like:
    Image _1
    Image _2
    Image _3
    Image _4
    Image _5
    Image _6
    Image _7
    Image _8
    Image _9
    Image _1(1)
    Image _2(1)
    Image _3(1)
    Image _4(1)
    Image _5(1)
    Image _6(1)
    Image _7(1)
    Image _8(1)
    Image _9(1)
    Image _1(2)
    Image _2(2)
    Image _3(2)
    Image _4(2)
    Can bridge rename from say 1 to 100 without the zeros, yet still numbering consecutively without (#)?
    I'm looking for:
    Image _1
    Image _2
    Image _3
    Image _4
    Image _5
    Image _6
    Image _7
    Image _8
    Image _9
    Image _10
    Image _11
    Image _12
    Image _97
    Image _98
    Image _99
    Image _100
    Image _101
    Seems pretty simple.

    Hi,
    I have a preset that does what you are looking for..
    In Batch rename, I use a string subsitution with a regular expression "_0|_00" - which means "find _0 OR _00"
    New Filenames
    String Substitution - Original Filename - Find _0|_00 - Replace with _ 
    (make sure 'Use Regular Expression' is checked)
    See screenshots below...
    Regards..

  • HT3702 I would like to remove the credit card info from my account and only use iTunes prepaid cards. How do I take care of this and make sure that payment will be taken from iTunes cards? Thanks

    I would like to remove credit card info from account and only use iTunes prepaid cards. How do I take care of this and make sure payments are takin from the iTunes cards? Also, I need to change my last name and address on account.

    Hi Alexis ...
    I need to change my last name and address on account.
    Help here >  How to change the name you use for your Apple ID
    I would like to remove credit card info from account and only use iTunes prepaid cards.
    Help here >  Create an iTunes App Store account without a credit card

  • How do I remove my card details from payment and make it none again

    need to find out how to remove my bank card from payment info and make it none again

    On a Mac or PC, iTunes>Store>click your name in the toolbar and select 'Account Info' (in older iTunes click 'Account' in the links on the right). Presumably the iOS version is similar.
    Sign in. Click 'Edit' to the right of 'Payment information. You will see various credit card types listed, plus there should be a 'None' button. Click that then 'Done' at the bottom right.
    There have been reports that some people have been unable to carry this out. In that case probably only Support can help you. Go to https://getsupport.apple.com . Click 'See all products and services', then ' 'iTunes', and then 'iTunes Store', then 'Purchases, Billing & Redemption', then 'iTunes Store account billing'.

Maybe you are looking for