Jump to content

Launch iTunes and start playing Party Shuffle


mashenden
 Share

Recommended Posts

I wanted a shortcut to launch iTunes and start playing Party Shuffle so I could simply click a shortcut on the desktop and walk away knowing it would start reliably.

Then I needed the same type of script again when I wanted to set up a button on my MCE Remote (and my Harmony 890 Pro remote) to automatically and reliably launch iTunes instead of My Music.

I used the following script (compiled) for the shortcut. I also used it with Intelliremote (an awesome program) so that the script would run when a remote button was pressed.

The difficulty was in overcoming the fact that there must be some sort of iTunes timing issue where it does not always catch Send commands that are trying to emulate commands from a keyboard. A loop (the second one) overcame this issue.

It works great for me.

;Launch iTunes and start Party Shuffle, also turn off mute.

;Use iTunes COM 
$objApp = ObjCreate("iTunes.Application")
$colSources = $objApp.Sources
$objSource = $colSources.ItemByName("Library")
$colPlaylists = $objSource.Playlists
$objPlaylist = $colPlaylists.ItemByName("Party Shuffle")
$objPlaylist.PlayFirstTrack()

; Loop to turn off mute and set PC volume to max
For $i = 1 To 25
     Send("{VOLUME_UP}") 
Next

; Loop to get iTunes display to show current song playing
For $i = 1 To 5; 2 worked sometimes, 1 not at all, 3 all the time... why not go with 5
      Send("{ctrldown}" & "l" ) ; this is a lower case L in case the font is not clear
Next

Send("{ctrlup}" )
Edited by mashenden
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...