# Add files to iTunes from Terminal?



## MacDaddy (Jul 16, 2001)

Is there a way that I can use the terminal to take files on the hard drive and add them to the iTunes Library?

I tend to purchase music on iTunes from my computer downstairs, but my server that I stream my music from is upstairs, so I always transfer it up then have to go upstairs to add it into iTunes to listen to it (I don't keep the files downstairs, its my work machine, no music in iTunes at all)

Anybody know if I can do this?


----------



## Chealion (Jan 16, 2001)

You could try recording an AppleScript that grabs every file in a specific folder and imports it into iTunes. You can then run the AppleScript through the command line. Sorry this isn't anything completely specific in step by step or HOWTO form.


----------



## PosterBoy (Jan 22, 2002)

You could also use a VNC solution to control the machine upstairs remotely. I do this all the time, it's very handy.


----------



## MacGenius (Nov 13, 2001)

Its very simple:


```
/usr/bin/open -a /Applications/iTunes.app /path/to/files
```
This tells iTunes to open the file(s) in question.

Anything else?

MacGenius


----------



## MacDaddy (Jul 16, 2001)

MacGenius, 
that is awesome, thank you! I will try it on Monday when I get back to town!
Now, if I SSH into the computer upstairs, once I am in, I just put that code in, or would I have to do something else beforehand?

thanX


----------



## virtualien (Dec 2, 2011)

*still works*



MacGenius said:


> ```
> /usr/bin/open -a /Applications/iTunes.app /path/to/files
> ```


this is still valuable information, thanks.

Needed to add a bunch of .mp3 files via afp, this way it stressed the system much less than adding them by the iTunes GUI.


----------



## Andrew Pratt (Feb 16, 2007)

The way I do it is simply copy any file I want loaded into our master iTunes library to the "automatically add to itunes" folder on that remote machine in Finder...i'm sure you can do it via terminal as well if you like but its dead easy in Finder.

iTunes 9: Understanding the "Automatically Add to iTunes" folder.


----------

