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 

AutoHotkey 4 iTunes
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
ophthalmos



Joined: 17 Jun 2008
Posts: 17
Location: Kiel, Germany

PostPosted: Tue Jul 01, 2008 10:26 pm    Post subject: AutoHotkey 4 iTunes Reply with quote

This script lets you control iTunes with global hotkeys and visual feedback.
14.4.09: New Version (2.0). Now COM.ahk from Sean is used (http://www.autohotkey.com/forum/topic22923.html).
3.9.09: New Version (2.1). Revised and extended version.
27.9.09: Version 2.2. Bug fixes. Thanks to wrecklass.
16.12.09: Version 2.3. New features: change playlist (ctrl-win-p), search dead tracks; bug fixes

This script uses much other code I found in this forum. Pars pro toto special thanks to infogulch for showing, how to work with trackart.



Arrow Download latest version (2.3): http://www.autohotkey.net/~ophthalmos/ahk_4_iT.zip


Last edited by ophthalmos on Wed Dec 16, 2009 11:55 am; edited 22 times in total
Back to top
View user's profile Send private message
BoBo²
Guest





PostPosted: Tue Jul 01, 2008 10:35 pm    Post subject: Reply with quote

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. Confused
Back to top
n-l-i-d
Guest





PostPosted: Wed Jul 02, 2008 10:31 am    Post subject: Reply with quote

Please use LTrim Join and break your lines.

But very impressive script. Cool

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
Back to top
n-l-i-d
Guest





PostPosted: Wed Jul 02, 2008 10:33 am    Post subject: Reply with quote

Question

My code went missing Shocked

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
Back to top
n-l-i-d
Guest





PostPosted: Wed Jul 02, 2008 10:35 am    Post subject: Reply with quote

I have no idea why I can't see the code I posted, must be on my end.
Back to top
ehagood



Joined: 30 Jan 2006
Posts: 50

PostPosted: Thu Sep 25, 2008 10:24 pm    Post subject: Reply with quote

Wow ophthalmos,

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

ehagood
Back to top
View user's profile Send private message
ophthalmos



Joined: 17 Jun 2008
Posts: 17
Location: Kiel, Germany

PostPosted: Tue Apr 14, 2009 11:41 am    Post subject: New Version Reply with quote

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.
Back to top
View user's profile Send private message
gregster



Joined: 19 Mar 2009
Posts: 9

PostPosted: Tue Apr 14, 2009 6:30 pm    Post subject: Reply with quote

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 Confused

Anyway many thanks for the said reasons.
Back to top
View user's profile Send private message
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Thu Apr 30, 2009 5:29 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
victorng



Joined: 01 Mar 2009
Posts: 4

PostPosted: Tue May 12, 2009 1:17 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ophthalmos



Joined: 17 Jun 2008
Posts: 17
Location: Kiel, Germany

PostPosted: Tue May 12, 2009 6:43 pm    Post subject: Reply with quote

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 Tue May 12, 2009 7:08 pm; edited 2 times in total
Back to top
View user's profile Send private message
TheIrishThug



Joined: 19 Mar 2006
Posts: 417

PostPosted: Tue May 12, 2009 6:52 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website AIM Address
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Wed May 13, 2009 5:08 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
ophthalmos



Joined: 17 Jun 2008
Posts: 17
Location: Kiel, Germany

PostPosted: Wed May 20, 2009 7:31 pm    Post subject: update Reply with quote

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.
Back to top
View user's profile Send private message
Bidomo in guest mode
Guest





PostPosted: Mon Jul 27, 2009 5:28 pm    Post subject: Crashing... Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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