AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

iTunes Play Status

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Muzzi



Joined: 15 Jun 2008
Posts: 65
Location: east coast of Australia

PostPosted: Fri Jul 04, 2008 5:09 am    Post subject: iTunes Play Status Reply with quote

Is there a way to identify the iTunes playing status?

I am guessing something along the lines of like...

Code:
; current play status (0=Pause/Stopped, 1=Playing)

If( iTunesPlayStatus == 0 ) ; iTunes not playing
{
   ControlSend, ahk_parent, {space}  ; Play
}
else
{
   ControlSend, ahk_parent, {space}  ; Pause/Unpause
}
return



Any ideas?
_________________
̊˳ɱטᶚᶚї˳̊
Back to top
View user's profile Send private message
John W



Joined: 09 Apr 2007
Posts: 169

PostPosted: Fri Jul 04, 2008 12:34 pm    Post subject: Reply with quote

Try the Spy in the installation directory of AHK. Maybe there is a difference between playing and not playing in the output. Then you can compare.
_________________
John
Inactive - Until AutoHotkey is available for Linux.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1323

PostPosted: Fri Jul 04, 2008 1:40 pm    Post subject: Reply with quote

I once wrote a script to a request of a member. I don't know if it'll work or not as I don't use iTunes, however, here it is anyway.
Code:
COM_Init()
piT := COM_CreateObject("iTunes.Application")
; pevent := COM_ConnectObject(piT, "iTunes_")
MsgBox % ITPlayerState := COM_Invoke(piT, "PlayerState")
/*
ITPlayerStateStopped   = 0
ITPlayerStatePlaying   = 1
ITPlayerStateFastForward= 2
ITPlayerStateRewind   = 3
*/

; COM_Release(pevent)
COM_Release(piT)
COM_Term()
Return

iTunes_OnPlayerStopEvent(prms)
{
   MsgBox % "The stopped track number: " . COM_DispGetParam(prms)
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group