simplest programming question ever

Discussion in 'Mac Programming' started by harleytat, Jan 29, 2006.

  1. macrumors newbie

    Joined:
    Jul 22, 2002
    Messages:
    12
    #1
    I'm looking to make a script/droplet that, when a file is dropped on it, copies that file to my itunes library and then deletes the original file in the finder. I thought this would be easy to do with automator, but it looks like the "add files to playlist" action passes the resulting itunes song to the next action, making it impossible to modify (delete) the original file.

    I'm sure this can be done with applescript in 2 1/2 seconds, but I'm a dunce. any thoughts?

    thanks!
    H
     
  2. Moderator emeritus

    Joined:
    Jun 25, 2002
    Messages:
    13,951
    Location:
    Gone but not forgotten.
    #2
    Use AppleScript to:
    • open iTunes
    • pass the file to iTunes
    • close iTunes
    • delete the original file

    Copying it to the library is truly difficult, if iTunes is managing your library. You must know in which album a song belongs and to which artist so that you can create folders or at least, find those folders. Getting that information from the ID3 tags, if present, would be difficult.
     
  3. Wes
    macrumors 68020

    Wes

    Joined:
    Jun 22, 2001
    Messages:
    2,223
    Location:
    London
    #3
    This appears to work. It works on the premise that, in the period between when you pass the song to iTunes and it completes adding the song to the library, you haven't changed the selected file in the finder.

    Hope this helps,

    Wes
     

    Attached Files:

  4. macrumors newbie

    Joined:
    Jul 22, 2002
    Messages:
    12
    #4
    oh yes

    wes, thank you. step 3 was what I was missing. glad to know this can be done so easily. I will now spend my days dragging and dropping to my heart's content...
     

Share This Page