Apple script to batch rename files by deleting tags on front and back of the file name

Hi, I'm trying to rename a couple thousand files from their current format:  "01074_Something Of A Dreamer_Mary-Chapin Carpenter.lrc"
                                                                                                                       "01075_Where Did We Go Right_Lacy J. Dalton.lrc"
                                                                                                                       "01076_Everybody's Reaching Out_Crystal Gayle.lrc"
                                                                                                     To simply:  "Something Of A Dreamer.lrc"
                                                                                                                       "Where Did We Go Right.lrc"
                                                                                                                       "Everybody's Reaching Out.lrc"
I just want to delete the number tag on the front and the artist name at the end for all of the files.  I imagine a Script to do this wouldn't be too hard to write, something along the lines of read file name after the first '_' character it reads until it reads a second '_' character and rename the file to the string it reads between those two underscores with .lrc at the end.
Unfortunately I know nothing about Apple Script other than it seems like the thing I would need to automate this process based on my limited google searches.  If someone could help me out with some advice on how to go about making this script or obviously if you simply have and/or can quickly write a script to do this it would be greatly appreciated!

Here:
tell application "Finder"
repeat with this_file in (get files of window 1)
set the_name to name of this_file
set temp_name to items ((offset of "_" in the_name) + 1) thru -1 of the_name as string
set temp_name to (items 1 thru ((offset of "_" in temp_name) - 1) of temp_name as string) & items -4 thru -1 of the_name as string
set name of this_file to temp_name
end repeat
end tell
(123647)

