hitoshi Posted June 22, 2011 Share 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. Link to comment Share on other sites More sharing options...
MrMitchell Posted June 22, 2011 Share Posted June 22, 2011 Remove the parenthesis around ("Songs I Like") and just make the line $Playlist_Name = "Songs I Like" That might help Link to comment Share on other sites More sharing options...
hitoshi Posted June 22, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now