Renaming Files In 2-Number-Steps ... how to? (w. or w/o Automator)

Dear all,
I have Mac OS X Yosemite 10.10 and a question: I have a 2-pages-per-sheet-PDF-document. I exported the file as single .jpgs in my Adobe Acrobat 11 program. Now I have 10 sheets (20 pages) as jpg. I want to batch crop them with Photo Batch for Mac which is not my problem. I now have 10 left pages (1-3-5-7-9-...) and 10 right pages (2-4-6-8-...).
I made the left - hand - pages first, they are now 001.jpg, 002.jpg, 003.jpg etc.
I thence made the right - hand - pages, they are now 011.jpg, 012.jpg, 013.jpg, etc.
Now I could rearrange everything in one single PDF with 20 pages / 20 sheets, but then I had to manually sort everything in the right way. I need help for the following:
How can I batch rename a heap of files to odd numbers in ascending order?
How can I batch rename a heap of files to even numbers in ascending order?
Then I could just hit the merge button in Acrobat and did not have to sort everything in Adobe :-)
Thanks for help!
Yours truly Holger Rogoll

Hi,
Use this AppleScript to rename JPEG's files:
set tFolder to choose folder with prompt "Select the folder which contains JPEG's file"
tell application "Finder"
    set jpegs to document files of tFolder whose name extension is "jpg"
    set tc to (count jpegs) div 2
    set tmpF to make new folder at tFolder
    set rJpegs to move items (tc + 1) thru -1 of jpegs to tmpF -- move  right - hand - pages to new folder ( to avoid name conflict when renaming)
    set j to (tc * 2) - 1
    repeat with i from tc to 2 by -1 -- rename left, skip the first item because the name of the first JPEG is OK
        set name of item i of jpegs to (text -3 thru -1 of ("00" & j)) & ".jpg"
        set j to j - 2
    end repeat
    set j to 2
    repeat with i from 1 to (tc - 1) -- rename right, skip the last item because the name of the last JPEG is OK
        set name of item i of rJpegs to (text -3 thru -1 of ("00" & j)) & ".jpg"
        set j to j + 2
    end repeat
    move document files of tmpF to tFolder -- move  right - hand - pages to the original folder
    delete tmpF -- delete the created folder
end tell