Similar Messages

  • I tried sending the Adobe pdf file of a poster via email and it said the file was too large to send.  How do I remedy this?

    I tried sending an Adobe pdf file of a poster via email and it wouldn't go through because it said the file was too large.  How do I remedy this?

    Lots of free file hosters out there. Mediafire.com as an example. Upload a file there, copy and paste the download link you are given into your email to the client, then delete it as soon as the client successfully downloads it. Mediafire has 10 gb storage for free accounts.
    Email is limited to 10 MB on attachments. So that's where file hosting comes in.

  • I have the iphone 4. The front and back of the phone have damages such as cracks. It's been like this for awhile. I don't have the money to buy another phone right now.. Will apple help me out this one time to just replace my iphone 4?

    Somone please give me some feedback!

    Sure, they'll replace it the minute you hand over $149 for an out of warranty replacement.

  • TS4036 I deleted Pages from icloud on my iphone.  the next time i was on my ipad it flashed and all of the files disappeared.  did i deleted them from icould without realizing it?  are they gone forever or is there a way to restore them?

    I deleted Pages from icloud on my iphone.  the next time i was on my ipad it flashed and all of the files disappeared.  did i deleted them from icould without realizing it?  are they gone forever or is there a way to restore them?

    Welcome to the Apple Community.
    If you mean you deleted the files from Pages on your phone whilst using iCloud, then yes they will disappear from Pages on your iPad too.
    If you simply deleted the app from your phone, if you were using iCloud then they should not have disappeared from your iPad.
    It's not clear from your post, which of these you did.

  • How to repair my macbook pro when i had delete the app store file and know it telling that appstore file has been damage or incomplete and i had the version 10.6.8

    how to repair my macbook pro when i had delete the app store file and know it telling that appstore file has been damage or incomplete and i had the version 10.6.8

    so is their is any way that i can solve this matter

  • If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and gi

    If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and give the extension name is plz tell me the way that office files are compatible with it.
    == This happened ==
    Every time Firefox opened
    == when i download the office files

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • I am trying to delete pages from a PDF file. I opened the bookmarks, selected the pages to delete and choose Edit Delete. The selected pages are not deleted. Note: I have to open the file using a passport provided by an external party.

    I am trying to delete pages from a PDF file. I opened the bookmarks in the PDF file, selected the pages to delete and choose Edit > Delete. The selected pages are not deleted. Note: I have to open the file using a passport provided by an external party.

    Resolved

  • I'm upgrading to OS X Mavericks 10.9.3 from the Apple Store, do I need to back up the files?

    I'm upgrading to OS X Mavericks because the App Store notified me. I'm still downloading it and it's a long way until I can upgrade it. Do I need to back up the files using Time Machine? I don't have any external hard disks with me right now and I'm worried if my data will lost after upgrade. Please answer. Thank you!

    You need to backup files if you are trying to write the new OS X on the previous OS X partition. You will end up loosing all files & data if you replace the Mavericks with the old OS Xon same disk. But if you have another partition ready for the Mavericks then no worries. I did the same when I downloaded 10.9 from Apple. I too had Stellar Drive Clone software ready to backup my entire hdd. Actually, you should have a backup utility for one  or many reasons.

  • Hey i have ios 4.3.5 on my ipad and i wanna update it to ios 5.1.1 and ive downloaded the file made by apple but every time i try to update it to ios 5.1.1 it allways says error 3194. can anyone help?

    hey i have ios 4.3.5 on my ipad and i wanna update it to ios 5.1.1 and ive downloaded the file made by apple but every time i try to update it to ios 5.1.1 it allways says error 3194. can anyone help?

    alanangert1 wrote:
    ... every time i try to update it to ios 5.1.1 it allways says error 3194. ...
    3194  = http://support.apple.com/kb/ts4451
    If the above Support Article does not resolve it... then you have a problem.
    Perhaps a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is required..
    Be sure to make an appointment first...
    Note:
    That error message may be indicative of the Device being Hacked / jailbroken.... If this is the case then you are on your own.
    Unauthorized modification of iOS...
    http://support.apple.com/kb/HT3743

  • I somehow changed a video in my imovie to zero fps, so it just plays black.  The video still exists on my desktop but even when I delete the files from imovie and reimport them the file is still in zero fps and play black.

    somehow changed a video in my imovie to zero fps, so it just plays black.  The video still exists on my desktop but even when I delete the files from imovie and reimport them the file is still in zero fps and play black.

    I'm not sure of your question.
    Are you asking how to use Photoshop?
    Or are you asking for the dimensions of video iMovie uses?
    It edits in 720P HD, which is 1280x720.
    You can make it a bit bigger so you can zoom in.
    Much bigger then this is a waste of time.

  • I have a dilema i use a programme called Mackeeper i accidentally moved several files to my trash,i would like to put the files back where they belong but put back option is in grey and wont work??

    I have a dilema i use a programme called Mackeeper i accidentally moved several checked files to my trash BUT i didnt delete them,i would like to put the files back where they belong but the put back option is in grey and wont work?? i have spoken to Apple and to no avail !!!
    Mackeeper moved my files to my trash so i pulled them out of my trash to my desktop it has copied them to my desktop as well as kept them in my trash!!
    im so confused and things are not working properly anymore such as my google chrome for example...all my book marks are gone BUT i can go to the google file which is out of place on my desktop and view all my bookmarks data...ALL of my files still exist but they are just out of place now which is making it hard for certain options on my computer to work...
    the files includeAccounts,address book plug-ins,addressbook,Adobe,AIM,Alfred,Anquet Maps,Apple,Asramsoftware,Audio,Automatically add to itunes,facebook,facebook 15-53-13-329,faxfresh,five details,flipping book photo album, font collections, fonts, forismatic,Garageband,Gimp,Google,Google 15-53-13-344,icloud,icons,idocument lite,ilife media browser,ilifepage layout,internet plug-ins,ip scanner,itext express,itunes,iweb,Keyboard layouts,Keychains,launch agents,Librarian,limit point software,logs,mail,mail 15-53-13-895,messages,metadata,mobile documents,mobiscope,moso,movie effects,mozilla,MPlayerx,mywebcamBroadcaster,Native instruments,Skype and LOADS more......
    HOW do i get this stuff back to where it is supposed to go so that these programmes work properly again???? i also used delete and command but that did not work either,like i said i have not emptied my trash and ALL the info is there its just totally out of place and the put back option will not work sor some reason!!??? im running 10.8.5 imac someone PLEASE help me!!
    i have not set up time machine either but i do back up to a site called backupblaze...

    Step 1
    Remove "MacKeeper" as follows.
    "MacKeeper" has only one useful feature: it deletes itself.
    Note: These instructions apply to the version of the product that I downloaded and tested in early 2012. I can't be sure that they apply to other versions.
    IMPORTANT: "MacKeeper" has what the developer calls an “encryption” feature. In my tests, I didn't try to verify what this feature really does. If you used it to “encrypt” any of your files, “decrypt” them before you uninstall, or (preferably) restore the files from backups made before they were “encrypted.” As the developer is not trustworthy, you should assume that the "decrypted" files are corrupt unless proven otherwise.
    In the Finder, select
    Go ▹ Applications
    from the menu bar, or press the key combination shift-command-A. The "MacKeeper" application is in the folder that opens. Quit it if it's running, then drag it to the Trash. You'll be prompted for your login password. Click the Uninstall MacKeeper button in the dialog that appears. All the functional components of the software will be deleted. Reboot.
    Failure to remove MacKeeper will result from neglecting any one of these points:
    Quit MacKeeper before dragging it to the Trash.
    Don't empty the Trash after dragging the application to it. Let MacKeeper delete itself.
    Don't try to drag the MacKeeper icon in the Dock to the Trash.
    Here are some general suggestions. If you want your computer to be usable, don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this stuff is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    The only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.
    Step 2
    Restore from the last backup that predates the unwanted changes.

  • I bought a song, and it says the file is corrupted and will not download what should i do?

    I bought a song, and it says the file is corrupted and will not download what should i do?

    If you see the "Purchased" option on the main screen of the iTunes Store, here's what I'd do:
    1) Go into your library and delete the file if it downloaded. If not, go to your downloads and delete it from there to stop it from download.
    2) Go to the Purchased pane in the main iTunes Store section, locate the item, and try the download again.
    Also, you may wish to turn off any anti-virus or anti-malware programs before you try this again, as that sometimes is what can be blocking the download. Otherwise, contact iTunes Store Support:
    http://www.apple.com/emea/support/itunes/contact.html

  • I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    Hi mafiose15,
    Thanks for visiting Apple Support Communities.
    Restoring your iPod to factory settings is the best way to try and get it back to working order. You can use the instructions below to restore it:
    How to restore iPod
    Verify that you have an active Internet connection, because you may need to download new versions of the iTunes and iPod Software.
    Download and install the latest version of iTunes if necessary.
    Open iTunes. Connect your iPod to your computer using the USB or FireWire cable that came with your iPod.
    After a few moments, your iPod will appear in the Source panel in iTunes.
    Select your iPod in the Source panel. You will see information about your iPod appear in the Summary tab of the main iTunes window.
    Click Restore.
    If you are using a Mac, you will be asked to enter an administrator’s name and password.
    A progress bar will appear on the computer screen, indicating that stage one of the restore process has begun. When this stage is done, iTunes will present one of two messages with instructions specific to the iPod model you are restoring.
    Disconnect iPod and connect it to iPod Power Adapter (typically applies to older iPod models).
    Leave iPod connected to computer to complete restore (typically applies newer iPod models).
    During stage two of the restore process, the iPod displays an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remain connected to the computer or iPod power adapter during this stage.
    Note: The progress bar may be difficult to see, because the backlight on the iPod display may be off.
    After stage two of the restore process is complete, the iTunes Setup Assistant window will appear. It will ask you to name your iPod and choose your syncing preferences, as it did when you connected your iPod for the first time.
    You can find the instructions in this article:
    Restoring iPod to factory settings
    http://support.apple.com/kb/ht1339
    All the best,
    Jeremy

  • How do I restore all of my itunes content onto my newly installed computer drive? All my purchase are no longer in my account but I did back up the files onto an external hard drive. Now how do I get them back? Please

    how do I restore all of my itunes content onto my newly installed computer drive? All my purchase are no longer in my account but I did back up the files onto an external hard drive. Now how do I get them back? Please

    Ummals wrote:
    ...I did back up the files onto an external hard drive. ...
    Did you follow all the steps as detailed here...
    http://support.apple.com/kb/HT1751

  • Itunes error message "file cannot be found..." I know the file is somewhere since I find it when I do a system search and it plays, but can't get itunes to see it.  Any help?

    itunes error message "file cannot be found..." I know the file is somewhere since I find it when I do a system search and it plays, but can't get itunes to see it.  Any help?

    Hello pwithero,
    The following article details the process of indicating to iTunes the correct location for the affected file.
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Cheers,
    Allen

Maybe you are looking for