AutoHotkey Community

It is currently May 24th, 2012, 2:24 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 81 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: October 7th, 2005, 12:33 pm 
Offline

Joined: October 7th, 2005, 11:47 am
Posts: 1
Just a little script for controlling iTunes from any window using keyboard shortcuts. Feel free to change them to your liking, of course. Changed it to use winkey[#]. You could change it to ctrl[^] or ctrl-alt[^!] or ctrl-shift[^+],etc. . Man, I love AutoHotkey.

Let me know of any problems or ideas. I am just getting aquainted with an app called 'Winspector Spy', mentioned somewhere in these here forums.


Hotkey List
--------------------------

winkey + \ = launch iTunes or hide/show
winkey + . = next song
winkey + , = previous song
winkey + / = play/pause toggle
winkey + ; = volume up
winkey + ' = volume down
winkey + = = preview song every 10 sec
winkey + - = stop preview mode

--------------------------

Peace, Dave


Code:
; iTunes Anywhere
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:        Polyphenol <myemail@nowhere.com>
;
; Script Function:
;   Control iTunes from anywhere with hotkeys
;

#NoTrayIcon
#SingleInstance force
DetectHiddenWindows, on

#\::
IfWinNotExist, ahk_class iTunes
{
Run %ProgramFiles%\iTunes\iTunes.exe  ;launch program
return
}

IfWinExist, ahk_class iTunes ; toggle minimize/restore
{
IfWinNotActive ; restores window
WinActivate
Else
WinMinimize ; minimizes windows
return
}

#.::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{RIGHT}  ; > next
return

#,::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{LEFT}  ; < previous
return

#/::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, {SPACE}  ; play/pause toggle
return

#;::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{UP}  ; vol up
return

#'::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{DOWN}  ; vol down
return

#=::
SetTimer, songpreview, 10000 ; change song every 10 sec
songpreview:
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{RIGHT}
return

#-::
SetTimer, songpreview, Off
return

;endofscript


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2006, 9:00 pm 
Offline

Joined: July 27th, 2005, 9:02 am
Posts: 2
Location: Lausanne (Switzerland)
Thank you, I was looking for that and you've done it 8)

_________________
_________________
Best Regards

Gil

Use what talents you possess;
the woods would be very silent if no
birds sang except those that sang best.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 23rd, 2006, 3:15 pm 
I quit using iTunes in Windows solely because I couldn't figure out how to do this. Thank you much!


Report this post
Top
  
Reply with quote  
 Post subject: Rating songs?
PostPosted: July 22nd, 2006, 5:42 am 
Offline

Joined: July 22nd, 2006, 5:33 am
Posts: 2
I'm wanting to use AutoHotkey to create a small device that I can use to remotely control itunes. One of the features I really want is to be able to rate songs while I'm 20 ft from the computer. Is there a way to include 'rate current song' and choose between 1 and 5 stars usings hotkeys?

Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 22nd, 2006, 9:08 pm 
umm not very likely. unless there already is a hotkey for it (and there isnt as far as i know) it would be difficult at best, involving some kind of advanded control mouse click (if possible)


Report this post
Top
  
Reply with quote  
 Post subject: Rating songs by hotkey
PostPosted: July 23rd, 2006, 8:52 am 
Offline

Joined: July 22nd, 2006, 5:33 am
Posts: 2
If anyone else is looking for a way to rate songs using hotkeys, I found this free program for windows...

http://www.mattberube.com/software/ituneskeys/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2006, 12:51 am 
These commands doesn't work when I minimize iTunes to the traybar. Do you think you can fix that?


Report this post
Top
  
Reply with quote  
 Post subject: foobar
PostPosted: July 26th, 2006, 10:45 am 
Foobar2000 supports global key shortcuts in case anyone would like to switch to a media player that doesn't suck (on Windows, at least)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2006, 4:20 pm 
Try iTunesKeys - It will let you rate songs. http://www.mattberube.com/software/ituneskeys/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 1st, 2007, 4:36 am 
Ok ,so this works great for me, but I'm wondering if its possible to send the imput to a different computer on a network using global hotkeys and how hard that would be to do.

Also if thats too hard I have an alternative, I run a program that simulates multiple monitors, maybe i could make a script that would in effect move the cursor to the left say 1500 pixles or whatever, sends an imput, then goes back to the original position. Then on the client computer i would have the above script.

if anyone feels ambitious or just wants to help or give advice you can email me at:
Rob[*dot*]Hyman[*at*]gmail[*dot*]com


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2007, 12:07 am 
Offline

Joined: February 13th, 2006, 10:40 pm
Posts: 389
Location: Utah
Here is my script for controlling iTunes:

Infortunately, it does not work when iTunes is minimized or chilling in the tray, but if you just have it hiding behing whatever your working on, it works fine. Enjoy!

Code:
/*
  ---------------------iTunes Helper----------------------------
  ------------------------by Veovis-----------------------------

Control iTunes from any program, even full screen ones.  Use the
Song Selector to choose what song to play, and the commands to
play,pause,skip songs, or change volume.

.-= Song Selector =-.
  Hotkey: Ctrl /

 Press the hotkey, type something, then press enter (or wait for
 the 5 second timeout) and iTunes will perform a search and play
 all songs that have your critia in the name, artist, album, etc.
 So typing aquabats will play all songs by the aquabats, and
 "aqua charge" would play all songs by aquabats in album charge.
 
.-= Commands =-.
  Hotkey: Ctrl . (period)

 Press ctrl . to have the computer listen for one of the following:
 - space        Play/pause current song.
 - p            Start song over (type 2p to play previous song)
 - n            Play next song.
 - shift p      Play previous album.
 - shift n      Play next album.

(in the following # means NUMBERS not WINKEY)
 - #p/#n/#P/#N  Go forward/back # songs/albums
     If you type a number, then p,n,P or N then iTunes will go
     forward/back that many songs/albums, for ex: 6n would go
     forward six songs and 2P will go back 2 albums

 - # enter      If you type a number between 0 and 100 and press
                enter it will set the iTunes volume to the nearest
                5%.  So pressing 37enter will set it to 35.
 - escape       Cancel

For Example:
Pressing:         Does:
{ctrl}/aquabats   Plays all songs that match "aquabats" (using iTunes search)
{ctrl}.{space}    Play/pause
{ctrl}.p          Previous song
{ctrl}.n          next song
{ctrl}.{shift}p   Previous album
{ctrl}.{shift}n   Next Album
{ctrl}.4p         go back 4 songs
{ctrl}.5{shift}n  go forward 5 albums
{ctrl}.50         Set volume to 50%


*/

#singleinstance force
#NoEnv
SendMode Input
SetFormat,float,0.0
SetKeyDelay 25
StringCaseSense, On

^/::
   Input, UserInput, T5,{enter}{escape}
   ifequal,userinput,, return                ;if no input, dont continue
   ifequal,errorlevel,EndKey:Escape,return   ;if you press escape dont do anything
   controlsend,edit1,{esc},iTunes   ;this fixes a bug if your last search returned nothing
   loop, 2  ;dont know why this is necesary, just dont remove it
   {
      controlsettext,edit1,%userinput%,iTunes
      controlsend,,{enter}{tab}{down}{enter},iTunes
   }
return

^.::
   Input,command,C t3 *,{enter}, ,p,n,P,N
   if errorlevel = Match
   {
      stringright,key,command,1
      stringtrimright,count,command,1
      if key = %A_space%
         controlsend,ahk_parent,{space},iTunes
      if key = p
         controlsend,ahk_parent,{left %count%},iTunes
      if key = n
         controlsend,ahk_parent,{right %count%},iTunes
      if key = P                      ;previous album
         controlsend,ahk_parent,+^!{left %count%}{alt up}{control up}{shift up},iTunes
      if key = N                      ;next album
         controlsend,ahk_parent,+^!{right %count%}{alt up}{control up}{shift up},iTunes
   }
   
   if command = 0
      controlsend,ahk_parent,^+{down}{shift up}{ctrl up},iTunes
   else if command = 100
      controlsend,ahk_parent,^+{up}{shift up}{ctrl up},iTunes
   else if (command > 0) and (command <= 50)
   {
      steps := round(command*2,-1)/10
      volume := steps*5
      controlsend,ahk_parent,^+{down}{shift up}{ctrl up},iTunes
      controlsend,ahk_parent,^{up %steps%}{ctrl up},iTunes
   }
   else if (command > 50) and (command < 100)
   {
      steps := round((100 - command)*2,-1)/10
      volume := 100 - steps*5
      controlsend,ahk_parent,^+{up}{shift up}{ctrl up},iTunes
      controlsend,ahk_parent,^{down %steps%}{ctrl up},iTunes
   }
return

_________________
Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."


Report this post
Top
 Profile  
Reply with quote  
 Post subject: maybe...
PostPosted: January 3rd, 2007, 10:26 pm 
i bet you could get it to work when minimized or in tray by using part of the previous script.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 5:15 pm 
Hi,

I'm making a simple GlovePie script so I can control iTunes with my Wii remote, mind if I include this script or link here so people can see what they need for the global shortcuts?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 8:56 pm 
Offline

Joined: February 13th, 2006, 10:40 pm
Posts: 389
Location: Utah
of course! go ahead! the whole point of autohotkey is that its open source, and everyone helps each other out. If we wanted to not share our source, we could compile it, but here everyone helps each other out! Just make sure to say where you got your code from.

_________________
Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2007, 1:18 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Just a small note, AutoHotkey itself is open-source, but it's at the scripter's discretion as to whether their creation will also be open-source. You could even distribute a commercial application written in AutoHotkey.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 81 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: jsquard, maraskan_user, Pulover, RaptorX and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group