hitoshi 0 Posted June 22, 2011 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^ ERRORError: Variable must be type "Object".Any help would be greatly appreciated. Share this post Link to post Share on other sites
MrMitchell 16 Posted June 22, 2011 Remove the parenthesis around ("Songs I Like") and just make the line $Playlist_Name = "Songs I Like" That might help Share this post Link to post Share on other sites
hitoshi 0 Posted June 22, 2011 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 Share this post Link to post Share on other sites