Automator: Impossible to rename file using automator under Mac OS X Lion

Hi,
Before upgrade my iMac to MAC OS X Lion 10.7.2, I had service created with automator under snow leopard in order to rename my pictures file names by blocks instead of one by one. Since I'm using Lion, this one doesn't work anymore. I have completely recreate the service under Lion and the results is the same.
You can find below my workflow that is easy. The problem is the message error in the history of automator application. The message is "impossible to rename file "file name" because this one should create conflict with existing file". I already test a lot of times with different name where I'm sure that this one doesn't exist on my Mac but all the time without success (verify also with search function under mac)
If somebody can help me, it would be very interesting because I already tried to find answer on internet without success too.
Thanks in advance for your help.

the whole automator and in particular the record action was substantially rewritten in snow leopard. and the record action is slow, unreliable and you can't trouble-shoot it. it's a wonder it works at all. the only advice i can give is to use it as little as possible. if at all possible avoid it altogether. if you do need to use it try using keyboard strokes instead of the mouse movement. for example. use command+c and command+v for copying and pasting and use tabbing to choose the correct box on the page.

Similar Messages

  • Renaming multiple files using automator.

    hello. i am renaming multiple files using automator. now when i import the images they are in sequential order like dscn001, dscn002 etc... i want to rename it to 001 my pic, 002 my pic, etc...
    i am choosing the sequential renaming option. after importing the pics to automator i see to it that i sort them by name so that the new names i provide are in the order of the actual file names ie. 001mypic = dscn001, 002mypic = dscn002, etc..
    however, it seems that inspite of sorting then my name they are being renamed randomly. what should i do. this is distrubing the cronological order of the pics.
    thanks in advance
    Neerav

    Well, whenever I rename in sequential order (presorted or otherwise), that is exactly what happens, so I am not sure what is causing your particular problem. If you look at the results of sorting before the rename, you should see that the items are renamed in that order - although the way that they are sorted after the rename may be different. You can easily see this sorting by just adding a prefix/suffix and looking at the differences in how the lists are sorted (sorting by name (numerically) may give you different results). Check out this Apple document to see if this is what is happening.

  • Replace text on files using automator

    Hi
    On an older (recently replaced Mac 10.4 etc) I used to be able to use Applescript to change the name of files within a folder very easily.
    Is there an easy way to do the same using Automator?
    This is used a lot during a normal day and would be very helpful. I haven't used Automator much, work keeps getting in the way!!
    Thanks for any help.
    M

    Your Applescript should still work, although it might need some modification.
    I haven't tried these.
    Automator Script to Rename Files
    Automator Script to Rename Files (2)

  • Sedname - Batch rename files using sed

    Renaming files using sed is nothing new, but this script makes the process a little more friendly and adds a few features, including insertion of sequential numbers and a simulation mode.  The output of any find command can also be piped through sedname.
    sedname version 1.0.0
    Batch-renames files using a sed script
    Usage: sedname [OPTIONS] SEDSCRIPT FILE ...
    Usage: find [...] | sedname [OPTIONS] SEDSCRIPT
    Example: sedname 's/\(.*\)\.jpg/\1.jpeg/' *.jpg
    Example: find /mypics | sedname 's/\(.*\)\.jpg/\1.jpeg/'
    OPTIONS:
    --sim simulate only
    --dir rename directories too
    Use #D to insert a number with D digits forming a unique filename
    Example: sedname 's/thisname.*/thatname#3/' *
    ( changes thisname* to thatname001, thatname002, ... )
    Use #0 in replacement name to insert a number if needed
    Example: sedname 's/thisname.*/thatname#0/' *
    ( changes thisname* to thatname, thatname1, thatname2, ... )
    http://igurublog.wordpress.com/download … t-sedname/
    http://aur.archlinux.org/packages.php?ID=37707

    What does it have over zsh's zmv:
    # Remove illegal characters in a fat32 file system. Illegal characters are
    # / : ; * ? " < > |
    # NOTE: ``-Q'' and (D) is to include hidden files.
    $ unwanted='[:;*?\"<>|]'
    $ zmv -Q "(**/)(*$~unwanted*)(D)" '$1${2//$~unwanted/}'
    # Changing part of a filename (i. e. "file-hell.name" -> "file-heaven.name")
    $ zmv '(*)hell(*)' '${1}heaven${2}'
    # or
    $ zmv '*' '$f:s/hell/heaven/'
    # remove round bracket within filenames
    # i. e. foo-(bar).avi -> foo-bar.avi
    $ zmv '*' '${f//[()]/}'
    # serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)
    $ ls *
    1.c asd.foo bla.foo fnord.foo foo.fnord foo.foo
    $ c=1 zmv '*.foo' '$((c++)).foo'
    $ ls *
    1.c 1.foo 2.foo 3.foo 4.foo foo.fnord
    # Rename "file.with.many.dots.txt" by substituting dots (exept for the last
    # one!) with a space
    $ touch {1..20}-file.with.many.dots.txt
    $ zmv '(*.*)(.*)' '${1//./ }$2'
    # Remove the first 4 chars from a filename
    $ zmv -n '*' '$f[5,-1]' # NOTE: The "5" is NOT a mistake in writing!
    # Rename names of all files under the current Dir to lower case, but keep
    # dirnames as-is.
    $ zmv -Qv '(**/)(*)(.D)' '$1${(L)2}'
    # replace all 4th character, which is "1", with "2" and so on
    $ zmv '(???)1(???[1-4].txt)' '${1}2${2}'
    # Remove the first 15 characters from a string
    $ touch 111111111111111{a-z}
    $ zmv '*' '$f[16,-1]'
    # Replace spaces (any number of them) with a single dash in file names
    $ zmv -n '(**/)(* *)' '$1${2//( #-## #| ##)/-}'
    # or - with Bash
    $ find . -depth -name '* *' -exec bash -c '
    > shopt -s extglob
    > file=$1
    > dir=${file%/*}
    > name=${file##*/}
    > newname=${name//*([ -]) *([ -])/-}
    > mv -i -- "$file" "$Dir/$newname"' {} {} \;
    # Clean up file names and remove special characters
    $ zmv -n '(**/)(*)' '$1${2//[^A-Za-z0-9._]/_}'
    # Add *.py to a bunch of python scripts in a directory (some of them end
    # in *.py and give them all a proper extension
    $ zmv -n '(**/)(con*)(#qe,file $REPLY | grep "python script",)' '$1$2.py'
    # lowercase all extensions (i. e. *.JPG) incl. subfolders
    $ zmv '(**/)(*).(#i)jpg' '$1$2.jpg'
    # Or - without Zsh
    $ find Dir -name '*.[jJ][pP][gG]' -print | while read f
    > do
    > case $f in
    > *.jpg) ;
    > *) mv "$f" "${f%.*}.jpg" ;
    > esac
    > done
    # remove leading zeros from file extension
    $ ls
    filename.001 filename.003 filename.005 filename.007 filename.009
    filename.002 filename.004 filename.006 filename.008 filename.010
    $ zmv '(filename.)0##(?*)' '$1$2'
    $ ls
    filename.1 filename.10 filename.2 filename.3 filename.4 filename.5 ..
    # renumber files.
    $ ls *
    foo_10.jpg foo_2.jpg foo_3.jpg foo_4.jpg foo_5.jpg foo_6.jpg ..
    $ zmv -fQ 'foo_(<0->).jpg(.nOn)' 'foo_$(($1 + 1)).jpg'
    $ ls *
    foo_10.jpg foo_11.jpg foo_3.jpg foo_4.jpg foo_5.jpg ...
    # adding leading zeros to a filename (1.jpg -> 001.jpg, ..
    $ zmv '(<1->).jpg' '${(l:3::0:)1}.jpg'
    # See above, but now only files with a filename >= 30 chars
    $ c=1 zmv "${(l:30-4::?:)}*.foo" '$((c++)).foo'
    # Replace spaces in filenames with a underline
    $ zmv '* *' '$f:gs/ /_'
    # Change the suffix from *.sh to *.pl
    $ zmv -W '*.sh' '*.pl'
    # Add a "".txt" extension to all the files within ${HOME}
    # ``-.'' is to only rename regular files or symlinks to regular files,
    # ``D'' is to also rename hidden files (dotfiles))
    $ zmv -Q '/home/**/*(D-.)' '$f.txt'
    # Or to only rename files that don't have an extension:
    $ zmv -Q '/home/**/^?*.*(D-.)' '$f.txt'
    # Recursively change filenames with characters ? [ ] / = + < > ; : " , - *
    $ chars='[][?=+<>;",*-]'
    $ zmv '(**/)(*)' '$1${2//$~chars/%}'
    # Removing single quote from filenames (recursively)
    $ zmv -Q "(**/)(*'*)(D)" "\$1\${2//'/}"
    # When a new file arrives (named file.txt) rename all files in order to
    # get (e. g. file119.txt becomes file120.txt, file118.txt becomes
    # file119.txt and so on ending with file.txt becoming file1.txt
    $ zmv -fQ 'file([0-9]##).txt(On)' 'file$(($1 + 1)).txt'
    # lowercase/uppercase all files/directories
    $ zmv '(*)' '${(L)1}' # lowercase
    $ zmv '(*)' '${(U)1}' # uppercase
    # Remove the suffix *.c from all C-Files
    $ zmv '(*).c' '$1'
    # Uppercase only the first letter of all *.mp3 - files
    $ zmv '([a-z])(*).mp3' '${(C)1}$2.mp3'
    # Copy the target `README' in same directory as each `Makefile'
    $ zmv -C '(**/)Makefile' '${1}README'
    # Removing single quote from filenames (recursively)
    $ zmv -Q "(**/)(*'*)(D)" "\$1\${2//'/}"
    # Rename pic1.jpg, pic2.jpg, .. to pic0001.jpg, pic0002.jpg, ..
    $ zmv 'pic(*).jpg' 'pic${(l:4::0:)1}.jpg'
    $ zmv '(**/)pic(*).jpg' '$1/pic${(l:4::0:)2}.jpg' # recursively
    (from zsh-lovers)
    Edit: tried it now, and had to remove this silly block to make it let me use alternate delimiters:
    if [ "${sedscript:0:2}" != "s/" ]; then
    echo "Invalid sed script: $sedscript" > /dev/stderr
    exit 1
    fi
    Last edited by JohannesSM64 (2010-05-31 15:29:44)

  • Rename File using ABAP

    Hi,
    Can any one help me how to rename file using ABAP programme.
    Thanks,
    ABDUR

    use these function module
    RS_RENAME_PROGRAM              Rename Program With All Dependent Objects
    RS_RENAME_PROGRAM_INCLUDE      Rename Include Progam Without Any Other Objects

  • Automator Script to rename files with the file's Comment text?

    Hello and thank you for your time!
    Summary:
    I'd like to have an Automator Script that would copy the File's Comment info and paste it to the File's name, so I can import my sound effects into iTunes and have the proper labeling.
    Breakdown:
    I have a ton of Sound Effects that I'd like to put into iTunes, but the filenames are for example, "04. Track 04.mp3".  Not the most helpful name.
    I can search by "car crash" in the finder and find THAT file ("04. Track...")  because it's in the File's metadata in the Comment info, as "Car Crash - Chevy Camaro".
    So is there a script or a way to script Automator to copy the File's Comment info and paste it to the File's name, so I can import these into iTunes and have the proper labeling?
    Thank you for reading!
    - Ben

    This should be much faster and direct....
    Source = "C:\temp" 
    Destination "C:\newTemp"
    Set objFSO = CreateObject("Scripting.FileSystemObject")     
    Set arrFiles = objFSO.GetFolder(Source).Files  
    For Each file In arrFiles  
        If InStr(LCase(file.name), ".zip.") > 0 Then 
            arrFilename = Split(lcase(file.name), ".zip.")  
            newname = arrFilename(0) & ".zip" 
            WScript.Echo file.name & " -> " & newname  
            objFSO.CopyFile file.path, Destination & "\" & newname
        End If 
    Next 

  • Get old item name for renamed files using TFS API

    My current tfs will be retired in next few months.I am using tfs api to create a parallel tfs on a new server from the existing one. I have folders and solutions that have been renamed. I am iterating items and based on their changetype(add, edit, delete,
    sourcerename etc), I am checking them in destination tfs.
    I am not able to get Old filename for a file, in order to use PendRename when the item that is being iterated is Delete|SourceRename or Rename.
    I tried the mentioned solution :
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/f9c7e7b4-b05f-4d3e-b8ea-cfbd316ef737/how-to-get-previous-path-of-renamedmoved-of-file-using-tfs-api?forum=tfsgeneral
    But, my changeset has a lot of changes and hence identifying a particular file seems difficult.
    Do we have something that interraltes two items (the deleted and renamed) ones other than the changeset, because there needs to be a uniquely identifier that associated the two items so that they may appear together in TFS history?

    Hi Fabcoder,
    As Daniel mentioned, you can migrate source control files and work items to the new TFS server by using TFS integration tools.
    If the new server has the complete history, then you can view the history of the specific file to check the pervious path. Or you can do a compare between the project in new TFS where the file located with the matched project in current TFS to check
    the differences.
    Best regards, 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Rename files using text or excel file

    I am trying to find out how to rename files on my pc using the names stored in a text document
    eg. the file on the pc is called "C07_08.dat"
    the text file has the following line "3am Eternal         KLF         03:15 121 BMG         C07.08"
    i want to change the name of the file "C07_08.dat" to "3am Eternal.mpeg"
    What I would like is a batch file or program or something that will see the text "C07.08" and find the corresponding file "C07_08.dat" and rename it "3am Eternal.mpeg"
    I have managed to create a excel document that has the information in four separate columns
    Column A has the name of the file I want to use (ie. 3am Eternal) Column B & C have unneeded information and Column D has the file reference (ie. C07.08)
    I was told that Python or Visual basic could do this so I downloaded them but I have no experience with this so im lost as to what to do, I have over 1800 of these files so doing it file by file will take quite a while.
    I have included a sample of the text file for reference if that helps
    3am Eternal KLF 03:15 121 BMG C07.08
    4 In The Morning Gwen Stefani 04:22 092 UMA HD1.10
    4 Minutes Madonna ft J Timberlake 04:04 113 WAR HE3.05
    5 6 7 8 Steps 03:24 000 BMG C48.03
    5678 Steps 03:23 140 MUS H16.02
    6 Of 1 Thing Craig David 03:15 116 WAR HE2.11
    60 MPH New Order 03:51 125 WAR N57.11
    7 Days Craig David 04:30 084 SHO N41.16
    7 Things Miley Cyrus 03:29 107 EMI HE7.09
    99 Luft Balloons Nena 03:58 095 WAR C27.10
    99 Times Kate Voegele 03:27 112 UMA HG6.07
    A Girl Like You Edwyn Collins 03:47 126 MDS R06.08
    A Little Bit Pandora 03:35 132 UMA H23.01
    A Little Less Conversation Elvis VS JXL 03:02 115 BMG H68.03
    A Matter Of Trust Billy Joel 04:00 110 SON C59.11
    A New Day Has Come Celine Dion 04:20 092 SON H65.20
    A Woman Like You Mondo Rock 04:03 169 MUS R06.01
    About You Now Sugababes 03:32 083 UMA HD5.08
    Absolutely Everybody Vanessa Amorosi 03:52 124 TRA H40.06
    Absolutely Fabulous Pet Shop Boys 03:45 132 EMI C15.02
    Accidentally In Love Counting Crows 03:08 138 UMA H94.05
    According To You Orianthi 03:18 066 UMA HG4.12
    Achy Breaky Heart Billy Ray Cyrus 03:55 122 SON K11.02

    Here are two VBScripts that will rename the files based on the text file example you provided. The script that reads a
    TEXT FILE requires each entry to be separated by
    ONE TAB  because it is the
    TAB
    that it uses to split each line into 4 parts (part1 - old file name, part2 and part3 - items you don’t need, part 4 - new file name). If there is more that one tab then the Split Function will not work properly.
    The second VBScript will read the
    EXCEL FILE row by row and use the values in Column A for the old file name and
    Column D for the new file name. This approach will work much better if you have an excel document setup like this.
    I used your example that you provided and it test fine for both approaches.
    'Read text file
    Dim objFSO, objFolder, inFile, strInLine, strOldFile, strNewFile
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    'Select the folder
    Set objFolder = objFSO.GetFolder("C:\Scripts\MusicFiles")
    'Open Text File
    Set inFile = objFSO.OpenTextFile("C:\Scripts\MusicFiles.txt",1)
    Do Until inFile.AtEndOfStream
    'Read text file line by line and Split each line into 4 parts.
    strInLine = Split(inFile.ReadLine, vbTab)
    'Old File name
    strOldFile = strInLine(3)
    'new File name
    strNewFile = strInLine(0)
    'Loop through the files in the folder
    For Each File In objFolder.Files
    'If the file name matches the old file name above
    If File.Name = strOldFile & ".dat" Then
    'Replace it
    File.Name = strNewFile & ".mpeg"
    End If
    Next
    Loop
    'Close the text reader
    inFile.Close
    MsgBox "Done."
    'Read Excel file
    Dim objFSO, objExl, objFolder, objWorkbook, strOldFile, strNewFile, intRow
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objExl = CreateObject("Excel.Application")
    'Select the folder
    Set objFolder = objFSO.GetFolder("C:\Scripts\MusicFiles")
    'Open the Excel file
    Set objWorkbook = objExl.Workbooks.Open("C:\Scripts\MusicFiles.xls")
    'Start at row 1
    intRow = 1
    'Read each Row until the end
    Do Until objExl.Cells(intRow,1).Value = ""
    'Old file name is in column 4
    strOldFile = objExl.Cells(intRow, 4).Value
    'New file name is in column 1
    strNewFile = objExl.Cells(intRow, 1).Value
    'Loop through each file in the selected folder
    For Each File In objFolder.Files
    'If the file name matches the old file name above
    If File.Name = strOldFile & ".dat" Then
    'Replace it
    File.Name = strNewFile & ".mpeg"
    End If
    Next
    'Increment each row
    intRow = intRow + 1
    Loop
    'Close Excel
    objExl.Quit
    MsgBox "Done."
    v/r LikeToCode....Mark the best replies as answers.

  • During daily refresh/clone alter database rename file genrating logs under $ORACLE_HOME/dbs with name c-1437102747-20130920-16

    Did anyone have seen this behavior?
      DB version : 11.1.0.7
      OS : HP-UX Itanum
      EBS -11.5.10.2
    We are doing daily refresh/clone of a database instance from production. Recently we are seeing the growth of $ORACLE_HOME/dbs directory during this
    refresh.   During investigation we find out that
      1) When we rename the database files after database restoration. Each below command genrating the 24MB of log file under $ORACLE_HOME/dbs.
      Command :
      alter database rename file '/db02/prod/XDB.dbf' to '/db02/test/XDB.dbf';
    alter database rename file '/db02/prod/a_archive01.dbf' to '/db02/test/a_archive01.dbf';
      Logfiles under $ORACLE_HOME/dbs on target :
      -rw-r----- xxxxx 24379392 Sep 20 05:30 ./dbs/c-1437102747-20130920-02
      -rw-r----- xxxxx 24379392 Sep 20 05:30 ./dbs/c-1437102747-20130920-03
      2) After few minutes, these logs got removed from the directory.
      3) Did not find anything unusual in the alert log.

    These are controlfile autobackups.   Every time you make a physical change to the database structure, an autobackup is created.  In 11.2, the frequency is reduced -- for example if you make 5 changes in quick succession, one autobackup is created.
    CONTROLFILE AUTOBACKUP ON    would be visible when you do a SHOW ALL in rman.
    Hemant K Chitale

  • Rename files using Enter key

    Using the Enter key to rename files and folders works only with items in the desktop. Everywhere else I need to use Command+Enter. Any one experiencing this behavior? Any ideas on how to make it work as it should (only Enter needed)?

    Thanks Bazsl,
    Lua is the language chosen by Adobe for plugins. It's also the language used for some of Lightroom proper.
    PS - In my opinion, Lua is a great little language, although the plugin environment is limited..

  • PS Script To Rename File Using CSV - Filename Is Containing IP Address And Needs To Be Host Name

    Hello All,
    I am currently working with PDF reports which are named "TEMXX.XX.XXX.XX_141215.pdf", XX.XX.XXX.XX is an IP address. I have created a CSV which contains two columns, ColumnA = IPAddress ColumnB = HostName. I would like to remove the existing title
    of the file, and rename it as "ColumnB.pdf".
    The only two commands which come to mind are:
    get-childitem *.pdf | foreach { rename-item $_ $_.Name.Replace("TEM", "") }
    get-childitem *.pdf | foreach { rename-item $_ $_.Name.Replace("_141215", "") }
    The above commands are of course to remove the unwanted "TEM" and "_141215" but I cannot seem to figure out how to just rename files as ColumnB.pdf.
    Any help would be greatly appreciated :).

    Hello All,
    I performed the following but it did not execute, just returned the prompt. The final ps1 file was saved and ran as follows:
    $lines = Import-Csvservers.csv
    ForEach($line in $lines){
    get-childitem *.pdf |where {$_.name -eq $line.ColumnA}|Rename-Item -NewName $line.ColumnB
    CSV file named servers.csv displayed as follows:
    ColumnA,ColumnB
    192.168.1.2,SERVER1
    192.168.1.3,SERVER2
    Files in Explorer displayed as follows:
    ray192.168.1.2_2015.pdf
    ray192.168.1.3_2015.pdf
    As indicated above the filename should be finalized as:
    SERVER1.pdf
    SERVER2.pdf
    Any help in figuring this out would be greatly appreciated.

  • Cannot place file in sidebar of Mac OS X Lion

    in Mac OS X Snow Leopard (10.6.x) I was able to place a file on the sidebar and when I clicked on it, it would open. Mac OS X Lion does not allow placing a file ( a .doc file, for example) in the sidebar. I know I need to convert an alias to a certain type of alias that works with Lion (and Unix), but I cannot find the instructions in the "Communities" any more. Thanks for any help.

    I found this answer elsewhere in the communities. Works fine.
    It is possible to place files in the Sidebar under Lion, but you can't just drag-drop them there like you used to be able to. To place a file in the Sidebar:
    1. In a Finder window, navigate to the file you wish to place in the Sidebar and select it.
    2. From Finder menubar select Finder > File > Add to Sidebar, or press Command-T. The file will be placed in the Sidebar, where you can click-drag it up and down to locate it as you wish.
    Thank Richard, who posted this.

  • 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 files with Automator & Apple Spript

    Hi there!
    I need the help of an expert in Automator & Apple Spript....
    I've got to rename 500 files with the following names:
    001-001 firstfilename.jpg
    104-095a otherfilename.jpg
    Any idea on how to get rid of the second number (that is 3 or 4 characters long, but always followed by a space) so to have something like:
    001 firstfilename.jpg
    104 otherfilename.jpg
    Thanks in advance & Ciao!
    Sergio
    Black MacBook   Mac OS X (10.4.7)  

    The following script should work.
    IMPORTANT:
    1) The files whose names you want to change must all be in the same folder. That folder must be open, and it must be the front finder window.
    (Also, no other files should be in that folder)
    2) Make a back-up of the files before you do this (just in case there is a problem. I hope the files are not too large)
    3) This should work if the file names are consistent. I have presumed that there is always a hyphen and a space ( ) and that you wish to keep the characters before the hyphen and after the space.
    4) Copy the script below into the script editor. When you have prepared 1 & 2 above then run the script. Good luck
    --Start of Script
    tell application "Finder"
    set myFiles to every file of the front window
    repeat with Cfile in myFiles
    set WholeName to the name of Cfile
    set AppleScript's text item delimiters to "-"
    set WNlist to every text item of WholeName
    set WNpart1 to first item of WNlist
    set AppleScript's text item delimiters to " "
    set WNlist2 to every text item of WholeName
    set WNpart2 to last item of WNlist2
    set NewName to WNpart1 & " " & WNpart2
    set name of Cfile to NewName
    end repeat
    end tell
    set AppleScript's text item delimiters to ""
    --End of Script
    MacBook   Mac OS X (10.4.7)   iMac G4 (10.3.9)

  • How do I open a password protected file ( using automation objects : oAVDoc, CCAcroPDDoc ) ?

    HI,
    I am using adobe automation and wanted to open a password protected file and remove its password and save it ?
    Is there any way to do so in vc++ ?
    ( using CCAcroApp, CCAcroAVDoc, CCAcroPDDoc )
    thanks & regards,
    ~ Rudresh

    Post your questions in the forum for Acrobat SDK.

