Applescript for replacing Original Files with aliases from an Organized Library.

Hi, all I am new to Applescript and the support community. I am working on developing a script that takes a folder and replaces its original music content with aliases from an organized Library. Let me explain a little better.. I have a list of project folders that all contain folders and original music. My company uses iTunes to store and organize their music. Once iTunes has imported the music and has made a copy of the original file and organizes it accordingly we create an alias within the iTunes Library and manually drag and drop the aliases into our Project folders. I have a Script that reverts the aliases with the orginal file and the coding is
Code starts here---
set f to choose folder
ProcessAlias(f as string)
-- replacess all alias files in the passed folder path (string)
on ProcessAlias(this_folder)
-- get list of folders in this_folder
set utid to AppleScript's text item delimiters -- store old delimiters
set AppleScript's text item delimiters to {return}
tell application "Finder"
set folder_listing to every folder of folder this_folder as string
end tell
set AppleScript's text item delimiters to utid -- restore old delimiters
if folder_listing is "" then
set folder_list to {}
else
set folder_list to paragraphs of folder_listing
end if
-- process folder_list
repeat with sub_folder in folder_list
ProcessAlias(sub_folder) -- send each folder back to this subroutine
end repeat
-- get list of alias files and process them
tell application "Finder"
set alias_files to every file of folder this_folder whose kind is "Alias"
repeat with this_alias in alias_files
try -- error if broken alias
set orig_item to original item of this_alias
set item_dest to container of this_alias
move orig_item to item_dest with replacing
end try
end repeat
end tell
return -- you can return a listing of moved originals if you want
end ProcessAlias
Basically I need the revers of this process. The objective is to save space and continue to let iTunes organize and copy files for us. I already have made a script that generates aliases into the subfolders of iTunes organized Library withour replacing the file that iTunes created. I also made a script that takes the itunes library and dumps all the aliases into a designated folder. I thought this may be helpful for drawing aliases to files that are in our project folder but seem to be stuck.
I was thinking maybe if I took my iTunes and made all the aliases all into one folder to draw aliases from would make it easier. I'm not sure but it seems like there should be some easy way of doing this. Any suggestions would be greatly appreciated.

Also Script above is for reverting aliases into original files as posted by Eatalay of this forum.

