Rename all files in a folder?

At the end of everyday on a recent month-long trip, I dumped photos from a card into a folder on my desktop, and cleared the card for the next day's use. Now that I'm back home, I have photos in several folders with the same name (i.e. in folder Monday, file DSC_001 and in Tuesday, file DSC_001).
How can I go in and rename/renumber the files so that if I ever drop them into a common folder, one won't overwrite another?
I have several thousand photos, so renaming each file one by one will take a lot of time.
Thanks for your help!

You've got a built-in file re-namer (if you want to add something before or after the existing name) in a sample Applescript. You don't have to know how to do scripting to use it.
First, turn on the script menu:
1. Double-click the AppleScript Utility program in /Applications/AppleScript to open it.
2. Check both +Show Script Menu In Menu Bar+ and +Show Computer Scripts+.
The little black AppleScript icon appears near the right of your menu bar, listing all the built-in scripts.
3. Close/Quit the utility.
Then, use the Add to File Name script on items in your folder:
1. In the Finder, select the files you want renamed - probably a Select All inside one of the folders you mentioned.
2. From the Script menu, choose Finder Scripts > Add to File Names.
3. In the dialog, type what you want appended to the font name and click the Prefix or Suffix button.
To reverse this at any time, use the Script > Finder Scripts > Trim File Names command.
s.

