Hi all,
I’ve tweaked the previous script to add the following:
Win+i now activates the search control so you can search straight away
Enter (when inside the search control) will start the songs playing that fit your search criteria and then minimise iTunes.
So now, using the following will play all the songs from your favourite band:
Win+i
Type “my favourite band”
Enter
Fast, easy and simple! (I hope). Let me know how it works out ...
Code:
; ############## iTunes ##############
; win+right -> next song
; win+left -> previous song
; win+up -> volume up
; win+down -> volume down
; win+space -> play/pause
; win+i -> run
; enter (inside iTunes search control) -> play + minimise iTunes
DetectHiddenWindows, On
#right::
ControlSend, ahk_parent, ^{right}, iTunes ahk_class iTunes
return
#left::
ControlSend, ahk_parent, ^{left}, iTunes ahk_class iTunes
return
#down::
ControlSend, ahk_parent, ^{down}, iTunes ahk_class iTunes
return
#up::
ControlSend, ahk_parent, ^{up}, iTunes ahk_class iTunes
return
#space::
ControlSend, ahk_parent, {space}, iTunes ahk_class iTunes
return
#i::
IfWinExist,ahk_class iTunes
{
winset,top
winactivate
controlclick,Edit1,iTunes ahk_class iTunes ;activate the "search" control
controlfocus,Edit1,iTunes ahk_class iTunes ;activate the "search" control
}
else
Run %ProgramFiles%\iTunes\iTunes.exe
return
#IfWinActive,iTunes ahk_class iTunes
~enter::
ControlGetFocus,focus_control,iTunes ahk_class iTunes
if focus_control=Edit1
{
PixelGetColor,playpause,82,39 ;detect pixel colour of the play/pause/stop button
sleep 100 ;before winminimise - stops "enter" being relayed to the next down window
winminimize
if playpause in 0x212122,0x1B1B1C ;playing
{
ControlSend, ahk_parent, {space}{space} ;send "play/pause" hotkey twice (pause+play)
return
}
if playpause=0xF4F5F5 ;paused or stopped
{
ControlSend, ahk_parent, {space} ;send "play/pause" hotkey once (play)
return
}
}
return
#IfWinActive
Daorc
