Jump to content

Help with iTunes script plz


Recommended Posts

I tried to write a simple script for iTunes so that when I run it it will move it to my second monitor and maximize it then play a playlist.

I found and used it for an #include.

#include <iTunesfile.au3>

$Playlist_Name = ("Songs I Like")

Run("C:\Program Files (x86)\iTunes\iTunes.exe")
Sleep(7000)
WinActivate("iTunes")
WinMove("iTunes", "",-1463,26)
WinSetState("iTunes", "", @SW_MAXIMIZE)

_iTunes_PlayList_PlayFirst($Playlist_Name)

The only thing that I can't get to work is to get the Playlist to start.

When I run it I get this error.

Line 97 (File "C:\Program Files (x86)\AutoIt3\Include\iTunesfile.au3"):

$Playlist_Handle.ItemByName($PlayList_Name).PlayFirstTrack

$Playlist_Handle^ ERROR

Error: Variable must be type "Object".

Any help would be greatly appreciated.

Link to comment
Share on other sites

I got it to work with

#include <iTunesfile.au3>

$PlayList_Name = "Songs I like"

Run("C:\Program Files (x86)\iTunes\iTunes.exe")
Sleep(7000)
WinActivate("iTunes")
WinSetState("iTunes", "", @SW_RESTORE)
WinMove("iTunes", "",-1463,26)
WinSetState("iTunes", "", @SW_MAXIMIZE)

_iTunes_Start()

_iTunes_Playlist_PlayFirst($PlayList_Name)

I did need to remove the () but I also needed to add the _iTunes_Start()

Didn't know that it needed it to run the playlist func.

Thanks for the help.

Trying to find things I can use autoit with. Something practical that I could use all the time, just can't think of anything. This itunes script will come in handy though :huh2:

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...