Help with batch renaming

I need to create a custom renaming script and just can't seem to figure it out. I'm already in Bridge CS6 with the Batch Rename dialog open.
My files are currently named as such: ABC-100-name-01
I need them to read: ABC-100-01-name
Absolutely any help is appreciated! This will be an incredible time saver.

OK, try adding this to your scripts folder… Done slighty long hand so's you can swap about if needed…
To run select Custom Rename at the bottom of the Tools menu…
#target bridge
#engine main
if ( BridgeTalk.appName == 'bridge' ) {
          var toolMenu = MenuElement.find( 'Tools' ),
          customRename = new MenuElement( 'command', 'Custom Rename', '-at the end of toolMenu', 'muppet009' );
customRename.onSelect = function () { renameFiles(); }
function renameFiles() {
          if ( app.documents.length == 0 ) { return; }
          var i, count, doc, file, parts, baseName, ext, oldName, newName;
          doc = app.document;
          count  = doc.visibleThumbnailsLength;
          for ( i = 0; i < count; i++ ) {
                    if ( doc.visibleThumbnails[i].type == 'file' ) {
                              oldName = decodeURI( doc.visibleThumbnails[i].name );
                              baseName = oldName.match( /(.*)\.[^\.]+$/ )[1];
                              ext = oldName.replace( /^.*\./,'' );
                              parts = baseName.split( '-', 4 );
                              newName = parts[0] + '-' + parts[1] + '-' + parts[3] + '-' + parts[2];
                              if ( ext != '' ) { newName += '.' + ext; }
                              file = doc.visibleThumbnails[i].spec;
                              //$.writeln( newName );
                              file.rename( newName );

Similar Messages

  • Help with batch processing

    Hi, I am having trouble with batch processing. I want to apply adaptive noise reduction (ANR) to several files from the same source tapes. So, following the help instructions, I create a script from one file. When I try to apply it to the other files, instead of applying ANR to them, it simply saves them as is. The steps I perform are as follows:
    I select the entire wave (I have also tried it without first selecting)
    I open the scripts box in the file menu
    I click on open/new script collection and create a new script
    I title the new script
    I click 'record'
    I close the scripts box
    I run ANR on the file
    I go back to the scripts box and click 'stop current script'
    I click add to collection
    I close the scripts box
    I open the batch processing box
    I select the files, then the script, then I click to start processing
    When I try to apply this to script to other files, it saves them but doesn't apply ANR.
    Can anyone suggest what I am doing wrong? Also, in the scripts box, there are three options for the type of script that I can create. One is highlighted: 'Scripts start from scratch.' Is that the correct one to use? If not, how do I select one of the others? I click on them but nothing happens. Finally, when creating a script, do I save the file before or after clicking 'stop record'? I have tried it both ways but don't know which is correct (neither seems to make a difference).
    Just to be as thorough as possible, below is the text of one of my scripts, in case that contains any clues. Thanks so much for any and all help!!
    Collection: doubletnr
    Title: d2
    Description:
    Mode: 2
    Undo: 0
    Selected: none at 0 scaled 109479495 SR 44100
    Freq: Off
    cmd: Channel Both
    Selected: 0 to 109479494 scaled 109479495 SR 44100
    Freq: Off
    Comment: Restoration\Adaptive Noise Reduction
    cmd: {EA93BBBE-0B8F-47D6-AC6D-B67B46524E41}
    1: 52,AAA€ÛÚZ€AAQ€ãýÇÛÚÚAAA€Ďč¸āĂ}úƒÓ~ip€k•iëåÁëåÁ
    2:
    3: 13
    4: 0
    5: 0
    6: 3190728
    7: 0
    8: 0
    9: 0
    10: 1
    Freq: Off
    End:

    This is what my script looks like. Although I was worried about the strange characters in the script, it does work.
    Make sure that the script you use is suitable for the sample rate and bit depth of the file. E.g. if you have 44100/32-bit files, then don't use a script that was recorded on a file with e.g. 48000/16-bit. If required, resample or make different scripts for different rates/depths.
    Collection: Test ANR AA Forum
    Title: Test ANR AA Forum
    Description:
    Mode: 4
    Undo: 1
    Selected: 0 to 9233563 scaled 9233563 SR 44100
    Freq: Off
    cmd: Channel Both
    Selected: 0 to 9233563 scaled 9233563 SR 44100
    Freq: Off
    Comment: Restoration\Adaptive Noise Reduction
    cmd: {EA93BBBE-0B8F-47D6-AC6D-B67B46524E41}
    1: 52,AAA€ÛÚZ€AAQ€ãýÇÛÚÚAAA€Ďč¸āĂ}úƒÓ~ip€k•iëåÁëåÁ
    2:
    3: 13
    4: 0
    5: 0
    6: 154705552
    7: 0
    8: 0
    9: 0
    10: 1
    Freq: Off
    End:

  • 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.

  • Online help with Batch Capture

    I'm trying to online a sequence in a tapeless workflow.  I'm using Log & Transfer along with Batch Capture but Batch Capture keeps looking for a deck.  How do I get it to look for my Hi-Res digital files?

    Yeah...that's the problem.
    You directly imported it and worked with it natively? What is this footage? From what camera?
    The only way to offline/online with tapeless is to bring in the footage via Log and Transfer.  Log and Transfer to ProRes Proxy...then you can Batch Capture to a higher data rate ProRes format.

  • Help with Batch Labeler (extremely Urgent)

    Good Afternoon Eeveryone,
    I am in need of help to create a Batch file to stamp the filename of the PDF document in the document itself.
    This is for audit and control purposes.
    i have the following javascript to add the filename as a header.
    app.addSubMenu({ cName: "Header",cUser: "Set/Remove Header", cParent: "File", nPos: 20 });
    app.addMenuItem({ cName: "(Filename)", cParent: "Header", cExec: "SetHeader(1)"});
    app.addMenuItem({ cName: "-------------------------------", cParent: "Header",cExec: "{}"});
    app.addMenuItem({ cName: "(Filename)", cParent: "Header", cExec: "RemoveHeader(1)"});
    //Set/remove Header
    function SetHeader(ARG)
    var re = /.*\/|\.pdf$/ig;
    var FileNM = this.path.replace(re,"")+".pdf";
    var Path = this.path;
    var AcDate = new Date();
    var AcDateFormat = "yyyy/mmm/dd  HH:MM"
    var Box2Width = 50
    for (var p = 0; p < 1; p++)
      var aRect = this.getPageBox("Crop",p);
      var TotWidth = aRect[2] - aRect[0]
      if (ARG<=3 || ARG==9)
       { var fd = this.addField("xftDate", "text", p, [20,1600, TotWidth-30-30,30]);
          fd.value = "Nº:" + FileNM;
           fd.textSize=12; fd.readonly = true;
           if (ARG==1){ fd.alignment="left" };
           if (ARG==2){ fd.alignment="center" };
           if (ARG==3){ fd.alignment="right" };
      if (ARG==4 || ARG==5 ||ARG==9)
       {  var hStart=(TotWidth/2)-(Box2Width/2)
           var hEnd=((TotWidth/2)+(Box2Width/2))
           if (ARG==5){var hStart=(TotWidth-Box2Width-30); var hEnd=(TotWidth-30);}
           var fp = this.addField(String("xftPage"+p+1), "text", p, [hStart,30,hEnd,1450]);
           fp.value = "Page: " + String(p+1)+ "/" + this.numPages;
           fp.textSize=12;  fp.readonly = true;
           fp.alignment="center";
    function RemoveHeader(ARG)
    if (ARG<=3 || ARG==9) {var x = this.removeField("xftDate");}
    if (ARG==4 || ARG==9)
       {  for (var p = 0; p < this.numPages; p++)
          {var x = this.removeField(String("xftPage"+p+1)); }
    I found this on another Thread and made some changes to suit my needs, now i need this to reproduce to a large ammount of pdf files, and that works with adobe reader.
    i have this batch file that i also took from another thread, if i click on it it works fine, i change the directory where it sends the files but when i drop a file on it it gives a error saying it cant "create object acroexch.app"
    '//////  User settings /////////////////////////////////////////////////////////
    fileSaveDir = "c:\Temp"    '/->state an existing folder for saving changed files
    mode = 1         '/->  0=work hidden; 1= show acrobat
    test = 1             '/-> 0= don't show messages; 1=show messages
    '    // set WSH objects
    set oWsh = CreateObject ("Wscript.Shell")
    Set oArgs = WScript.Arguments
    Set fso = CreateObject("Scripting.FileSystemObject")
    '    // test basic files/folders
    if not fso.FolderExists(fileSaveDir) then : msgBox("Folder """ &fileSaveDir &""" don't exist") : wscript.quit : end if
    if oArgs.Count = 0 then :    MsgBox("Drag & Drop files on this") : Wscript.quit : end if
    '    // set acrobat basic objects
    Set App = CreateObject("Acroexch.app")
    if mode > 0 then app.show
    Set AVDoc = CreateObject("AcroExch.AVDoc")
    Set AForm = CreateObject("AFormAut.App") 'from AFormAPI
    '    // write  acro-js to a variable for later executing
    Ex = "  // set Date and filename as footer  "&vbLF _
      & "  var re = /.*\/|\.pdf$/ig;  "&vbLF _
      & "  var FileNM = this.path.replace(re,"""")+"".pdf"";  "&vbLF _
      & "  var AcDate = new Date();  "&vbLF _
      & "  var AcDateFormat = ""yyyy/mmm/dd  HH:MM"";  "&vbLF _
      & "  for (var p = 0; p < this.numPages; p++)   "&vbLF _
      & "  {   "&vbLF _
      & "    var aRect = this.getPageBox(""Crop"",p);  "&vbLF _
      & "    var TotWidth = aRect[2] - aRect[0];  "&vbLF _
      & "    var fd = this.addField(""xftDate"", ""text"", p, [30,15, TotWidth-30-30,30]);   "&vbLF _
      & "    fd.value =  util.printd(AcDateFormat, AcDate) + ""   ("" + FileNM +"")"";   "&vbLF _
      & "    fd.textSize=6;   "&vbLF _
      & "    fd.readonly = true;  "&vbLF _
      & "    fd.alignment=""left"";  "&vbLF _
    '    // kernel: batch processing of js-code
    for each xFile in oArgs
        if test = 1 then : OK = msgbox("Change file: " & xFile,1) : if OK = 2 then WScript.quit : end if
        If not fso.FileExists(xFile) Then : msgbox("File doesn't exist") : wscript.quit : end if
        If AVDoc.Open(xFile,"") Then
            set PDDoc = AVDoc.GetPDDoc
            AForm.Fields.ExecuteThisJavaScript Ex
            outFile = fileSaveDir &"\" &mid(xFile,InstrRev(xFile,"\")+1)
            if test = 1 then : OK = msgbox("Script executed"&vbCr&"SaveAs: "&outfile,1) : if OK = 2 then WScript.quit : end if
            If fso.FileExists(outFile) Then fso.DeleteFile(outfile)
            PDDoc.save 1, outFile
            App.CloseAllDocs
        else
            msgbox("Coudn't open file!") : wscript.quit
        end if
    next
    OK = msgbox("Batchjob finished!" &vbCr &"Close Acrobat?",1) : if OK = 1 then app.exit
    Set AVDoc = Nothing : Set PDDoc = Nothing
    Set APP = Nothing : Set AForm = Nothing

    thanks for all the replies, the documents are forms usage rights, the first javascript is running fine and dandy doing exactly what i want, all i need is something to run that javascript on multiple pdf at once.
    since this is for audit purposes i really could use this otherwise i would have to manually write over 400 document filename/numbers on eveyr piece of paper..
    =X

  • Need help with batch processing picture packages

    Hi, I am having trouble batch processing picture packages is CS2.  (Windows).
    I have hundreds of images that need to be processed into picture packages and would love to find a speedier way to do this.
    I know how to create an action.  I know how to batch process from this action.  I also know how to create picture packages, but I cannot get the final result I am after - please read on....
    I have seperated all the images into their seperate folders for each style of picture package required.
    I can create an action for the picture package required and then do a batch process on the particular folder, but this leaves all the picture packages open on the desktop - as when you chose the close and save in the batch process - this only closes and saves the original image - the picture package has been created as a new document and is on the desktop still open - named Picture Package 1, Picture Package 2 - etc etc.
    I hope I am making some kind of sense here... (??!!)
    What I would like to happen is that the picture package will be saved over the original file (or to a new folder) with the original file name of the original image or maybe even with an adjustment to file name (e.g - orignal file name sc1234.jpeg - new file name sc1234packA.jpeg)
    So is this possible to do??  I'm thinking there must be a way.... i'm sure there are many group photographers out there who come across this everyday??
    Otherwise I have to save each picture package manually to original file name (via searching though files to match the original image to the picture package....) Very time consuming.
    Thanks for your help (in anticipation)...
    Jodie

    hmm - thanks for that - sounds like I will have to try and find some info and assistance regarding the scripting - it may be something I need to look into at a later time in the future....
    At the moment though I will have to plod along with this method I guess!
    Thanks for your assistance...
    Jodie

  • Need help with "batch saving workflow" quicktime / automator

    Hi, my goal:
    I have a lot of folders with (windows) DV-avi files I need to change container to apple mov.
    The best way - I found out - to just change the container from avi to mov - without touching the video and audio stream or metadata - is:
    open the file in quicktime pro 7
    save as self contained movie (same filename, same location).
    wait til finished.
    open next file...
    As far as I understand, the script should open and handle many files automatic, file by file - always waiting til process is finished, before starting with next file.
    A probably similar thing I found is a script for batch encode..... but I need batch save , because I don't want to "touch" the source media
    on run {inputFiles}
      if inputFiles is equal to {} then
        set inputFiles to (choose file with prompt "Select the file(s) to convert:" with multiple selections allowed without invisibles)
      end if
      open inputFiles
    end run
    on open droppedItems
      tell application "Finder" to set inputFolder to (container of first item of droppedItems) as Unicode text
      set outputFolder to (choose folder with prompt "Select output folder:" default location (inputFolder as alias)) as Unicode text
      set exportPreset to (choose from list {"Movie", "iPhone", "iPod", "HD 480p", "HD 720p"} with prompt "Choose QuickTime Export Preset:") as Unicode text
      if exportPreset is equal to "false" then
        return
      end if
      repeat with currentItem in droppedItems
        repeat until getProcessPercentCPU("CoreMediaAuthoringSessionHelper") is equal to ""
          delay 30
        end repeat
        tell application "Finder" to set fileName to name of currentItem as Unicode text
        convertFile(currentItem, outputFolder & fileName & ".mov", exportPreset)
        delay 30
      end repeat
    end open
    on convertFile(inputFile, outputFile, exportPreset)
      tell application "QuickTime Player"
        set thisMovie to open inputFile
        export thisMovie in (outputFile) using settings preset exportPreset
        close thisMovie
      end tell
    end convertFile
    on getProcessPercentCPU(processName)
      do shell script "/bin/ps -xco %cpu,command | /usr/bin/awk '/" & processName & "$/ {print $1}'"
    end getProcessPercentCPU
    As I can’t get it to work myself, I ask for help…….
    Appreciate your answer
    all the best from austria

    You don't need to go through the double export process. You can either place the edited and rendered 720p sequence in the 352x288 sequence and then export, or you can scale the image down on export in the QuickTime Conversion export module, or in Compressor. Any QuickTime can read uncompressed video.

  • Help with Batch Capturing, Timecode Issues?

    Hi Final Cut Pro Pro's. I've just come over from Avid.
    I have a problem with capturing - I have a lot of tapes to capture and there is no way I will make deadline doing it by individual capture - I need to batch capture. My tape shows no timecode breaks and I have already spent hours logging all the various clips. It shows it has registered all of the media start/end timecodes, but when I click on batch capture, it says
    BATCH CAPTURE: TIMECODE ERROR: UNABLE TO LOCATE THE SPECIFIED TIMECODE. YOU MAY HAVE SPECIFIED A TIMECODE WITH INSUFFICIENT ROOM FOR A PRE/POST ROLL OPERATION.
    I don't understand as there is clearly a functioning timecode? This is going to break my balls if I have to go through this individually, no time! Anyone? Any ideas?
    Thank you.

    I'm capturing from the camera directly, a Sony DSR-250...
    It turns out that yes, if you have marked the in/out point too close to the head or the tail of the tape, or even if you have marked it okay and are currently at the start/end of tape when pressing on batch capture it cannot send the command to the device. If you move forward or backward accordingly by five or six seconds it doesn't come up anymore.
    Thanks for all the responses, I'm going to make deadline now. Apple forums are my hot hot S€X.

  • Need help with batch

    Hi forum,
    I'm using batch with CS5 to save JPG files in a new folder from Illustrator files located in another folder. I recorded an action while using save for web and devices to save a JPG file with the required options. With any options I tried in the batch window I can't get a smooth batch operation. With each file  processed Illustrator displays the dialog "do you want to save this file"   and I have to choose yes or no in order for the batch to continue. My workaround is to put a heavy mug on the Enter key of my keyboard and this will choose OK when the Save As dialogs appear for each file but I can't use other programs during the batch and when completed  the destination folder is full of Illustrator files, 2 copies of the original Illustrator files for each JPG saved. This makes the batch command very slow and a big pain.
    Has anyone successfully completed a batch command with SC5 on Windows to save JPG from .AI files without these problems?

    There is a thread in this forum explaining with an image the correct settings but my problem is with point one  "make sure that this section is grayed out". I don't know how to make it grayed out. The batch dialog opens with a folder already selected from my previous batch settings and the section is not grayed out. I can do it only if I reset the Illustrator preferences but if I don't click the Choose button in this section when I click OK to start the batch, a message is displayed saying I must click on it and choose a folder and I can't proceed.

  • Help with batch converting to change all videos to same size...720x480

    i need help batch converting all my .mov files to the same dimensions of 720x480...but i don't want to lose quality i just want to change the size...any suggestions in programs?

    Hi
    What format (codec) & size are your original movies?
    What video softwares (if any) do you have installed?
    ...any suggestions in programs?
    You mean ... free?
      Alberto

  • Can I open up a FCP 5.0 project in FCP 4.5? If not, help with Batch Lists!

    I know that normally one cannot do this, but surely there must be a way. Editors are constantly shuttling between machines, does apple provide no way to do this? If not, it essentially means that if you start a project in 5, you have to always work on that project in 5, even though many FCP stations (at least in NYC) don't have it yet.
    What is even more irksome is that when you export a batch list from 5 in an attempt to import to 4.5, it says "some column headings do not match" and it is essentially useless without tweaking in Excel for an hour. Then, when you finally do import a batch list, there are no bins, just raw shots.
    Why god, why? Sorry to rant but this sort of user-unfriendly stuff is infuriating when you're dealing with clients and are on tight deadlines. Any advice?

    Question answered here:
    http://discussions.apple.com/thread.jspa?messageID=1077655&#1077655
    Dual 2.5 G5   Mac OS X (10.4.3)   4 GB RAM, DeckLink HD Pro, XRAID

  • Off Topic, Help with Batch Auto Cropping

    I have 2000+ scanned slides (Nikon 4000 film scanner) in Tiff format, and there is a black band around each scanned slide (which is normal for slides - the scanned area is slightly larger than the picture area) that I want to get rid of. I am NOT going to crop them one at a time!! Does anyone know of a program that will do this automatically in batch mode? I once saw a program that would "auto Crop" photos but I can't remember the name. The slides are 30 years old ( hence the digitizing ) and I don't care too much about the accuracy, ie if it crops a little too much.
    Thanks
    -Robert

    wish i could reward 100 points
    me too ...
    and another thing, once you do the l&S crop, if you want to move the location slightly, hit 'C' to bring up the crop HUD and the image goes back to full size again, but with the crop rectangle the same size as before and you can move it around if need be ...
    this was an important thing that was introduced in 1.5.x along with l&s of straightening ...

  • Need help with batch file for javac.exe and java.exe

    I have this in my batch file:
    c:\jdk1.3.1_05\bin\javac
    What symbol do I need to be able to run this from cprompt with any file following it

    Thanks could remember that for nothing

  • Help with Batch Editing Loop CD's in Logic

    Helo there. I've been given the task of organizing and editing someone's loop library. I've filtered through and narrowed down the CD's I'd like to cut up and export as individual files. I already have a naming convention that works for us, however, I'm wondering if there's a streamlined process for doing this.
    My current plan is to import each CD's tracks (anywhere 20-45) into a single Logic Project folder. As of now, I have to go through and manually splice each track (even though there is distinct silence between the parts I want to export individually). Copy each part to a new track then export them all when I'm finished.
    I guess what I'm looking for is any advice to speed this process up (other than coffee!) Has anyone had to do anything like this before? Is there a quicker way of cutting up these tracks than doing it manually?
    Any help would be appreciated

    *Strip silence* the audio into regions:
    Then *'save regions as'* from the audio bin.

  • Batch Rename HELP!

    So I have used Bacth Rename a hundred times! But this morning, I went to rename an entire set of photos (about 70 of them). Somehow, instead of just renaming the photos, it altered the file type- so I guess they aren't jpegs anymore! I can't open them in any program! Any suggestions on how to fix this?

    it altered the file type- so I guess they aren't jpegs anymore! I can't open them in any program! Any suggestions on how to fix this?
    If you have set to rename also the file type or extension they still are jpeg only the system will not recognize them as such. If you are sure they were jpeg files you only have to rename them again with batch rename.
    First check if there is no current extension or dot in the filename. If so choose the options in new filenames 'current filename' / 'name' / original case and second 'new extension' and in the field fill in: .jpg
    Then check if all is correct ant apply the new names. This should make it again OK.

Maybe you are looking for

  • FAQ: What is the Photoshop CS6 13.0.2 update? What is the 13.1 update?

    What updates have been released?   Photoshop CS6 has two new updates: 13.0.2 and 13.1. The 13.0.2 update is available only for Mac users and updates the user interface to be Retina compatible. The 13.1 is for Creative Cloud subscribers and adds new f

  • Suppressing Field In Receiver File Adapter

    Hi I have a Data type with fields 1. name 2. No 3. city. I am using File adapter @ receiver end to create a flat file using this data type. But the requirement is to have only 2 fields in the Output file( say name , no). How to suppress the city fiel

  • What files need to be backed up before I change my hard drive?

    I want to upgrade my hard drive from 120gb to 250gb. I want to start with a fresh OS. Is there a file I can copy to let Itunes know this is the same computer so I dont have to start from scratch with all my devices? I had a virus in the past aand wou

  • VMware Tools Service not Working on Secondary Virtual Server

    Hi All, I have Primary Server as Physical and Secondary Server is VM , On Secondary server VMware Tools are Installed but not running I tried to Start the service and I got following error. The VMware Tools service terminated with the following error

  • Can't connect iPod Touch to Airport Extreme using "Add Wireless Clients"

    I am unable to connect my iPod Touch to the local wireless network (Airport Utility v5.4.2) using "Add Wireless Clients..." in the Base Station menu. My Powerbook G4 connects OK (with the PIN - as requested) I can find no information in Apple's manua