Sign in to follow this  
Followers 0
hitoshi

Help with iTunes script plz

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



Remove the parenthesis around

("Songs I Like")

and just make the line

$Playlist_Name = "Songs I Like"

That might help :huh2:

Share this post


Link to post
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:

Share this post


Link to post
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
Sign in to follow this  
Followers 0