AutoHotkey Community

It is currently May 26th, 2012, 8:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: iTunes and AutoHotkey
PostPosted: July 1st, 2008, 10:26 pm 
Offline

Joined: June 17th, 2008, 9:03 pm
Posts: 19
Location: Kiel, Germany
This script lets you control iTunes with global hotkeys and visual feedback.

14.4.09: New Version (1.0). Now COM.ahk from Sean is used (http://www.autohotkey.com/forum/topic22923.html).
27.9.09: Version 1.1. Bug fixes.
16.12.09: Version 1.2. New features: change playlist, search dead tracks, bug fixes
4.12.10: Version 1.3. Unicode-Version for AHK_L (native COM support). Bug fixes and improvements.
17.10.11: Both scripts have been adapted for newer versions of iTunes. Lyric search has been improved.

Image

:arrow: Download latest version (1.2) for AHK_Basic: http://www.autohotkey.net/~ophthalmos/iTHotk12.ahk
:arrow: Download latest version (1.3) for AHK_L: http://www.autohotkey.net/~ophthalmos/iTHotk13.ahk


Last edited by ophthalmos on October 18th, 2011, 1:27 pm, edited 28 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 1st, 2008, 10:35 pm 
Ohne code-Tag gehen leider alle Zeileneinzüge flöten (sofern überhaupt welche vorhanden waren). Etwas, was bei einem Script > 3 Zeilen absolut kontraproduktiv ist. :?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2008, 10:31 am 
Please use LTrim Join and break your lines.

But very impressive script. 8)

One thing I noticed:
Code:
If Lang = 07 ; 0407, 0807 Swiss, 0c07 Austrian, 1007 Luxembourg, 1407 Liechtenstein

you can use
Code:
If Lang in 07,0407,0807,0c07,1007 ; 0407, 0807 Swiss, 0c07 Austrian, 1007 Luxembourg, 1407 Liechtenstein


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2008, 10:33 am 
:?:

My code went missing :shock:

Code:
If Lang = 07 ; 0407, 0807 Swiss, 0c07 Austrian, 1007 Luxembourg, 1407 Liechtenstein

you can use
Code:
If Lang in 07,0407,0807,0c07,1007 ; 0407, 0807 Swiss, 0c07 Austrian, 1007 Luxembourg, 1407 Liechtenstein


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2008, 10:35 am 
I have no idea why I can't see the code I posted, must be on my end.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2008, 10:24 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
Wow ophthalmos,

I just downloaded this and it is great. Excellent job!

ehagood


Report this post
Top
 Profile  
Reply with quote  
 Post subject: New Version
PostPosted: April 14th, 2009, 11:41 am 
Offline

Joined: June 17th, 2008, 9:03 pm
Posts: 19
Location: Kiel, Germany
I've changed the first message and posted a new version of the code.
Version 1.0 used ws4ahk.ahk, written by erictheturtle.
Version 2 uses COM.ahk by Sean because it allows to evaluate events.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 6:30 pm 
Offline

Joined: March 19th, 2009, 4:04 pm
Posts: 9
Actually I learned my first ahk two months ago by going line by line through your first version, because I planned to make some extensions to iTunes myself. Thank you very much for that. It helped a lot to get things started.

Later I discovered Infogulch's script and I liked it even a little bit better because of the COM usage which has the advantage of processing events, like you stated correcly. That was a good lesson, too. Thanks to infogulch for that.

I'm looking forward to examine your code and perhaps I am able to learn again something although I have now already some experience with the COM thing. I'll my post my iTunes script in a few weeks (still very beta) and may be it will be interesting for you, too. Although I assume that some of my extensions are quite special for my needs :?

Anyway many thanks for the said reasons.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2009, 5:29 pm 
Offline

Joined: March 27th, 2009, 12:46 pm
Posts: 76
Location: Dublin, IE
There are a few language issues that need to be fixed.

Added Line 57:
Code:
lng_Exit = Exit


Edit Line 174:
Was
Code:
Menu, Tray, Add, Beenden, ExitiTunes