Similar Messages

  • OSX renaming files names with number/letter suffixes

    I have some Quark files that are constantly being updated. Sometimes when I close and save the file, it renames it something like filename_f#CB70C.qxd (original name: filenameversionmonth, etc.), replacing my name with this gibberish! I have tried shortening the filenames and it still does this, but it's intermittent. I am working off of a server in an office, where a few people share the same files. I will rename it again and when I look in the window, it has snapped back to the gibberish name.
    Any ideas?
    Dual 1.8 GHz PowerPC G5   Mac OS X (10.3.9)   2 GB RAM

    jewelee:
    Welcome to Apple Discussions.
    I doubt whether OS X is doing this. Since it apparently happens with only one applicatication it may be a requirement of the application. (I don't know that; just a guess). I suggest that you try Repairing Disk Permissions, and see if it is a permissions issue.
    Good luck.
    cornelius
    PismoG4 550, 100GB 5400 Toshiba internal, 1 GB RAM; Pismo 500 OS (10.4.4) Mac OS X (10.3.9) Beige G3 OS 8.6

  • How to open renamed files?

    Hi
    I rename selected files and after that want to open them.
    For my purpose renaming works well like this:
    tell application "Finder"
    set FilesToRENAME to selection
    display dialog "Change what?" default answer ""
    set ChangeFROM to text returned of the result
    display dialog "Change to?" default answer ""
    set ChangeTO to text returned of the result
    set AppleScript's text item delimiters to {ChangeFROM}
    set theCount to count of FilesToRENAME
    repeat with x from 1 to theCount
    try
    set theName to name of item x of FilesToRENAME
    set FirstNamePart to first text item of theName
    set LastNamePart to second text item of theName
    set newName to FirstNamePart & ChangeTO & LastNamePart
    set name of item x of FilesToRENAME to newName
    on error errStr number theNumber
    activate
    display dialog "Error in changing the Name " & theNumber & return & errStr ¬
    & return & "Step " & x
    end try
    end repeat
    set AppleScript's text item delimiters to ""
    end tell
    Now newly renamed files don't belong anymore to FilesToRENAME. So how to point to those files now (how to make a new list from those renamed files)? I was thinking to get a path to each file inside the repeat loop and replace the name, but couldn't do it.
    Thank you for any help.
    Vera

    Pierre's method is pretty clever, but if you don't happen to be using a Finder selection (choose file for example), you can also use the interesting fact that an alias keeps track of an item even if it is moved or renamed.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- tell application "Finder" to set filesToRename to selection as alias list
    set filesToRename to (choose file with multiple selections allowed)
    set changeFrom to text returned of (display dialog "Change what?" default answer "")
    set changeTo to text returned of (display dialog "Change to?" default answer "")
    set renamedFiles to {} -- this will be the renamed files
    repeat with aFile in filesToRename
    set aFile to the contents of aFile
    tell application "Finder" to set theName to name of aFile
    try
    set tempTID to AppleScript's text item delimiters
    set AppleScript's text item delimiters to {changeFrom}
    set firstNamePart to first text item of theName
    set lastNamePart to second text item of theName
    set AppleScript's text item delimiters to tempTID
    set newName to firstNamePart & changeTo & lastNamePart
    tell application "Finder"
    set name of aFile to newName -- aFile points to the original file
    update aFile -- give Finder a chance to catch up
    set the end of renamedFiles to aFile -- aFile now points to the renamed file
    end tell
    on error errStr number theNumber
    activate me
    display alert "Error " & theNumber & " in changing the Name" message errStr
    end try
    end repeat
    renamedFiles --> aliases to the renamed files
    </pre>

  • In lr4 where/how to rename files if loaded from folder already on hard drive?

    Files imported from a card reader can be renamed upon import but where/how to rename files added from a folder already on the hard drive? Also, how to rename files so as to not have gaps in the number sequence once the "rejects" have been deleted? Thanks.

    Yes and yes.  And, using it with the new shoot name renamed the files perfectly! 
    There is even a "original number suffix" so if you don't like IMG_4501 and prefer DSC_4501 you can pull the 4501 (the suffix) and replace the first three characters.
    So, in one operation SFO-shoot-(IMG_4501).NEF could become Wine-country-shoot-(IMG_4501).NEF or even Wine-country-shoot-(4501).NEF if you prefer.  Powerful.
    Thank you Rikk and Adobe! Chris R

  • How can I automatically rename files based on an excel doc?

    I am a scientist and recieve data files from some of my experiments with arbitrary, computer-generated names. For example, if I perform an experiment with four samples, which I name Sample1, Sample2, Sample3, and Sample4, I get back 4 data files named J30935D05.ab1, J30935E05.ab1, J30935F05.ab1 and J30935G05.ab1 along with an Excel doc that lists my names for the samples (sample1, sample 2, etc.) in one column and the computer-generated names for their corresponding files (J30935D05.ab1, J30935E05.ab1, etc.) next to them in another. Therefore, I must open the Excel file and look up which file corresponds to which sample before I can begin processsing my data. Usually these experiments involve a large enough number of samples (70-100 or so) such that looking everything up in the Excel doc gets very tedious and is quite time-consuming. Is there any way to create an automator workflow, applescript, or some other solution to rename these files based on the Excel doc? To clarify, I would like an automator workflow that would take a folder of arbitrarily named files, look up the names I have for the samples in the Excel doc, and rename the files accordingly. In the example, my folder containing files J30935D05.ab1, J30935E05.ab1, J30935F05.ab1 and J30935G05.ab1 would be turned into a folder containing the files renamed as Sample1.ab1, Sample2.ab1, Sample3.ab1, and Sample4.ab1. This example is a bit simplified, however, and trying a simple trick of just systematically renaming files within the folder would not work--both the original and the new file names must be looked up in the Excel doc, as these change dramatically from experiment to experiment. I would also need to maintain the file extension on each file after being renamed. Any help would be greatly appreciated!!

    Try the freeware utility Renamer4Mac (VersionTracker or MacUpdate).
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • How to rename files by folder name in applescript

    Hi,
    I need to be able to rename files within a folder to the folder name. I have a work flow and script that allows me to find the files within a folder, enter a new file name and starting sequence number in tow seperate dialogue boxes. What I want to be able to achieve is to rename the files without manually entering the name... I still want to be able to manually enter the number.

    Use code such as:
    tell application "Finder"
    set the_folder to (choose folder)
    repeat with this_file from 1 to (count (get files of the_folder))
    set name of file this_file of the_folder to (name of the_folder) & " " & this_file
    end repeat
    end tell
    replacing the last this_file on the fourth line with the variable which contains the number.
    (104354)

  • How can i pass the name of the file polled by the file adapter to next step

    Hi XI guru's ,
    How can i pass the name of the file polled by the file adapter to next step in a BPM..?
    regards,

    Use Adapter-Specific Message Attributes and map that value in udf to the BPM message.
    Also see this
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    Regards,
    Prateek

  • How can I get iTUNES library to display renamed files and folders (renamed with Windows Explorer)?

    How can I get iTunes library to display the new names and organisation of tracks and albums (ie files and folders) that I have renamed and reorganised (using Windows Explorer) having previously imported them using iTunes?
    (Even when I relocate "lost" tracks in iTunes (using the drop down menu facility to view in Windows explorer), although iTunes will then play the track, and knows where to find it, it refuses to display the track with its correct (new) name, or show it the correct (new) album.  That means I have lots of things called "Untitled" and "Track 01" etc, all of which have actually been renamed, but iTunes does not seem to have the capability to recognise the changes and update its library listing.  Another example - a Tchaikovsky CD with 3 major works in 13 tracks insists on displaying in iTunes as 13 tracks in one album, despite the fact that I have reorganised the tracks into 3 albums - two being Swan Lake and The Nutcracker - and renamed the individual tracks to a more useable format.)

    Thanks for your replies ckuan
    I agree with Tgod that your first solution does not work.  It appears unpredictable whether the old or new file names are listed when you drag the folders into iTunes from Windows Explorer.  The folder structure is completely missing.  I reckon if you have to muck around spending days/weeks/months finding out how to fix links to a secret meta-file (obviously designed by some deep-cover microsoft worm working in the Apple!), then it's pretty obvious that almost any alternate way of doing this would be better.   Bye bye iTunes!!
    Incidentally, I tried several other things that (if the software was designed intuitively) should work, but give disastrous results:
    1) when deleting the library listing in iTunes, it gives you two options - one is to remove the listings to the Recycler.  Be aware that IF you select that option, it removes not only your library listing, but also your ACTUAL MUSIC FILES to the Recycler.  Moreover, it does NOT remove the insidious secret meta-file that is what apparently keeps rewriting old names over your carefully renamed file names, and keeps totally ignoring your carefully designed folder (album) structure.  OK - not a complete disaster, as I realised and went hunting through the chaos in the Recycler to recover all my files.  No thanks to the genius who designed this brilliant feature!
    2) after deleting the library listing in iTunes, I attempted to import just the folders that I wanted.  iTunes refused to allow me to do that, and proceeded to try to import every frigging music file it could find on my whole hard drive, in apparently random fashion into the library.  Whoever thought up that doozy either never ever tried to use or market test it, or has modified their mind rather too many times with artificial substances so their brain is like muesli chop suey.
    3) oh why go on, it's too depressing ...

  • How to edit move rename files in iTunes

    how to edit move rename files in itunes

    I don't like iTunes.
    I don't want iTunes to keep the physical location of my files because they can be on a SD card, or an USB drive and i don't want iTunes to stop me from playing a song because it cannot find it anymore.
    So i would like to use physical files just to upload to iTunes Match and then delete the link to the physical file.
    If needed, iTunes Match will download the file.
    The problem is just that i would like to delete all references to physical files to make iTunes Match download the file only when needed and stop using the first version i had given to it
    maybe i could have a Apple Script to check if there is a physical file referenced and if so delete it to have only the Cloud version     

  • How to rename files that appear in multiple .book files?

    I have about 50 .fm files, and 4 .book files, each of which includes about 20 of the .fm files.
    I want to rename some of the files.
    If I open all four .book files at once, and I go to First.book and rename file Q, I want it to be renamed in all the other .book files in which it happens to be included.
    How can I do that?
    Thanks.

    You have to rename the file in each book that it is included in. After the first re-name, the other books will treat the old filename as a missing one.

  • I can't open adobe captivate 8. I get a message that say the file archive part of adobe captivate 8 is missing. Please download all parts. I have the serial number. How do I download all parts?

    I can't open adobe captivate 8. I get a message that say the file archive part of adobe captivate 8 is missing. Please download all parts. I have the serial number. How do I download all parts?

    Hi There,
    It seems that you have only downloaded .exe file. You need to download two file .exe and .7z and put it in a same folder and then try to run .exe
    Regards,
    Mayank

  • HT1473 How do you rename files on a playlist within iTunes? Trying to rename some files from audio CD.  Thanks

    How do you rename files on a playlist in iTunes? Don't see a rename function and want to rename files coming in from audio CD as "track one."  Thanks

    Right-click the track, choose Get Info, and go to the Info tab.  Overtype the Name (and/or any other information that you want to change) with the new information.  Click OK when you are done.

  • Step by Step"How JSP read text file :

    Hi ,
    Any one know or have a good site to show step by step how JSP read text file.
    TQ.

    There is no difference Between reading a text file from JSP and reading a text file from Java.
    Just follow the same steps for JSP also.

  • Downloaded trial version but install asks for serial number.  How do I get around this step?

    Downloaded trial version but install asks for serial number.  How do I get around this step?

    The serial number is on the page that the download link was on: 1139-1001-3886-4854-1284-1828

  • How can I rename files without creating a duplicate?

    How can I rename files without creating a duplicate?  And secondly, for some reason I can no longer save pdf files [i.e., bank statements] where I want - the Save As function is gone?

    In many new cases, Save As is now called Duplicate in ML. It uses the same command-S keystroke. Older apps still have Save As. When you do a Duplicate operation, you will create an UNTITLED document. You have to save that duplicated document to complete the process.
    So in 10.6.x, you would do ...
    * Save As ...
    * Give the file a new name + Chose the location for the file
    * Click the Save button
    Now in 10.8.x, you do ...
    * Duplicate ...
    * Save ...
    * Give the file a name + Chose the location for the file
    * Click the Save button
    As baltwo mentioned, you have to search the Preferences of your browser to determine what is has set for the default Download folder.
    JJW

