Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript to copy iTunes songs to an archive server Apps
In my search for a solution to this problem, I have found that many other people find themselves in similar situations. Here's a basic statement of the problem:
  • I have a laptop that I use at home but often take with me
  • I have a desktop at home with much more storage space than my laptop
  • I want to maintain all of my music on my desktop, but keep a subset on my laptop for playing when I'm not on my home wi-fi network.
Add to that my additional needs that...
  • I don't even have a monitor, mouse or keyboard connected to my desktop machine
  • And therefore, I want to control adding music to my library completely from my laptop
The best solution that I was able to find from searching the net was this one. This guy has his laptop using an iTunes library on a shared network drive on his server. Then, when he leaves the home network, he has a script to switch to a local library. The worst thing about that setup is that it could be complicated to add songs from your network server to your local library before disconnecting.

My solution is to add new songs to my local library, and then when I tire of them or need to free up some disk space, I send them to my shared library on the server. This way, I always have my newest music on my laptop, but if I want to listen to some older songs while I'm at home, I can connect to the shared network library inside iTunes. The trick to my solution is how I send the songs to the shared library, hence the title of this post.

I have written an AppleScript that will:
  1. Take the tracks I have selected in iTunes
  2. If any album art has been downloaded from the iTunes Store, and is therefore not embedded in the song file, embed album art into the song file
  3. Copy the files to a staging directory on the network server
  4. ssh to the network server and run an Automator script that will:
    1. Take all the files in the staging directory
    2. Add them to the iTunes Library, which copies the files
    3. Delete the files from the staging directory
Download script: Copy Songs To Archive Server.scpt [macosxhints mirror]

Download workflow: AddFilesToITunes.workflow.zip [macosxhints mirror]

More about the script and workflow available in this post on my blog.

[robg adds: I haven't tested this one.]
    •    
  • Currently 2.00 / 5
  You rated: 3 / 5 (4 votes cast)
 
[19,743 views]  

An AppleScript to copy iTunes songs to an archive server | 4 comments | Create New Account
Click here to return to the 'An AppleScript to copy iTunes songs to an archive server' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to copy iTunes songs to an archive server
Authored by: ibnabouna on Jun 06, '07 05:44:39PM

All right, but what if you want to bring songs back from the network drive onto your laptop?



[ Reply to This | # ]
An AppleScript to copy iTunes songs to an archive server
Authored by: rasman1978 on Jun 07, '07 03:19:17AM

Well, the simple answer is that you, from the laptop, browse the network drive in Finder, locate the song files, and drag them into your iTunes library (which will copy them to your local hard drive).



[ Reply to This | # ]
An AppleScript to copy iTunes songs to an archive server
Authored by: windrag on Nov 04, '07 11:52:28PM

I tried these scripts, and they appeared to work great–iTunes opened up on the server, the songs showed up in a new playlist. However, when I do a cmd+R on the server machine, the files appear in the trash. Browsing to the iTunes Music folder shows that the files do not reside in the folder (the Artist and Album folders do exist).

I double-checked that my preferences are indeed set to Copy files into the iTunes Music folder, and the music drive is set to ignore permissions. The iTunes Music folder resides on a FireWire drive connected to the server Mac.

Any ideas?

---
windrag | 700MHz iBook 16 VRAM G3 | Seagate 80GB HD | 640MB RAM | OS X 10.4.8



[ Reply to This | # ]
An AppleScript to copy iTunes songs to an archive server
Authored by: windrag on Nov 08, '07 07:51:42PM

I figured out the problem I was having. I opened the Workflow and looked at all of the options listed. In Step 4 (Get Specified Finder Items) there are Files/Folder options. I changed this from Use Results from Previous Action to Ignore Results fro Previous Action, and then resaved the workflow as an application. Then everything worked as described.

---
windrag | 2.4GHz MacBook Pro Core 2 Duo | 160GB HD | 2GB RAM | OS X 10.4.10



[ Reply to This | # ]