Rename Files off other filenames

Discussion in 'Mac Programming' started by moosh7, Dec 5, 2008.

  1. moosh7 macrumors newbie

    Joined:
    Dec 5, 2008
    #1
    All,

    I am totally a newbie to mac programming and macs in general as well. What I am trying to do is to change 1 filename, by copying and pasting another file name, and then appending something to the end.

    So the source is
    File1.mp3 is the source name
    I and to pick a target file, copy the "File1.mp3" + .asd (append this) and have this be the name of the target file.

    Anybody have any idea how I can do this? or if there is any utility that can do this?
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    Save the following as renamator.sh:
    mv $2 $1.asd

    From the terminal, run:
    chmod 700 renamator.sh

    then to use it, run:
    renamator.sh UseThisName.mp3 FileToRename.xxx

    The result will be that FileToRename.xxx will be renamed to UseThisName.mp3.asd.

    -Lee
     
  3. moosh7 thread starter macrumors newbie

    Joined:
    Dec 5, 2008

Share This Page