Similar Messages

  • Is there a way to rename all photos in a folder?

    Is there a fast way to rename all the photos in one folder e.g. I have diffreent folders say "wedding" and "birthday" with alot of photos in each. Is there a way to rename all photos in the folder to the same name like all called wedding?
    Also when i open photos they automatically open with preview, do I need to impost them into iPhoto or should they just automatically save there?
    Tracy

    Tracy
    Are these photos in iPhoto? If so, then use the Photos -> Batch Change command.
    IF not then you can use a batch file renamer such as Name Mangler
    iPhoto is a database and can only show pics that have been imported to the DB.
    Regards
    TD

  • Easy way to rename all files and folders in a specific directory

    hy all,
    i want to rename all files&folders in a specified folder... i only want to replace all "_'_" with an"-" in all file names...
    example:
    TCHK1_B4194W01PF7_NMOSi_D_B__3_50ohm-500ohm_03-29-07_10'46'23_AM.tst
    TCHK1_B4194W01PF7_NMOSi_D_B__3_50ohm-500ohm_03-29-07_10-46-23_AM.tst
    i cant change the timeformat because this are automatically generated files from an external program...
    this is my program(attached as JPG) but it doesnt work...i get allways "error 10-duplicate path" or "error1 -   An input parameter is invalid"
    could sombody please help me... i think its an easy VI but i cant get it working
    THANKS in advance!!!!
    greets
    Andreas
    Attachments:
    renamefolder.JPG ‏20 KB

    Well, the one problem you have is that for the "Move" function, the source file input should be wired to the output of the "Build Path" function, not to the duplicate path out of the "List" function. Also, you need to pass the error cluster around with a shift register. Otherwise you will not catch an error that may have occurred during one of the file rename operations.

  • [Solved] Foreach loop that loops over all files in a folder does not consider first file found

    Hello,
    I have a foreach loop in SSIS (as part of Visual Studio 10 and with SQL Server 2012).
    It loops over all files in a folder (ForEach File Enumerator).
    I set the folder: OK
    Traverse Sub folders: OK
    I have set up a Variable in Variable Mappings called FileName so it shows User::FileName: OK
    Index of variable is 0: OK
    It almost works ok. Except that the first file it finds is never considered.
    I set a breakpoint then and the first file it finds, is shown in black in the watch variable window. All subsequent files found are shown in red font. When I change the names of the files so another file is the first file found then it skips the other one
    which now is the first file.
    What is going on here? Why does SSIS skip the first file it finds in a foreach file loop?
    Any suggestions highly appreciated.
    Thank you
    Andi
    Andreas

    "red font - interesting, any example to show us (image)
    It would be interesting to share with us whether you use any file masks or expressions.
    Arthur
    MyBlog
    Twitter
    It appears a variable value turns red when it changes between breakpoints. It started black for the first value (the first file, obtained BEFORE the execution reached the breakpoint), and then turned red. I was able to reproduce this behavior on a test environment.
    However, it did not skip any files.
    OP, please set up the test shown in the image below. Create a breakpoint in the sequence container for the "OnPreExecute" event.

  • How to Read all files inside resource Folder inside Jar?

    I have a Jar file,,,, The program reads for resource files in the resource folder inside the Jar. I want my program to read all files inside this folder without knowing the names or the number of files in the folder.
    I am using this to make an Applet easy to be updated with spicific files. I just want to add a file inside the resource folder and Jar the program and automatically the program reads what ever is in there!!
    I used the File class to get all file names inside the resource folder. it works fine before Jarring the program. After I jar I recieve a URI not Herarichy Exception!!
    File fold=new java.io.File(getClass().getResource(folder).toURI());
    String[] files=fold.list();
    I hope the question is clear!!

    How to get the directory and jar file that you class resides in:
    // returns path and jarfile (ex: /home/mydir/my.jar)
    public String getJarfileName()
            // Get the location of the jar file and the jar file name
            java.net.URL outputURL = YourClass.class.getProtectionDomain().getCodeSource().getLocation();
            String outputString = outputURL.toString();
            String[] parseString;
            int index1 = outputString.indexOf(":");
            int index2 = outputString.lastIndexOf(":");
            if (index1!=index2) // Windows/DOS uses C: naming convention
               parseString = outputString.split("file:/");
            else
               parseString = outputString.split("file:");
            String jarFilename = parseString[1];
           return jarFilename;
    }If your my.jar was in /home/mydir, it will store "/home/mydir/my.jar" in jarFilename.
    note: getLocation returns "file:/C:/home/mydir/my.jar" for Windows/DOS and "file:/home/mydir/my.jar" for windows, thus why I look for the first and last index of the colon so I can correctly split the string.
    If you want to grab a file in the jar file and get an InputStream, do the following:
    import java.io.*;
    import java.util.Enumeration;
    // jar stuff
    import java.util.jar.*;
    import java.util.zip.ZipEntry;
    public class Jaris
       private JarFile jf;
       public Jaris(String jarFilename) throws Exception
           try
                           jf = new JarFile(jarFilename);
           catch (Exception e)
                jf=null;
                throw(e);
       public InputStream getInputStream(String matchString) throws Exception
           ZipEntry ze=null;
           try
              Enumeration resources = jf.entries();
              while ( resources.hasMoreElements() )
                 JarEntry je = (JarEntry) resources.nextElement();
                 // find a file that matches this string from anywhere in my jar file
                 if ( je.getName().matches(".*\\"+matchString) )
                    String filename=je.getName();
                    ze=jf.getEntry(filename);
          catch (Exception e)
             throw(e);
          InputStream is = jf.getInputStream(ze);
          return is;
       // for testing the Jaris methods
       public static void main(String[] args)
          try
               String jarFilename=getJarfileName();
               Jaris jis = new Jaris(jarFilename); // this is the string we got from the other method listed above
               InputStream is=jis.getInputStream("myfile.txt"); // can be used for xml, xsl, etc
          catch (Exception e)
             // this is just a test, so we'll ignore the exception
    }Happy coding! :)
    Doc

  • 10.6.4:  how to unlock all files in a folder

    hi,
    how do you unlock all files inside a folder?
    thank you..

    thank you.. (I wonder why you can't just do it by getting info on the folder, then saying, unlock all files inside.. (u can do like that in windows) this is always more practical than having to select all files (and accidentally opening them, or something...-) in windows you can select a folder and then say, (un)lock all files and and dirs -- and subdirs and files inside -- inside this folder.. can u do something like this in mac os? if not, that's not very good.. (I guess on the mac would need to find unix commands for doing something like this..)
    they really need to consider this for future versions, this is a no-brainer...;-)
    thank you..

  • Add all files of one folder to aperture by running a script

    HI,
    i have a question:
    I will make my Aperture Tethered more easy (with my Canon eos 30D) i have coded a script / folder action to do this but: this folder action does not import all pictures (wy ever, i think that the files coming in to fast were not recognized).
    Now i will code a script which will include all files of a folder to aperture when it is run.
    i will give it a try, and the import does function, but, i don't know how i can tell the script which files it should import (with a folder action its easy, with this line:
    on adding folder items to this_folder after receiving these_items
    but how to do this without the "on adding folder items" cause that does not happen in the case i will use it.
    i'm looking forward to anthers:D
    Best Regards
    Christoph

    yes i tryed this application, and there was the same problem as with my one (i have programmed my based on this application)
    but both had the same problem they open on imageadd, but if i take more images in seconds (i think the script is still running => it can't recognize new images) it does not recognize the newly taken images.
    and i hope some script that imports all images in the folder will solve the problem.
    the more ore less only problem is to tell the application which images to import (like: on run import ALL files)

  • Read all Files from a Folder on Server

    Hi,
    Can anyone help me in finding if there's any way to read all files in a folder on the server?Any Function module or anything.
    Thanks

    On App server?  Try this sample program.
    report zrich_0001 .
    data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    data: wa(1000) type c.
    data: p_file type localfile.
    data: ifile type table of  salfldir with header line.
    parameters: p_path type salfile-longname
                        default '/usr/sap/TST/DVEBMGS01/data/'.
    call function 'RZL_READ_DIR_LOCAL'
         exporting
              name           = p_path
         tables
              file_tbl       = ifile
         exceptions
              argument_error = 1
              not_found      = 2
              others         = 3.
    loop at ifile.
      format hotspot on.
      write:/ ifile-name.
      hide ifile-name.
      format hotspot off.
    endloop.
    at line-selection.
      concatenate p_path ifile-name into p_file.
      clear itab.  refresh itab.
      open dataset p_file for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset p_file into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset p_file.
      loop at itab.
        write:/ itab.
      endloop.
    Regards,
    Rich Heilman

  • I need applescript to change all files in a folder and its subfolders ending in .xlsx changed to .xlsb

    I need applescript to change all files in a folder and its subfolders ending in .xlsx changed to .xlsb

    try something like this:
    with timeout of 3600 seconds
      -- long timeout to because the Finder is horribly slow
              tell application "Finder"
      -- collects the files from a folder called "whatever" in your user home folder
                        set xlsbFiles to every file of entire contents of folder "Whatever" of home whose name extension is "xlsb"
                        repeat with thisFile in xlsbFiles
                                  set name extension of thisFile to "xlsx"
                        end repeat
              end tell
    end timeout
    you could make a more efficient script using System Events.app, but this will get the job done with a minimum of thought.

  • Lightroom Export renames ALL files sequentially

    This problem seemed to start after the last update. After editing a photo and exporting to the LR folder in the main file folder, it renames all pics in the main folder to the new edit name and adds a sequential number. For example: This morning I imported 134 raw images. I edited 1 photo, renamed it "Snookie Tube" and exported it to the main file 7-18-14 "LR Folder". I opened the folder and I  saw Snookie Tube.jpg. Then another pic apeared as Snookie Tube.1.jpg, another Snookie Tube.2.jpg, etc. I've tried changing the export settings and can't get it to stop.

    msirach wrote:
    I am editing each picture and exporting each with a unique file name individually.
    Your workflow isn't clear. First off, if you name them uniquely, that's what you should get but if you don't, even if you export one at a time, LR will not allow you to use the same name, it will automatically append the name as not to over-write other files. That's why you'd see Snookie Tube.1.jpg, Snookie Tube.2.jpg.
    Show us a screen capture of the Export module file naming area.

  • Script to search all files in specified folder for multiple string text values listed in a source file and output each match to one single results txt file

    I have been searching high and low for this one.  I have a vbscript that can successfully perform the function if one file is listed.  It does a Wscript.echo on the results and if I run this via command using cscript, I can output to a text file
    that way.  However, I cannot seem to get it to work properly if I want it to search ALL the files in the folder.  At one point, I was able to have it create the output file and appear as if it worked, but it never showed any results when the script
    was executed and folder was scanned.  So I am going back to the drawing board and starting from the beginning.
    I also have a txt file that contains the list of string text entries I would like it to search for.  Just for testing, I placed 4 lines of sample text and one single matching text in various target files and nothing comes back.  The current script
    I use for each file has been executed with a few hundred string text lines I want it to search against to well over one thousand.  It might take awhile, but it works every time. The purpose is to let this run against various log files in a folder and
    let it search.  There is no deleting, moving, changing of either the target folder/files to run against, nor of the file that contains the strings to search for.  It is a search (read) only function, going thru the entire contents of the folder and
    when done, performs the loop function and onto the next file to repeat the process until all files are searched.  When completed, instead of running a cscript to execute the script and outputting the results to text, I am trying to create that as part
    of the overall script.  Saving yet another step for me to do.
    My current script is set to append to the same results file and will echo [name of file I am searching]:  No errors found.  Otherwise, the
    output shows the filename and the string text that matched.  Because the results append to it, I can only run the script against each file separately or create individual output names.  I would rather not do that if I could include it all in one.
     This would also free me from babysitting it and running each file script separately upon the other's completion.  I can continue with my job and come back later and view the completed report all in one.  So
    if I could perform this on an entire folder, then I would want the entries to include the filename, the line number that the match occurred on in that file and the string text that was matched (each occurrence).  I don't want the entire line to be listed
    where the error was, just the match itself.
    Example:  (In the event this doesn't display correctly below, each match, it's corresponding filename and line number all go together on the same line.  It somehow posted the example jumbled when I listed it) 
    File1.txt Line 54 
    Job terminated unexpectedly
     File1.txt Line 58 Process not completed
    File1.txt
    Line 101 User input not provided
    File1.txt
    Line 105  Process not completed
    File2.txt
    No errors found
    File3.txt
    Line 35 No tape media found
    File3.txt
    Line 156 Bad surface media
    File3.txt Line 188
    Process terminated
    Those are just random fake examples for this post.
    This allows me to perform analysis on a set of files for various projects I am doing.  Later on, when the entire search is completed, I can go back to the results file and look and see what files had items I wish to follow up on.  Therefore, the
    line number that each match was found on will allow me to see the big picture of what was going on when the entry was logged.
    I actually import the results file into a spreadsheet, where further information is stored regarding each individual text string I am using.  Very useful.
    If you know how I can successfully achieve this in one script, please share.  I have seen plenty of posts out there where people have requested all different aspects of it, but I have yet to see it all put together in one and work successfully.
    Thanks for helping.

    I'm sorry.  I was so consumed in locating the issue that I completely overlooked posting what exactly I was needing  help with.   I did have one created, but I came across one that seemed more organized than what I originally created.  Later
    on I would learn that I had an error in log location on my original script and therefore thought it wasn't working properly.  Now that I am thinking that I am pretty close to achieving what I want with this one, I am just going to stick with it.
    However, I could still use help on it.  I am not sure what I did not set correctly or perhaps overlooking as a typing error that my very last line of this throws an "Expected Statement" error.  If I end with End, then it still gives same
    results.
    So to give credit where I located this:
    http://vbscriptwmi.uw.hu/ch12lev1sec7.html
    I then adjusted it for what I was doing.
    What this does does is it searches thru log files in a directory you specify when prompted.  It looks for words that are contained in another file; objFile2, and outputs the results of all matching words in each of those log files to another file:  errors.log
    Once all files are scanned to the end, the objects are closed and then a message is echoed letting you know (whether there errors found or not), so you know the script has been completed.
    What I had hoped to achieve was an output to the errors.log (when matches were found) the file name, the line number that match was located on in that file and what was the actual string text (not the whole line) that matched.  That way, I can go directly
    to each instance for particular events if further analysis is needed later on.
    So I could use help on what statement should I be closing this with.  What event, events or error did I overlook that I keep getting prompted for that.  Any help would be appreciated.
    Option Explicit
    'Prompt user for the log file they want to search
    Dim varLogPath
    varLogPath = InputBox("Enter the complete path of the logs folder.")
    'Create filesystem object
    Dim oFSO
    Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
    'Creates the output file that will contain errors found during search
    Dim oTSOut
    Set oTSOut = oFSO.CreateTextFile("c:\Scripts\errors.log")
    'Loop through each file in the folder
    Dim oFile, varFoundNone
    VarFoundNone = True
    For Each oFile In oFSO.GetFolder(varLogPath).Files
        'Verifies files scanned are log files
        If LCase(Right(oFile.Name,3)) = "log" Then
            'Open the log file
            Dim oTS
            oTS = oFSO.OpenTextFile(oFile.Path)
            'Sets the file log that contains error list to look for
            Dim oFile2
            Set oFile2 = oFSO.OpenTextFile("c:\Scripts\livescan\lserrors.txt", ForReading)
            'Begin reading each line of the textstream
            Dim varLine
            Do Until oTS.AtEndOfStream
                varLine = oTS.ReadLine
                Set objRegEx = CreateObject("VBScript.RegExp")
                objRegEx.Global = True  
                Dim colMatches, strName, strText
                Do Until oErrors.AtEndOfStream
                    strName = oFile2.ReadLine
                    objRegEx.Pattern = ".{0,}" & strName & ".{0,}\n"
                    Set colMatches = objRegEx.Execute(varLine)  
                    If colMatches.Count > 0 Then
                        For Each strMatch in colMatches 
                            strText = strText & strMatch.Value
                            WScript.Echo "Errors found."
                            oTSOut.WriteLine oFile.Name, varLine.Line, varLine
                            VarFoundNone = False
                        Next
                    End If
                Loop
                oTS.Close
                oFile2.Close
                oTSOut.Close
                Exit Do
                If VarFoundNone = True Then
                    WScript.Echo "No errors found."
                Else
                    WScript.Echo "Errors found.  Check logfile for more info."
                End If
        End if

  • Finder shows some but not all files in a folder

    In some circumstances, Finder only shows some (but not all) of the files in a folder. Why?
    I notice this with Excel autosave files in the Office 2011 Autorecovery folder (Macintosh HD ▸ Users ▸ Conor ▸ Library ▸ Application Support ▸ Microsoft ▸ Office ▸ Office 2011 AutoRecovery). In my case, Finder shows 34 files but "ls" in a Terminal window reports 40 files. The missing files do not start with a period (.) and have the same permissions as other files that show in Finder (-rw-r--r--@ 1 <myname>  staff). Here's the last four lines of "ls -al" - the first two appear in Finder, but not the last two:
    -rw-r--r--@  1 myname  staff    55296  8 Oct  2013 Word Work File D_1239425731.tmp
    -rw-r--r--@  1 myname  staff    55296  8 Oct  2013 Word Work File D_1240072173.tmp
    -rw-r--r--@  1 myname  staff    52796 13 Feb 11:08 safe1.xlk
    -rw-r--r--@  1 myname  staff    95320 12 Mar 16:06 safe2.xlk
    I have tried copying files from this folder to another folder, and/or changing their names. They still do not appear in Finder, nor are they visible in the File Open dialog of applications, even when the dialog is listing other files in that directory - but if I manually type the name into the File Open dialog, the app manages to find and open the file.
    If I Spotlight-search for the file name, or search in Finder, without specifying that specific directory ("This Mac"), the file is not found, but if I direct the Finder search at that particular directory, then the search returns the relevant files.
    So: why does Finder hide certain files when showing a folder, even though it can find and show those files if you specifically ask for them?
    Now using OSX 10.10 (Yosemite), but I'm pretty sure I noticed this on OSX 10.8 as well.

    So simple - thanks. I'd not been aware of the hidden flag, and now I've found the -O option on ls to display it.
    Follow-on question: I now see that you can change the system-wide defaults to display hidden files with this...
         defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
    ...but is there a way to specify this on a per folder basis? I'm happy enough to hide hidden files in general, but it would be nice if I could set an attribute/flag/whatever on the Office AutoRecovery directory that told Finder "in this folder, always display hidden files". Can I do this?

  • Creating File objects from all files in a folder.

    Hi, I'm not too brilliant of a programmer, so this may be an obvious one that I could find in the API.
    My goal is to compare files for similarities and then give some output, that's not too important.
    My question is: How do I create an array of File objects from a folder of *.txt files, without creating each individually? Is there a way to simply get all the files from the folder?
    File I/O is still pretty new to me. If I didn't give a good enough explanation, please say so.
    Thank you very much!

    Note by the way that a File represents an abstract pathname, the idea of a file as a location. It doesn't specify the file's contents, nor does it require that the file it represents actually exists. A better name might be "theoretical file" or "directory listing entry".
    So getting a whole bunch of File objects is itself perhaps not necessary (although it could be useful).
    To expand on reply #1, look for File methods whose names start with "list".

  • How can I apply an image adjustment to all files in a folder?

    How do I apply an edit to every file in a folder?  Every time I need to do this, I end up flailing around for 10 minutes before I can finally get it to work.  Or, sometimes I give up and manually paste the copied settings to each file one at a time.  It seems a no-brainer that "copy settings" followed by "paste settings" to all files selected would do the trick.  Or "copy settings" foillowed by "Sync settings."  But it doesn't work.  What am I missing?

    pickfordpictures wrote:
    Thanks, Rob.
    You bet .
    pickfordpictures wrote:
    Do you know a way I might have backed out of that crop adjustment and gone back to the original crops?
    Here are the (potential) ways I can think of at the moment:
    * Undo (if you haven't gone too far since, or exited)
    * edit history (1-by-1)
    * read metadata (if previously saved prior to snafu/oops).
    * restore backup catalog (if no saved metadata).
    * ScrewAutoSync (if fixed number of steps to rollback for all afflicted photos).
    Rob

  • Script to set all files in a folder to "Read and Write" permissions? Please

    In advance my most abject apologies for posting such a simple question. I couldn't script my way out of a paper bag, and searching and googling have failed, no doubt because I don't even have the proper keywords. :-/
    The script I need is so simple that it most likely exists somewhere already. Whenever I copy image files from a DVD-ROM or CD-ROM burned on a Windows laptop to my desktop Mac, the files and folders therein are "Read Only" on my Mac. If there are many files in the folder, it's very easy to Select All and do a Get Info on multiple items, so I can rectify the situation by changing the whole set in a single step. But if I have ten files or less in a folder, each file opens an Info dialog box and that can become very tedious when I have scores of folders with nine or so files in each.
    Any guidance will be much appreciated.
    Message was edited by: Ramón G Castañeda

    You can attach a folder action to your destination folder, for example:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on adding folder items to ThisFolder after receiving AddedItems
    repeat with AnItem in AddedItems
    tell application "Finder" to set owner privileges of AnItem to read write
    -- tell application "Finder" to set everyones privileges of AnItem to read write
    end repeat
    end adding folder items to
    </pre>
    ... but you can also use the Inspector (option-command-i) to get a single info window for multiple items.

Maybe you are looking for

  • Trouble connecting to Hotel Wifi

    I have a 2011 Macbook pro with mountain lion and I am currently at a hotel where I am unable to connect to the wifi.   To access you select the wifi that you want and open a browser and a login page should show up to allow you to sign in.  I never ge

  • Invalid serial no

    I have installed an old version of creativesuite 2 premium on a new computer running windows 8 and when I launch indesign and enter the serial number I get the message serial no not valid. Is there a conflict with windows 8

  • Newbie: Received Flash content - need help embedding - onClick

    Hi, I received a web banner from one of our suppliers that I need to embed into our website.  I've got it into the web page but don't know how to configure an "onclick" action.  In my reading I don't find a parameter to specify what action to take if

  • Feature Request: Multiple Email Reply

    I've spent a few minutes hunting around the Apple.com website trying to find/search for a way to provide feedback for Mail. There doesn't appear to be such a beast, so I thought I would post it here. In other email programs I have used over the years

  • Does anyone know what this message means?

    I use macbook pro mountain lion OSX 10.8.2, Traktor Pro 2, Nicecast, Shoutcast, & Wavestreamer to stream a mix weekly over the internet. I never had any problems before I started the actual "radio show". I would occasionally check to see if I was abl