 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Veovis
Joined: 13 Feb 2006 Posts: 390 Location: Utah
|
Posted: Mon Jan 15, 2007 1:21 am Post subject: |
|
|
yeah but if you wanted your script to be closed source you wouldn't post it on the forum, or you would compile it first, so in my opinion anything on the forum is open source, so you can use it as long as you cite your sources _________________
"Power can be given overnight, but responsibility must be taught. Long years go into its making." |
|
| Back to top |
|
 |
Brent Guest
|
Posted: Tue Jan 16, 2007 2:40 pm Post subject: Love it! |
|
|
Very useful  |
|
| Back to top |
|
 |
Rui Martins Guest
|
Posted: Thu Feb 01, 2007 1:15 pm Post subject: Re: maybe... |
|
|
| cooza wrote: | | i bet you could get it to work when minimized or in tray by using part of the previous script. |
Try this one. It works almost every time. It looks for hidden windows, so sometimes it finds itunes 'sidekick' windows, such as itunes remote speakers... instead of itunes main window. I'll look into that later.
Anyway, I mapped win+left to previous song, win+right to next, win+space to play/pause and win+i to launch itunes.
Enjoy
| Code: |
#right::
DetectHiddenWindows, On
;WinGet, active_id, ID, ahk_class iTunes
ControlSend, ahk_parent, {right}, ahk_class iTunes
;MsgBox, The active window's ID is "%active_id%".
DetectHiddenWindows, Off
return
#left::
DetectHiddenWindows, On
ControlSend, ahk_parent, {left}, ahk_class iTunes
DetectHiddenWindows, Off
return
#space::
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, ahk_class iTunes
DetectHiddenWindows, Off
return
#i::
Run %ProgramFiles%\iTunes\iTunes.exe
return
|
|
|
| Back to top |
|
 |
Rui Martins Guest
|
Posted: Thu Feb 01, 2007 8:34 pm Post subject: Re: maybe... |
|
|
Ok, and here you go with a version that works with minimized and 'trayed' iTunes also.
| Code: |
; ############## iTunes ##############
; win+right -> next song
; win+left -> previous song
; win+up -> volume up
; win+down -> volume down
; win+space -> play/pause
; win+i -> play/pause
#right::
DetectHiddenWindows, On
;WinGet, active_id, ID, ahk_class iTunes
ControlSend, ahk_parent, ^{right}, iTunes ahk_class iTunes
;MsgBox, The active window's ID is "%active_id%".
DetectHiddenWindows, Off
return
#left::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{left}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#down::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{down}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#up::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{up}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#space::
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#i::
DetectHiddenWindows, On
IfWinActive, iTunes ahk_class iTunes
WinMinimize
else
Run %ProgramFiles%\iTunes\iTunes.exe
DetectHiddenWindows, Off
return
|
|
|
| Back to top |
|
 |
daorc
Joined: 18 Oct 2006 Posts: 78
|
Posted: Fri Feb 09, 2007 11:05 am Post subject: |
|
|
hey - nice one. Simple but very effective! Cheers  |
|
| Back to top |
|
 |
khimaira
Joined: 07 Jan 2007 Posts: 1
|
Posted: Wed Feb 21, 2007 5:16 pm Post subject: |
|
|
I only recently started getting into AHK, but this is exactly what I've been trying to do. I wonder, is this possible with any app? VLC perhaps?
Thank you, so much. _________________ All your PDA are belong to us |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Apr 25, 2007 8:09 am Post subject: Re: maybe... |
|
|
Excellent. Very well written, I liked it simplicity. Thanks for the script.  |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Thu May 03, 2007 1:33 pm Post subject: |
|
|
There's also a way using COM, which seems to be more reliable and it's the official way to remote control iTunes. Well, I've no script yet:
http://www.autohotkey.com/forum/topic16631-28.html _________________ Tekl |
|
| Back to top |
|
 |
h8cru Guest
|
Posted: Tue May 15, 2007 9:01 pm Post subject: |
|
|
Hi @ all,
I´m a total newbie and have no ideas about scripting...
But I need to control my iTunes with these shortcuts either.
Can someone explain where I have to place the scipt to get these functions?
Thank you very much and sorry4lack of knowledge  |
|
| Back to top |
|
 |
daorc
Joined: 18 Oct 2006 Posts: 78
|
Posted: Wed May 30, 2007 9:36 am Post subject: |
|
|
Hiya h8cru. I assume you have already downloaded AutoHotkey. Just open Notepad, paste the script and save as a .ahk file. Then run the .ahk file whenever you want to use the hotkeys. If you want the script to startup whenever you turn on the computer, put it in your startup folder (C:\Documents and Settings\YOUR_USERNAME\Start Menu\Programs\Startup\).
Daorc  |
|
| Back to top |
|
 |
daorc
Joined: 18 Oct 2006 Posts: 78
|
Posted: Wed May 30, 2007 9:42 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
mm Guest
|
Posted: Fri Jul 27, 2007 9:11 pm Post subject: Re: foobar |
|
|
| Ivan wrote: | | Foobar2000 supports global key shortcuts in case anyone would like to switch to a media player that doesn't suck (on Windows, at least) |
actually global hotkeys are an OS feature on most modern OS !!! |
|
| Back to top |
|
 |
gremmy Guest
|
Posted: Wed Aug 08, 2007 8:24 pm Post subject: |
|
|
| Can you make it select the text already in the iTunes library search box? Just a suggestion that eliminates the need to deletes whats already there. |
|
| Back to top |
|
 |
daorc
Joined: 18 Oct 2006 Posts: 78
|
Posted: Wed Aug 08, 2007 9:56 pm Post subject: |
|
|
I didn't include this in my version because by doing so it would clear the search that is already playing (e.g. if I am listening to a particular band by having that band's name in the searchbox, and don't want to expand the currently list to include all of my music). If you want to change that, you can either:
press excape after pressing Win+i (this blanks the searchbox)
or
add a "controlsend" command to send the escape key just after giving the focus to the searchbox.
Daorc  |
|
| Back to top |
|
 |
Gremmy Guest
|
Posted: Tue Aug 14, 2007 5:08 pm Post subject: |
|
|
That works well enough.
good script |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|