Is
Code:
Menu, Tray, Add, %lng_Exit%, ExitiTunes


Edit Line 861:
Was
Code:
iTRating = unbewertet

Is
Code:
iTRating = %lng_NotRated%


It'd also be great to have the script check to see if iTunes is already running. Also to have the option for the script to exit iTunes or not and to start iTunes or not.

_________________
My Scripts


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2009, 1:17 pm 
Offline

Joined: March 1st, 2009, 9:48 am
Posts: 4
wow thank you for writing this, probably the most complete iTUnes I've seen, save me so much time using iTunes

My questions/suggestions:

- Everytime I open iTunes/the script, it automatically play the first song of the first album, which is annoying since then i have to pause it manually, how do I disable this?

- I know you can do this by editing the script, but still, would you add the options to allow users to choose what kind of tags to be shown, or could you tell me how to do that manually?

for exp, I don't care about my song's bit rate & file size or song duration that much, and would only needs song name, artist name & album name along with album cover.

Thank you very much


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2009, 6:43 pm 
Offline

Joined: June 17th, 2008, 9:03 pm
Posts: 19
Location: Kiel, Germany
Dear folks, thank you for the feedback.

To Voltron43: I’ve corrected the script with yours suggestions. Thank you very much.

I have avoided adding options, because this needs an additional ini-file or registry-entries. I am afraid of the work.

For calling the script, I use another script (my ever-running script) with the following code:

Code:
/*
This script starts ahk_4_iT.ahk and iTunes.
If the script is still running, it terminates the script, but not iTunes.
If the script is loaded in the editor (UltraEdit), this window is ignored.
*/
DetectHiddenWindows, on
IfWinExist, % "ahk_id " WinExist("ahk_4_iT.ahk"),, UltraEdit
PostMessage, 0x111, 65405, 0
Else
    Run, ahk_4_iT.ahk,, UseErrorLevel
If ErrorLevel = Error
    MsgBox, «ahk_4_iT» failed to start.`nPerhaps it is not found.


I hope this enables one of your wishes at least.


Last edited by ophthalmos on May 12th, 2009, 7:08 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2009, 6:52 pm 
Offline

Joined: March 19th, 2006, 5:52 am
Posts: 419
ophthalmos wrote:
I have avoided adding options, because this needs an additional ini-file or registry-entries.

One little INI file isn't really an issue when it adds tons of value to the script. You can also use the AHK file as your INI as long as you don't compile it, just wrap the INI sections in /* comments.

Why are you using 3 levels of WinExist?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2009, 5:08 pm 
Offline

Joined: March 27th, 2009, 12:46 pm
Posts: 76
Location: Dublin, IE
victorng wrote:
- Everytime I open iTunes/the script, it automatically play the first song of the first album, which is annoying since then i have to pause it manually, how do I disable this?


You can either comment/remove line 138 or add a PlayPause line right after line 139. I do the latter to load the song info in the popup window.
Code:
COM_Invoke(iTunesApp, "Play")
COM_Invoke(iTunesApp, "PlayPause")

I've also edited line 143 to minimize iTunes upon startup.
Code:
COM_Invoke(COM_Invoke(iTunesApp, "BrowserWindow"), "Minimized", "True")

_________________
My Scripts


Report this post
Top
 Profile  
Reply with quote  
 Post subject: update
PostPosted: May 20th, 2009, 7:31 pm 
Offline

Joined: June 17th, 2008, 9:03 pm
Posts: 19
Location: Kiel, Germany
An extended version with the possibility of individual settings for the modifier hotkeys and the behavior at start-up can be downloaded as an exe-file from this website. Those who want the source code are welcome to contact me. Use the formula on that site.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Crashing...
PostPosted: July 27th, 2009, 5:28 pm 
Hi people!

I've been using this script for a couple days, and i've noticed that autohotkey (not compiled) gives an error in music files larger than 17 minutes, while playing pordcast or larger music files


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Google Feedfetcher, MSN [Bot], SKAN, Stigg and 21 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