Renaming files in folder

trying to figure out how to use automator to rename files within a folder.
searched on youtube but none of the methods seem to work on my mac.
if anyone knows of a great tutorial for this i would love to have it.
thanks'
Owen

Sorry, I'm not sure what you mean. Are you referring to the Downloads folder that Mac OS X sets up by default in your user's home directory? If so, you rename files in that folder the same as you would any other folder. The Downloads folder does not (unless something's amiss with the permissions on your system) restrict anything and isn't any sort of "special" folder in terms of how it behaves.
If that's not what you meant, please post back and explain further.
Regards.

Similar Messages

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

  • Rename file or folder in Finder?

    I am convert from Windows.
    In Windows, to rename a file or folder you just highlight its icon and hit F2. Then the field becomes editable. Is there such a shortcut key in OS X/Finder? Right now, I am highlighting the file/folder, doing a crtl^ Get Info in the context menu. Really slows me down. Thanks.

    Alternatively, select the file then (after a short delay to avoid double-clicking) click in the name box. This will also make it editable.

  • [Solve] Bash: Rename file in folder to sequential numbers saving path

    I have a folder with many subfolders with many files. I want to rename all files to sequential numbers (0001.jpg, 0002.jpg, .0003,jpg ...) but i want to save the path. I mean that the files should not be saved in the root directory (where i launched the script), but I want them to remain in original subdirectorys. How can i do this?
    Last edited by cypherinside (2011-11-14 18:37:16)

    cypherinside wrote:
    for src in "$1"/*; do ## "$1"/*
    are all the subdirectory. Can i use "$(pwd)/*" instead of "$1/*"? In this way i don't write the parent directory
    If you want to specify $PWD, just call the script with an argument of '.' to point it at PWD.
    cypherinside wrote:
    if [[ -d $src ]];
    walk "$src"
    continue
    fi
    I dont' understand
    It's simple recursion. You don't want to rename directories, you want to process the contents of the directory in the same way you're processing the current directory.
    cypherinside wrote:
    printf -v dest '%s/%04d.jpg' "$1" "$(( ++i ))"
    Stores in dest... what? I assume that %s is a string as in C language, infact you give "$1" as argument (but why?). And I assume that  "$((++i))" is like i=$((i+1)). Is it right?
    It's the bash equivalent of sprintf(3).
    cypherinside wrote:
    [[ $1 ]] || exit 1
    I don't understand.
    If $1 doesn't exist (i.e. you passed no arguments to the script), then refuse to run and exit immediately with an error.
    You weren't really clear in your requirements, so I wrote it as I interpreted it. If you want to reset the numbering for each directory, scope 'i' locally:
    #!/bin/bash
    walk() {
    local -i i=0
    for src in "$1"/*; do
    if [[ -d $src ]]; then
    walk "$src"
    continue
    fi
    printf -v dest '%s/%04d.jpg' "$1" "$(( ++i ))"
    mv "$src" "$dest"
    done
    [[ $1 ]] || exit 1
    walk "$1"

  • Weird flashing problem - cannot rename any file or folder in Movies

    I have a problem affecting just my Movies folder. Whenever I view it in the Finder, the edge of the Finder window will flash once every four seconds. If I am trying to rename an item within the Movies folder when the flash happens, I get dumped out of the name editor and the file or folder is given the partially-typed name.
    It only happens when I'm viewing the Movies folder in the Finder. Any ideas?
    Message was edited by: Gareth Randall2

    What do you mean by "flashing"? Can you post a video or photos for us to see?

  • How to rename a file or folder.

    HI, I was thinking of some thing, but I need to know how to make java rename a file/folder like you do via dos.
    Hope this is clear.
    PS I had another post and I got the answer thanks for those who help, I lost the thing so couldn't reply(DUH').
    So say I have "myfile.txt", and wanna rename to "yourfile.txt".
    Just point my in the right direction if it's long.

    import java.io.*;
    public class Rename
         public static void main (String args [])
         { // main program
    // File (or directory) with old name
    file f1 = new File("newone.txt");
    // File (or directory) with new name
    File f2 = new File("newfile.txt");
    // Rename file (or directory)
    boolean success = f1.renameTo(f2);
    if (!success)
    // File was not successfully renamed
    System.out.println("\nFile was renamed!\n\n");
    This is what I have done, the import removed 3 of the 4 errors, but its still not working, this is the message.
    C:\Documents and Settings\jonathan\Desktop\New Folder (2)\Rename.java:7: cannot resolve symbol
    symbol: class file
    location class rename
    file f1 = new file("newone.txt")
    ^
    1 error

  • Can't delete, rename files, or move to another folder

    I had posted earlier about not being able to delete, rename files, or move to another folder. It never was resolved here, and I guess Apple still hasn't done anything about it. Here's a great workaround I found though in case others need something. Download the program called "Unlocker", it's free and you can get it at http://ccollomb.free.fr/unlocker/ When you get the message about the file being in use, even though QuickTime isn't even open, you can unlock the f'ing file and do whatever you want to then, move, uh DELETE, or rename, or whatever. Try it, it's the best thing going so far seeing Apple isn't doing anything about this problem.

    Hi there,
    I am still struggling with this problem. Actually my coworker has the same machine, Apple pro with windows xp installed, but he does not have this problem with his quicktime 7.5. I uninstalled 7.5 and installed 7.2, but it did not solve the problem. The fact is that I don't have the problem in my laptop which I am using it in the office. I am still trouble shooting. Hopefully I can find an answer.
    Peace

  • Need a script to do the following... rename files based on folder name...

    Hi. Macophile just starting to tread the waters of Applescript, trying to use Automator but don't think it will do what I need.
    I have many images stored with-in folders that I would like to extrapolate a given number of characters from the folder name and Add Text to the files within those given folders.
    Basically...
    Folder name is C00100_Descriptive
    Files within folder are just Descriptive_01, Descriptive_02
    Would like to make all files within a given folder take the first 7 characters from the folder and Add that text to all files and files within subfolders of that folder to make the resulting files shown as...
    C00100Descriptive01
    C00100Descriptive02
    Along with this I would also like to incorporate into the script, an added step to create Thumbnail jpegs of the image files in a Subfolder under C00100_Descriptive folder.
    I can see how to do that in automator but not specifying parameters such as taking a certain number of characters from the folder the file resides in and adding that selected text to the files.
    Ideally I would like a droplet or something that I could take a bunch of folders and drop them on the droplet to perform these actions.
    Any advice, help or guidance would be really helpful! Thanks in advance.

    Awesome, you're quite welcome, glad to hear it worked for ya!! Here's another version of the script that will rename the thumb files as jpg...
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">on run
    set theItems to choose folder with multiple selections allowed
    open (theItems)
    end run
    on open (itemList)
    repeat with anItem in itemList
    set theInfo to info for anItem
    --VERIFY THAT THE OPENED ITEM IS A FOLDER
    if folder of theInfo and not package folder of theInfo then
    --SET PATH TO THE FOLDER
    set theFolder to POSIX path of anItem
    --GET FIRST PART OF FOLDER NAME
    set folderNameStart to do shell script "echo " & ¬
    quoted form of (name of theInfo) & "|awk -F'_' '{print $1}'"
    --GET ALL FILE NAMES
    set fileList to list folder anItem without invisibles
    --PROCEED IF FOLDER NOT EMPTY
    if fileList is not {} then
    --SET PATH TO THUMBNAIL FOLDER
    set thumbFolder to theFolder & "_thumbs/"
    --CREATE FOLDER IF IT DOESN'T ALREADY EXIST
    try
    do shell script "mkdir " & quoted form of thumbFolder
    end try
    --PROCESS FILES
    repeat with fileName in fileList
    --SET PATH TO CURRENT FILE
    set oldFile to theFolder & fileName
    --PROCEED IF FILE IS NOT A FOLDER
    set oldFileInfo to info for POSIX file oldFile
    if not folder of oldFileInfo then
    --SET NEW FILE AND THUMB FILE PATHS
    set newFileName to folderNameStart & "_" & fileName
    set newFile to theFolder & newFileName
    set theExt to name extension of oldFileInfo
    set thumbName to text 1 through -((length of theExt) + 1) of newFileName & "jpg"
    set thumbFile to thumbFolder & "thumb_" & thumbName
    --RENAME FILE
    do shell script "mv " & quoted form of oldFile & space & ¬
    quoted form of newFile
    --CREATE THUMBNAIL
    --REPLACE '128' WITH MAX HEIGHT OR WIDTH OF THUMB
    try
    do shell script "sips -s format jpeg -s dpiHeight 72 -s dpiWidth 72 -Z 128 " & ¬
    quoted form of newFile & " --out " & quoted form of thumbFile
    end try
    end if
    end repeat
    end if
    end if
    end repeat
    end open</pre>

  • Possible: renaming files - folder names as variables.

    Here's a bit of background - I have a rather extensive MP3 collection (all legal - I work for an independent music magazine in my spare time) - it's approx 7,000 files big now.
    I have them all stored in folders as follows:
    c:\SAMag\MP3's\Albums (and here comes the tricky bit...)
    EITHER
    \Artist Name Here - Album Title\<.MP3 files here> (No artist names contain a '-' so this is the seperator)
    OR
    \Artists Name Here\Albums Title One\<.MP3 files here>
    \Artists Name Here\Albums Title Two\<.MP3 files here>
    \Artists Name Here\Albums Title Three\<.MP3 files here> (Where there are more than one albums to an artist)
    Playing these files is a nightmare as they all have different naming conventions and odd ID tags. I want to remove all ID tags and rename them to have meaningful file names (so that WinAmp displays a decent, non-confusing, name).
    I would like:
    "<artist name> - <song title> (<album title> - <#>)"
    So, basically - is it possible to rename files in Java. Specifically: using the folder names that they are contained in as variables to put in this name?
    Thanks for any help people!

    Thanks for that.
    I'm pretty new to this whole Java thing (even though
    I've been attempting to do it for a while!) so was
    wondering if you could point me in the right
    direction.
    That is exactly what I did though.
    Do you have the javadocs? If so then you look up java.io.File and read the methods in it.
    Here is the online link....
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html

  • 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

  • Automator/Applescript to Rename files when dropped in folder based on parent folder name

    When a file is dropped in a folder ( ParentFolder/Folder/File.pdf )
    I want to rename the file to ParentFolder_Folder_01.pdf
        --Get folder
        --Get ParentFolder
        --Check for next available number and use it.
        If ParentFolder_Folder_01.pdf exists, try _02
    I automator, I have chosen folder action
    Added 'Get selected finder items'
    I have attempted to modify another sript I found here to no avail.
    on run {input, parameters}
        tell application "Finder"
            set theFolder to input as string
            set theNameOfFolder to name of folder theFolder
            set theFiles to every file in folder theFolder
            set theFolders to every folder in folder theFolder
            my ProcessFiles(theNameOfFolder, theFiles)
            my ProcessFolders(theFolders)
        end tell
    end run
    to ProcessFolders(theFolders)
        tell application "Finder"
            repeat with thisFolder in theFolders
                set theNameOfFolder to name of thisFolder
                set theFiles to every file in thisFolder
                set theFolders to every folder in thisFolder
                my ProcessFiles(theNameOfFolder, theFiles)
                my ProcessFolders(thisFolder)
            end repeat
        end tell
    end ProcessFolders
    to ProcessFiles(NameOfOuterFolder, theFiles)
        tell application "Finder"
            repeat with thisFile in theFiles
                set theSuffix to my grabSuffixOfFile(name of thisFile)
                set name of thisFile to NameOfOuterFolder & "_" & theSuffix
            end repeat
        end tell
    end ProcessFiles
    to grabSuffixOfFile(theFile)
        set text item delimiters to "_"
        return (text item 2 of theFile)
        set text item delimiters to ""
    end grabSuffixOfFile

    Normally it is a bad idea to do things with items that are in the attached folder (earlier OS versions will retrigger folder actions when an item is renamed, for example), and you don't need to use a Get Selected Finder Items action since the dropped items are already passed to your workflow (also note that the input items will be a list).
    It looks like you are trying to use multiple passes to add on the folder names, but you will have less of a headache if you build the base name and just deal with the number suffix.  If I understood your naming scheme correctly, the following script should do the trick - it isn't very fast, but should be OK for a few items at a time.
    on run {input, parameters} -- rename input Finder items (aliases) to name of containing folders
      set divider to "_" -- the divider character between name pieces
      set output to {} -- the result to pass on to the next action
      set counter to "01" -- start suffix at one
      repeat with anItem in the input -- step through each item in the input
      set anItem to contents of anItem -- dereference
      tell application "Finder" to if class of item anItem is document file then -- don't mess with folders or applications
      set {itemParent, itemExtension} to {container, name extension} of anItem
      if itemExtension is not "" then set itemExtension to "." & itemExtension
      set grandParentName to name of container of itemParent
      set parentName to name of itemParent
      set newName to grandParentName & divider & parentName & divider & counter
      set documentNames to my getExistingNames(itemParent)
      repeat while newName is in documentNames -- increment counter suffix as needed
                                            set counter to text -2 thru -1 of ("0" & (counter + 1))
      set newName to grandParentName & divider & parentName & divider & counter
      end repeat
      set name of anItem to (newName & itemExtension)
      set end of output to anItem -- alias still refers to the same file even after renaming
      end if
      end repeat
      return the output
    end run
    to getExistingNames(someFolder) -- get base document names (no extensions) from a folder
      set nameList to {}
      tell application "Finder" to repeat with aFile in (get document files of someFolder)
      set {fileName, fileExtension} to {name, name extension} of aFile
      if fileExtension is not "" then set fileExtension to "." & fileExtension
      set fileName to text 1 thru -((count fileExtension) + 1) of fileName -- just the name part
      set end of nameList to fileName
      end repeat
      return nameList
    end getExistingNames

  • Renaming LPX Project-(folder) Audio-files by track name?

    Hi
    Is there any way or command to rename LPX Project folder Audio-files by track name automatically?

    If you're really using that version of L8, you really need to get the software update for that - there were quite a few glaringly obvious faults with the initial release of Logic 8, which a couple of updates rectified.
    I can't guarantee that the particular problem you specified is one of them, but you defininitely should do that...

  • Rename files or folders in Windows 8 not working

    Rename a file or folder on a Windows CE device is not working from Windows 8 when connected through Windows Mobile Device Center.
    From Windows 7 it worked just fine!
    This has been a problem for a very long time now, and im not alone according to all forums.
    But no fix as far as i can find!
    Is there anyone that have found a fix on this?

    http://answers.microsoft.com/en-us/windows/forum/windows8_1-files/windows-8-unable-to-rename-files-on-pocket-pc/abae21b7-7ee1-41c7-853e-1ac7ea5b0413
    It seems a issue in window 8.x system. Maybe you can ask for a MS support ticket. 

  • I renamed my home folder :( can't get it back to normal

    hi, i know there are about a billion topics in this forum about this same thing, but i still cannot get everything back to normal despite reading a lot of them.
    a couple of weeks ago i renamed my home folder, which created a whole new set of preferences.
    i've done some things since then, but i can't remember every step i've taken so bare with me! maybe you clever people can figure out what i've missed out/done wrong.
    i remember that in the users folder i renamed the new (incorrect) folder to Stephen_new, and changed the old (correct) one to Stephen. - this was as instructed to by http://docs.info.apple.com/article.html?artnum=107854.
    I also copied the whole library folder from the home > Stephen > library to the home > library folder, as instructed on step 3 on this website http://www.thexlab.com/faqs/renamehomerecovery.html (i presumed by 'home > library > library they meant home > Stephen > library). This gave me back my bookmarks and stuff.
    however, in the home folder there was only library and desktop. now, when i add something to a folder (say movies) through mac hd > users > stephen > movies (or the shortcut on the left of finder) it creates a new movies folder in the home directory, and copies the file there too. i.e. the file is in 2 places.
    also on the left of finder the icons for movies etc. have all gone back to blue folder icons.
    so basically the problem is before if i wanted to go to documents it would be right in my home folder, but now i have to go mac hd > users > Stephen > documents to get there, or i could make a shortcut on the left of finder.
    i'm not sure how to tell which users folder i'm actually using, Stephen or Stephen_new. I'm guessing it's Stephen as new files seem to save there.
    i would guess that i need to change my users folder to the name of my home folder icon, but you can't have 2 things the same name in the same folder.
    i created a topic at appleinsider.com's forums, which no one replied to. maybe some of the info there could help you figure it out
    http://forums.appleinsider.com/showthread.php?t=71584
    thank you very much for any help you can give me. if anything is unclear please ask me to explain further.
    ibook g4   Mac OS X (10.4.8)  

    hello again,
    i didn't really dare to delete the blue home folders before, just in case everything went wrong, but now i think i have so little space that i can't afford to lose 2.25gb!
    one thing that slightly worries me is the fact that the 'proper' library folder (in the home icon) is 2.09gb, whereas the 'wrong' one (from the blue folder forenamesurname) is 2.24gb - this is the one i would be deleting. just seems odd to delete a larger file than the one i presume i'm using.
    "Move everything you want to keep out of the blue folders, and then place both of the folders on your desktop. If everything works properly after a few days, delete both folders. If you are asked for your administrator password at any point or if either folder is copied instead of moved when dragged, don't delete that folder."
    by 'everything you want to keep', does this include the library folder? 'cause there doesn't seem to be much else, and i'm not sure if deleting the library folder would ruin all my preferences.
    i've put both of the folders on the desktop, it didn't ask for the admin password or try to copy them, so i guess that's good news. what kind of things should i be looking out for to act differently?
    are the folders not in use now that they are on the desktop?
    also if i put them in the trash will they have no effect? i.e. the same as permanently deleting them, so i could put them in the trash as a test.
    cheers, stephen.

  • SOLVED: The file or folder is corrupted and unreadable.

    On a Windows 7 Pro workstation, whenever a user logs in, they receive an error that the file C:\Windows\System32\en-us\winlogon.exe.mui is missing or corrupted. Every normal restart of Windows automatically invokes chkdsk c: /f. I've tried the
    following:
    Run chkdsk c: /f /r. The first run found several soft problems, but no physical problems with the drive. A subsequent run found no problems.
    Checking the memory. A bad stick was found and replaced. A re-run of the memory diagnostic with the new memory returns no errors. I believe that the problem was caused by the bad memory.
    Run sfc /scannow. The CBS.log reveals that there are problems that can't be fixed.
    An upgrade re-installation of the OS. It fails saying that there are problems on the disk.
    Upon investigation, the file winlogon.exe.mui is missing, but there is now a subfolder by that name in C:\Windows\System32\en-us. That folder is not normal and, as far as I know, shouldn't exist. The folder cannot be deleted or renamed. All attempts to do
    so fail with an error that "the file or folder is corrupt". Attempts to copy the file obtained from another computer also fail with the same error.
    Every normal restart of Windows automatically invokes chkdsk c: /f, but no errors are reported. I've even tried booting from a USB-based OS and running chkdsk on the drive, but no errors are reported, although the error persists.
    Before I reformat the drive and start from scratch (it's a custom workstation that will take more than a day to rebuild), I thought I'd ask if anyone has any ideas about what I can do. I'll be grateful for any suggestions.

    Hi David,
    Thank you for sharing your solutions and experience here. It will be very beneficial for other community members who have similar questions.
    Karen Hu
    TechNet Community Support

Maybe you are looking for

  • HT2204 verify on iTunes store

    verify on iTunes store id

  • OWC mercury drive - inside Mac Pro?

    Hello, I'm pretty sure this can be done, but I wanna make sure before I open the case and void my warranty. I have a OWC external hard drive (Mercury Elite-AL Pro), bought about 2 months ago as back-up for my iMac. I'm planning on buying a Mac Pro in

  • Encoding failed: unknown error in CS4 Windows 7

    I'm getting the following error near the end of an Adobe Premiere CS4 sequence that I'm trying to encode: - Source File: X:\scripts\rubyconf2009\premiere\19-nov-2009-14-10-east-meets-west-yuki-sonoda.prproj - Output File: X:\scripts\rubyconf2009\prem

  • Sales order and settlement rule

    Hi One of my clients has a problem with a settlement rule, apparently as soon as he saves an order the amount is immediately included in COPA. Where can i see this? I tried transaction COPA but it does not work. The settlement rule has Not for Settle

  • Early upgrading my device

    I am 13 years old. I own a DROID X, my brother owns a MOTOBLUR, and my dad owns a G'ZOne. We are on a family plan in which we share 1400this minutes a month and unlimited texting/internet. My dad said I could get the iPhone 4S for the Christmas. My u