Similar Messages

  • Looking for help for sharing pdf files with ipad from mac.  Pages only recognizes text.  What app should I use for file sharing pdf documents?

    Looking for advice on how to share pdf files with iPad from Mac.   Pages seems to only recognize text.   What app is recommended for pdf documents?

    Welcome to Apple Support Communities!
    If I understand your question, you want to read pdfs on your iPad, not create or edit.
    Drag pdf files to the iPad icon in Finder while connected to your computer via the USB cable.
    They will show up in the iBooks application
    (If you don't already have iBooks, it's a free download from the App Store.)
    Once installed, there are two buttons at the top left of the Bookshelf.
    One is Books, the other is Collections.
    Tap Collections, and you'll see Books and PDFs.
    Tap PDFs and you're there.

  • How do you fix error message "data rate for this file is too high for DVD.  You must replace this file with one of a lower data rate".

    When trying to burn a DVD it will go through the encoding step and at 98% we see the message 'data rate for this file is too high for DVD.  You must replace this file with one of a lower data rate".  We need help to correct this so we can complete burning to DVD. 

    What did you export from Premiere?
    Did you use the MPEG2-DVD preset... and did you make any changes to the preset?
    CS5-thru-CC PPro/Encore tutorial list http://forums.adobe.com/thread/1448923 may help

  • How to maintain keywords for a original files in DMS?

    Hi,
    How to maintain a Keywords for all original files which are already available in content server? I have done the following steps for full-text search(content search) with in originals.
    1.Configured RFC from TREX to R/3
    2.Created SSR with VERITY search engine
    3.Configured MIME types in DMS
    4.Indexing has been done
    5.We ran RSTIRIDX program as a background job.
    After doing above all for activating full text search in CV04N,  The text box search text is enabled, how ever when we try to search for a text in original we are getting the message:"No documents found with these selected parameters".
    Awaiting for your valuable response.
    Thanks
    Prasad

    Hi Prasad,
    could you please test the search behavior also in transaction SKPR07 because this transaction offers different tools for testing and analysing the TREX search. The class for DMS is DMS_PCD1.
    Best regards,
    Christoph

  • Report for replacement stock to be recived from vendor

    Hi
    I HAVE ONE ISSUE ON ABOUT VENDOR REPLACEMENT STOCK REPORT
    EX:.. i have done GR for material-A qty 100...and ihave done MIRO for this ..pur.order..
    after 20 days i have return the materai-A ..qty 25..(without cancel the MIRO) with movement tuype 122..but this material should be return from vedor.(subsequent deliver).after some days or weeks ..( bcoz money has already paid to vendor)...like this we many materials ..
    for this... i want report for replacement material will be recived from vendor
    regards
    sesidhar

    Hi
    already i have done MIRO..
    then return to vendor qty 25..(through MIRO...w/o creadit memo
    thne again recive the replacement material ..through MIGO (subsequent delivery)
    in this case ..need to create credit memo..?
    if yes.. pls...send me procedure.
    regards
    sesidhar

  • Is it possible to pay for iCloud storage plan with money from iTunes?

    Is it possible to pay for iCloud storage plan with money from iTunes?

    Hey LARISAFROMTX,
    Thanks for the question. Yes, you can use iTunes Store credit to pay for an iCloud storage upgrade:
    Accepted payment methods for iCloud storage upgrades include credit cards, debit cards, and iTunes Store credit. If you don't have enough iTunes store credit to complete your upgrade, you'll be charged the remaining amount. Apple Store gift cards are not accepted as payment for upgrading iCloud storage.
    Learn how to upgrade or downgrade your storage and manage the amount of storage you're using.
    iCloud: Storage upgrade pricing
    http://support.apple.com/kb/HT5879
    Thanks,
    Matt M.

  • Hi, I have a version of CS4 on my Mac.  I can not longer open Raw files with it from my Canon 5D.   I never had problems with it in the past.  What can I do?

    Hi, I have a version of CS4 on my Mac.  I can not longer open Raw files with it from my Canon 5D.   I never had problems with it in the past.  What can I do?

    is that the eos 5d?
    if so, you only need cr 3.3 or greater.  what version do you have in your cs4? (help>about plugins>camera raw)
    if you need to update it, http://www.adobe.com/downloads/updates/

  • I'm trying to sync my iPhone 5 with music from my iTunes library!

    I'm trying to sync my iPhone 5 with music from my iTunes library and when i click "sync selected playlists" it tells me i have 501 songs when i know those playlists only contain 120 max! When i untick the playlists the number of songs doesn't change. Nor does it change when i re click the playlists i want! Surely if i do not tick any playlists i'm choosing not to sync any songs? My 16GB phone keeps telling me my interal storage is full. I seem to constantly be backing up and then deleting photos to make room. I have 5.02 GB take up by "other" can anyone tell me what this is? TIA

    Hi Rennagade,
    If you are repeatedly prompted to authorize your computer in iTunes, even after you have already done so, you may want to try the troubleshooting steps outlined in the following article:
    Apple Support: iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Regards,
    - Brenden

  • Less destructive fix for the "original file could not be found" issue

    +(Note: this is mostly a copy of the post I just submitted in reply to http://discussions.apple.com/message.jspa?messageID=6785594#6785594)+
    Most solutions to the "The song xxx could not be used because the original file could not be found. Would you like to locate it?" issue involve deleting iTunes library files, deleting-then-re-importing everything from iTunes, and other destructive techniques. I found an easier fix for this, but it might be (a) specific to libraries on a network drive (NAS) or (b) specific to me. YMMV, but give it a try. This was on a Mac, so a Windows solution might exist with the same technique. Please post here and let me know if this works for you!
    After some investigating and trial-and-error, I discovered that if I viewed a list of songs in Finder, iTunes could find the files again. For example:
    *Double click on a song in iTunes and get the "original file could not be found..." error. Do not say 'Yes' to locating it.
    *Open Finder and locate that Folder of songs
    *Double-click on another song from that album. It should work.
    So, my fix: *run a command that lists/touches every file in your iTunes music folder.*
    For Macs:
    *Open Terminal
    *Run this: *ls -R /Path/To/Your/iTunes\ Music \Folder/* (note how you 'escape' spaces in the folder name with back-slashes).
    Windows:
    *Start - Run - cmd
    *Run this: dir /s \Path\To\Your\"iTunes Music Folder" (note that you escape spaces by quoting the dir name.)
    My NAS is named "VAULT" so my command was "ls -R /Volumes/VAULT/My\ Music/" You will see the files being listed at light speed -- ignore this. It will run for a while, depending on how many files you have, about 30 seconds for me. After executing this I could listen to any music file in iTunes!
    But, every time I lost my connection to my NAS, such as waking from sleep mode, I had to run it again. So I created an Automator application and a Apple Script to run it from within iTunes so I can run it any time I need to. If you don't want to do that, just run the command I specified. If you want to download my Automator app, or see instructions on how to create your own, check out my blog post: http://40withegg.com/2008/3/8/mac-attack-making-itunes-find-those-original-files -especially-on-a-nas
    With any luck, my post will be *completely unnecessary* soon because Apple will find a real solution to this.

    Jeffe hello,
    I have seen more problems created by the consolidate command than I have ever seen fix things... I'm not saying it does not work but what it does do and what it does not is very hard to work out for most and major problems are the result...
    to sort your problem do this...
    1. Open your iTunes folder in the Home Music folder and make a backup copy of the iTunes Library file and put on the desktop.
    2. Start iTunes and in the Library sort on the Heading 'Date added' ... you may need to install it... control/click on heading-bar and select from popup menu.
    3. When you have sorted scroll to half way and you will see the songs are split evenly... select the ones you want to remove with a shift/click and hit delete key... say no about move to trash for now.
    4. Check that everything is as you want it... if so carry on... if not come back and tell me what happened.
    5. Quit iTunes and put the iTunes Library file in the iTunes folder in a safe place like your Documents folder... drag the copy from desktop and put it in the iTunes folder.
    6. Check the name is correct on the 'copy' edit it to be iTunes Library.
    7. Start iTunes by double/clicking on the file and go through steps 2 & 3 again but this time when you delete say yes about move to trash... don't empty it yet 1st check that all is OK with your library.
    You can edit the good files that you are left with but the addition of '01' in the name will not have any adverse effect on them at all... editing with an Applescript is very easy.
    take care Jeffe and let's know how you get on or if you run into any unforeseen problems ... TP

  • Best practice for handling original files once movie is complete?

    So I'm taking movies from my Canon S5IS (and other cameras in the past) and making projects in iMovie, sharing in the Media Browser, importing into iDVD, and burning to DVD.
    I can't help but wonder if I might need the original footage one day. Do most people keep their original files for future media (replacement for DVD) which I realize would require recreation of the movies that were created in 2008 with iMovie (with title screens, transitions, etc.)? Or do most people delete the originals with the feeling that DVD will be a suitable way to watch home movies for the foreseeable future?
    I just can't figure out what to do. I don't want to burn dozens of DVDs of raw footage, only to have keep up with them in a safe deposit box and have to deal with the anxiety of having to recreate movies one day (which is daunting enough now...unbelievably daunting to think about the exponential growth as time progresses).
    Hope this make sense. Reading that DVD movies are not suitable for editing due to the codec has made me realize I need to think through this before destroying all these originals as I'm finished with them.
    Thanks in advance!
    -John

    If any of your cams are miniDV, then you simply need to keep the original tapes and tape is still the safest long term archiving solution, when stored properly.
    Other cams that use flash memory, hard drives, even DVD cams, do not offer the security that tape does. If you are wanting to save those types of files, the best option would be to store them on one or two external hard drives, bearing in mind those drives could fail anytime. Back up to your back up in that case.
    Another nice thing about miniDV cams is that you can export your finished movie back to a tape also, using iMovie HD6, and have safe copies of original and finished material.
    Message was edited by: Forest Mccready

  • Automation challenge : Replace RAW files with JPGs

    Hi,
    I have a lot of RAW files in my library that for sure will not be edited any further. Since they start to fill up a serious amount of disc space (12 Mb per NEF from my D300, I use referenced files only) I am looking for a way to 'archive' these pictures : I want to replace the original NEFs with a JPG version and delete the original NEF, while keeping them accessible from Aperture.
    Is there any way to automate this easily, resulting in a situation where I can apply this to a set of selected pictures?

    There is really no way to do exactly what you are asking but that is one of the purposes of previews - If you use move masters to put your masters on another HD for archiving you will still have all of the previews (assuming they are generated, if not use generate previews) and you can do most of the thing you may want to do with the exception of adjustments and a couple other things related to having the master available.
    RB

  • Can you auto replace eps files with tiff files

    Hello
    We have a document that has been supplied to u with 3000 images in it. The original positional files were eps files but the final high res files will be tiff's. Is there a way to find and replace the eps files with the tiff files?
    Many thanks
    Beefcake3

    Are you using CS3 or CS4?
    With CS3 you might be able to use the LinkOptimizer that you can buy from here http://zevrix.com/linkoptimizer.php
    With CS4 you can swap out a bunch of files for another bunch in another folder - http://indesignsecrets.com/relink-from-one-image-file-type-to-another.php
    Are you sure the EPS are just raster images? If there are any text, vectors etc. they will be converted to raster elements when saving to a tiff.
    Perhaps a PDF would be better if you don't like EPS?

  • Creating aliases on a smb volume for 10.5 and using aliase from 10.5 in 10.7

    We are accessing a Windows File Server (SMB (NTFS)) with some Mac Pro's using Leopard and some Mac's with Lion. Aliase created with Leopard and older Mac OS Versions can not be used with Lion. Aliase created with Lion can not be used with Leopard. Clicking at the aliases from the other Mac OS version will open the Terminal, but not open the original file or folder.
    Leopard creates two files, for example myAliase and ._myAliase. The invisible file contains the data.
    Lion creates only one file myAliase with the data.
    How can we use and create the old styled aliases from older Mac OS Versions?

    Ramón G Castañeda wrote:
    …My question is:  can you actually run Mac OS X 10.5 on a PC box just like that, so there's no need to actually buy a Mac-Intel machine from Apple?
    OK, so the answer to my own question is "not 'just like that'" and "not legally".  I was not aware of current advances in the ease of building a Hackintosh, which I confess had not even crossed my mind when I first posted my question. 

  • Applescript for matching two files creation date

    Hello,
    I reopen here a question that I posted on another forum (macrumors):
    I have converted almost 1,000 video files from MPG1 to MOV in order importing them to Final Cut Pro (FCP can't import directly MPG1!).
    So I have TWO folders:
    Folder 1 with the original VideoXXXX.mpg1 files
    Folder 2 the converted VideoXXXX.mov files.
    The file names on both folders are the same. And the number of files in the two folders are the same.
    My problem is that the creation date of files in the Folder 2 is the "conversion" time (July 2012) instead the original creation time (from 2005 to 2010).
    When imported to FCP, I need the creation time. The name doesn't include the time, so I don't know the file date looking only at the file name.
    I need an Apple Script for changing the creation date to the files in Folder 2 files matching the creation date on the Folder 1 files.
    - For file n on Folder 1, take name and creation date
    - Look for the same file name on Folder 2
    - Set creation date of file on Folder 2 to Creation date of original file
    I have seen that it can be made with the "touch" command, but I'm new to applescripting and any help would be very appreciated!!
    Thanks

    Wooow...
    How many helping responses! Thanks to you all.
    I am trying the first sugested solution.
    I have tried adding "file" to theOriginalFile twtwtw script.
    (name of file theOriginalFile)
    But the error persists (I changed -5 to -4, as the extension is only MPG)
    tell application "System Events"
      get POSIX path of every file of folder "HD Mac:users:fhuet:Desktop:Vid1" whose name extension = "MPG"
      --> {"/Users/fhuet/Desktop/Vid1/MOV04859.MPG", "/Users/fhuet/Desktop/Vid1/MOV04860.MPG", "/Users/fhuet/Desktop/Vid1/MOV04882.MPG", "/Users/fhuet/Desktop/Vid1/MOV04905.MPG", "/Users/fhuet/Desktop/Vid1/MOV04906.MPG"}
      get creation date of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> date "viernes, 31 de diciembre de 2004 23:39:00"
      get text 1 thru -4 of name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> error number -1720 from text 1 thru -4 of name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
    Resultado:
    error "System Events ha detectado un error: Espectro no válido." number -1720 from text 1 thru -4 of name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
    If I do
    set strippedFileName to name of file theOriginalFile
    I got:
    tell application "System Events"
      get POSIX path of every file of folder "HD Mac:users:fhuet:Desktop:Vid1" whose name extension = "MPG"
      --> {"/Users/fhuet/Desktop/Vid1/MOV04859.MPG", "/Users/fhuet/Desktop/Vid1/MOV04860.MPG", "/Users/fhuet/Desktop/Vid1/MOV04882.MPG", "/Users/fhuet/Desktop/Vid1/MOV04905.MPG", "/Users/fhuet/Desktop/Vid1/MOV04906.MPG"}
      get creation date of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> date "viernes, 31 de diciembre de 2004 23:39:00"
      get name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> "MOV04859.MPG"
    So it's OK. After that, obviously, it gives another error.
    So, the problem is with the instruction
    set strippedFileName to text 1 thru -4 of (name of file theOriginalFile). There must be a sintaxis error on that. It says "ESPECTRO NO VALIDO" ERROR
    I keep trying and will try the other options.
    But I'd like to test all of them, as it's the best way to well understand and study the lenguage.
    Thanks again.

  • AppleScript open and save file with Numbers

    Hi all,
    I need to save an Excel .xls file as an .xls file in order to break the links that are included in the original Excel file. Since Numbers doesn't have any actions for Automator, I hoped someone could help me writing an AppleScript?
    It needs to open (Numbers) and all the .xls files that are added to a specific folder on my Mac, then save them to another folder as .xls (not .xlsx) and overwrite any existing files with same name. Since this all should work automatically, warnings and pop-ups that need a user to click an option are not allowed.
    Didn't think this could be too hard, but I'm just a noob when it comes to AppleScript. Help?
    Thanks in advance

    Check the attributes of the <textarea> tag. You can use wrap="no" or wrap="virtual" or wrap="hard" to define how the text area handles carriage returns.
    Brian

Maybe you are looking for

  • TS2313 error message downloading podcasts in itunes

    Whenever I try to download podcast episodes from iTunes I get an error message that reads: "There was a problem downloading <podcast>.  The file directory is corrupted or unreadable."  I don't understand this, because it happens with all of my podcas

  • Device not seen in itunes after data transfer

    I bought an original MacBookPro from my daughter & transferred all my data from PB G4 to MBP. Everything works just fine, except itunes does not see my ipod touch. I cannot figure out how to get it "recognized" as a device? Any suggestions?

  • Does the iphone 4s browser mess up

    does the iphone 4S browser messs up? cause im on facebook on browser and my notifications and messages arent even showing up, and every time i try to login in it takes me back to the login menu?? is that normal or no for the iphone 4S to do that??

  • Need clarification on OPEN DATABASE options

    Hello all: After a smooth restore/recover of a closed, consistent backup (NOARCHIVELOG mode), what are the options and ramifications for (NO)RESETLOGS? RMAN reports ORA-01589 if only OPEN DATABASE cmd used, and it appears that NORESETLOGS is not vali

  • IWeb Displays Images Different! HELP!!!

    I am a photographer, and I put my best photos on my iWeb site. My photos are all normal, but when I view them after uploading onto the internet (on several different computer screens) all my photos have been automatically enhanced (more contrast, boo