Maybe you are looking for

  • My phone is going to be cut of by orange cos I can't afford the bill but I got my current phone direct from apple shop can I use another SIM card from another network in

    my iPhone is going to be cut of by orange as I can't afford the bill, my current phone is direct from an apple shop as I had to have it replaced , can I put another sim in from another network and use my phone on a pay as you go from O2

  • Updating Qualifications in PA30

    Hello Experts, On deleting qualifications and adding/changing a new qualification in PA30 in either the CHANGE or CREATE function all looks good however on returning to the records after some time, there are duplications of the old records appearing

  • Videoplayer seems to lose connection

    Hi, for a long time now I am searching for the right solution. The mediaplayer is working very well, but after finishing the videoplay(complete event) and waiting a while (about 10 minutes) the player refuses to start again. When I set the videopath

  • Quick Paypal IPN q

    Hello, I just need to confirm my understandings of the available variables https://www.paypal.com/IntegrationCenter/ic_ipn-pdt-variable-reference.html Ok were I to pass any values to paypal using any of the variables listed and the entire transaction

  • Which function can insert product in opportunity?

    Hi Expert, I got requirement to auto insert product which user requires and the product have to be determined from field "Opportunity Group" of transaction Opportunity. I think, I would use BADI "order_save" to trigger but I don't know how to insert