Maybe you are looking for

  • How can I set up Skype on my iPad to delete chats?

    I am therapist and the chats on Skype are confidential. On my mac, I have set it up to delete all chats when I shut down Skype but on my iPad I can't manage this. How can I delete chats and chat history on the iPad.

  • Error at the time of PO creation - Asset is investment measure, transaction

    Hi all, When am assigning the Investment Order (order for AUC) against Asset at the time of creation of Asset PO, the system throws the following error: Asset is investment measure, transaction type not allowed Message no. AK005 Diagnosis Asset 17000

  • Cache problem for included stylesheets on remote server

    Hi. We are building an XSL page that includes changing named templates through xsl:includes where the included stylesheet is on a remote server. The content of the remote stylesheet can change at any time. The problem is that the Oracle XSLT caching

  • Add a screen in CJ01 Tcode

    Hai to all,                 I am fresher as abap consultant. Right now i am practicing on enhancement. I came across an example where there is a requirement to add a screen in CJ01 Tcode. there i came across a enhancement name "CNEX0006" i open the e

  • Ringtones lost when syncing with computer

    Hi, I have an iPhone 3GS, and purchased a ringtone through iTunes on the phone so I could have a Christmas ringtone. When I synched the phone with iTunes on the computer, the ringtone transferred, but it was deleted from the phone. Now it's on my com