Music Powershell

I realized lately that one thing I do every day before I leave the office is to ensure that my iPod has been sync’d recently.  It’s a major bummer to get into the car only to realize that the latest “The Guild” or “Totally Rad Show” is sitting on my computer and completely inaccessible during the long drive home.

I decided to create a scheduled task which will sync my iPod around 3:50 PM, so it’ll be ready to go when I am.  These instructions were made on a Windows XP box, the same thing applies on Vista but the steps to do it will be slightly different.  Here’s how you do it:

  1. Go to your Control Panel, Scheduled Tasks, then click on Add Scheduled Task.
    image
  2. Click Next, then Browse.
    image
  3. imageType this into the Open File dialog box and hit enter:
    %windir%\system32\windowspowershell\v1.0\powershell.exe
  4. Name the task “Sync iPod” or something like that, choose an interval (such as daily) and hit Next.
     
  5. Choose a time of day for the task to execute, and hit Next.
  6. Supply your credentials so that the task can run even when you are not logged in but your PC is on.
  7. Check the box labelled “Open Advaned Properties” and then Finish.
  8. imageClick in the Run field and hit the End key.  You should see “powershell.exe” then your cursor.  Hit the space bar, then paste in the following text, all on one line:

    -noprofile -command &{ write-host ‘Synchronizing iPod’; (New-Object -ComObject iTunes.application).UpdateIPod(); write-host ‘Sync complete!’; start-sleep 5 }

  9. Finally, click Ok. 

 

 

image

 

Now, assuming your iPod was already plugged in and iTunes is running, your iPod is not syncing at the moment.  If it is, wait till its finished so that you can test the task.  If you didn’t forsee the above, go ahead and do that; we’ll all wait for you.

And we’re back.  Now simply go the Scheduled Tasks control panel applet again, right-click on the new task and choose Run.  Within a few moments you should see that iTunes has started synchronizing.  If it does not work for you, please leave a comment and hopefully we can figure it out.

: http://halr9000.com/article/480

2008-05-20 08:13:45

Thanks of the solution. No more forgetting to load my daily podcasts.

Misha
2010-01-14 21:22:37

Any way to do this on a mac?

2010-01-15 09:29:28

I would hope so, but no idea, I’m not a Mac guy. I hear there is a scripting language over there called applescript. Start googling!

Misha
2010-01-15 12:46:41

I figured it out, thanks.
For other Mac users out there, here’s a simple script you can run from iCal:

tell application “iTunes”
set my_iPod to some source whose name is “Doug’s iPod”
update my_iPod
end tell

from:
http://dougscripts.com/itunes/itinfo/info03.php

Drew
2010-01-17 23:06:49

Your solution worked great for me for over a year. That was until last week when my wife bought an ipod. This solution will only sync the first ipod that was plugged in. Here is the new script to sync both.

-noprofile -command Use it the same as before. The source Item 3 & 4 are the ipods on my system. 1 was the library, 2 was radio. I’m not sure, but these numbers may been to be changed for other systems.

Other than that, thanks again. this is the simpliest soluction that I’ve seen.

Drew
2010-01-17 23:08:50

ok, that didn’t take right. Replace the XXX with a single AND symbol like the orginal.

-noprofile -command XXX{ write-host ‘Synchronizing iPod’; $itunes = new-object -comobject itunes.application; $sources = $itunes.sources; $sources.item(3).updateipod(); write-host ‘Synchronizing iPod 2’; $sources.item(4).updateipod(); write-host ‘Sync complete!’; start-sleep 5}

2010-01-18 09:03:11

thanks for posting this Drew!

jacberg
2010-02-23 23:51:32

Thanks! it worked smoothly for a single device, but when I tried doing two iTouches at a time with the instroctions you posted I had no luck there.. I’m wondering if there is any way to find the source number of my devices.. or will they always be source 3 and 4?? also, I’m planning on using this script with more than two devices at a time (like 8-10 together) is there a way to add that many devices in the script?? or to tell the script to sync any source it finds?? Thanks a lot.

jacberg
2010-02-11 17:41:16

thanks! it worked smoothly for a single device, but when I tried doing two iTouches at a time with the instroctions you posted I had no luck there.. I’m wondering if there is any way to find the source number of my devices.. or will they always be source 3 and 4?? also, I’m planning on using this script with more than two devices at a time (like 8-10 together) is there a way to add that many devices in the script?? or to tell the script to sync any source it finds?? Thanks a lot.

  • Microblog

  • Recent Posts

  • Recent Comments

  • meta

  • PowerShell Blogroll