Remote itunes

according to: http://www.engadget.com/2006/01/17/how-to-create-an-itunes-remote/

How-To: Create an iTunes Remote

Posted Jan 17th 2006 3:27PM by [COLOR=#0000ff]Dave Zatz[/COLOR]
Filed under: [COLOR=#0000ff]Features[/COLOR], [URL=“http://www.engadget.com/category/homeentertainment/”][COLOR=#0000ff]Home Entertainment[/COLOR], [URL=“http://www.engadget.com/category/portableaudio/”][COLOR=#0000ff]Portable Audio[/COLOR]
[CENTER][COLOR=#0000ff][/COLOR][/CENTER]
[COLOR=#0000ff]Ken Grey[/COLOR] turned us on to [URL=“http://www.quickmacros.com/”][COLOR=#0000ff]Quick Macros[/COLOR] as an economical [URL=“http://ymouse.com/xkeys/xkpro.php”][COLOR=#0000ff]X-keys Pro[/COLOR] alternative. QM is a supercharged, yet lightweight automation environment which supports multiple input devices. It provides the ability to create custom toolbars, automate repetitive or complex tasks, and cheat at online poker. There’s a bit of a learning curve, but numerous canned functions and the ability to record actions help ease you in. QM goes beyond that, though, by offering a COM interface and common scripting support. With that in mind, I created an iTunes remote control using an extra wireless mouse and just a few snippets of code from [URL=“http://developer.apple.com/sdk/itunescomsdk.html”][COLOR=#0000ff]Apple’s SDK[/COLOR].

I. Install Quick Macros
Quick Macros is a quick download and install. The 30 day eval is free, after that it’ll cost you $30. For most efficient usage, allow QM to launch at system startup.
[CENTER][/CENTER]
[LIST=1]
[*]Download and install [COLOR=#0000ff]Quick Macros[/COLOR][/LIST]II. Prepare Quick Macros For Use With Multiple Input Devices
What makes QM uniquely powerful is the ability to map multiple keyboards and mice as macro triggers. QM supports Windows 98 and above, though the secondary input feature is limited to XP. Once the module has been downloaded and imported, set it to launch at QM startup and identify our second mouse.

[LIST=1]
[]Download [COLOR=#0000ff]Keyboard detector.qml[/COLOR]
[
]Open Quick Macros
[]Click File > Import
[
]Browse to and open Keyboard detector.qml
[]Click Import button
[
]Expand Keyboard detector folder in left pane
[]Highlight Keyboard_Detector (the one with the blue icon)
[
]Click the play icon button on toolbar twice[/LIST][CENTER][/CENTER]
[LIST=1]
[]Check Use Multiple Mouses (mice? meeces?)
[
]Double-click FF_Mouse2 with your second mouse
[]Click Close
[
]Expand User folder in left pane and highlight init2 function
[]Type [COLOR=#003399]mac[/COLOR] “Keyboard_Detector” under existing text in the right editing pane[/LIST]III. Create iTunes Remote Functions
Each mouse action will require its own macro or function. I chose to use functions because they can run simultaneously, though macros work just as well for these simple tasks. iTunes VBScript snippets will be triggered by specific actions on the second mouse, which must be filtered for. After creating the five functions, organize them in their own folder for purely aesthetic reasons.
[LIST=1]
[
]Click File > New > New Function
[]Name function “PlayPause”
[
]Right click “PlayPause” then left click Properties[/LIST][CENTER][/CENTER]
[LIST=1]
[]Click Mouse tab
[
]Click middle mouse button icon
[]Click Filter button[/LIST][CENTER][/CENTER]
[LIST=1]
[
]Click Use
[]Choose FF_Mouse2 from the drop down menu
[
]Click OK
[]In the editing pane on the right, type:
[SIZE=2][COLOR=#0000cc]lpstr[/COLOR][/SIZE][SIZE=2] vbs=
[COLOR=#009900] Set iTunesApp = CreateObject(“iTunes.Application”)
iTunesApp.PlayPause[/COLOR]
[COLOR=#0099ff]VbsExec vbs[/COLOR][/SIZE]
(Note the extra space to start lines 2 and 3)
[
]Repeat steps 1 - 10, specifying the appropriate mouse button and inserting the relevant code listed below:[/LIST][CENTER][SIZE=2]Function[/SIZE]
[SIZE=2]QM-formatted VBScript[/SIZE]
[SIZE=2]Volume Up[/SIZE][/CENTER]
[SIZE=2][COLOR=#0000cc]lpstr[/COLOR][/SIZE][SIZE=2] vbs=
[COLOR=#009900] Set iTunesApp = CreateObject(“iTunes.Application”)
iTunesApp.SoundVolume = iTunesApp.SoundVolume [plus sign] 10[/COLOR]
[COLOR=#0099ff]VbsExec vbs[/COLOR][/SIZE][CENTER][SIZE=2]Volume Down[/SIZE][/CENTER]
[SIZE=2][COLOR=#0000cc]lpstr[/COLOR][/SIZE][SIZE=2] vbs=
[COLOR=#009900] Set iTunesApp = CreateObject(“iTunes.Application”)
iTunesApp.SoundVolume = iTunesApp.SoundVolume - 10[/COLOR]
[COLOR=#0099ff]VbsExec vbs[/COLOR][/SIZE][CENTER][SIZE=2]Previous Track[/SIZE][/CENTER]
[SIZE=2][COLOR=#0000cc]lpstr[/COLOR][/SIZE][SIZE=2] vbs=
[COLOR=#009900] Set iTunesApp = CreateObject(“iTunes.Application”)
iTunesApp.PreviousTrack[/COLOR]
[COLOR=#0099ff]VbsExec vbs[/COLOR][/SIZE]
[CENTER][SIZE=2]Next Track[/SIZE][/CENTER]
[SIZE=2][COLOR=#0000cc]lpstr[/COLOR][/SIZE][SIZE=2] vbs=
[COLOR=#009900] Set iTunesApp = CreateObject(“iTunes.Application”)
iTunesApp.NextTrack[/COLOR]
[COLOR=#0099ff]VbsExec vbs[/COLOR][/SIZE][LIST=1]
[]Click File > New > New Folder
[
]Name the folder “iTunes Mouse Control”
[]Drag each function into the folder
[
]Click X to minimize Quick Macros to the system tray[/LIST][CENTER][/CENTER]
IV. Remote Control iTunes
The beauty of Quick Macros and iTunes is they both linger in the background waiting for input, regardless of which application is in the foreground. Pressing the scroll-click button on your new remote will launch iTunes and start playback, but you probably want to specify the tracks. For maximum geek effect, consider investing in some Velcro tabs to attach the mouse as shown below.

  1. Launch iTunes
  2. Fire up a playlist
  3. Minimize iTunes to the system tray
  4. Control playback via your secondary mouse while in any app
    Wrap Up
    [CENTER][/CENTER]
    If you’re looking for universal keyboard control for Apple’s ubiquitous player, [COLOR=#0000ff]iTunesKeys[/COLOR] is a fine choice. Obviously there’s also countless iTunes/iPod accessories out there, in addition to our own [URL=“http://www.engadget.com/2005/12/13/how-to-control-itunes-from-any-web-browser/”][COLOR=#0000ff]web interface tutorial[/COLOR] which provides a means of remote control. But if you’ve got an extra mouse lying around (preferably wireless, RF if you want couch-based control) this quick hack will give it a new lease on in life. Non-iTunes users may want to check out the Windows Media Player and WinAmp SDKs which may also work with QM, though I haven’t tested them. Let us know what other clever hacks you’ll be cranking out with Quick Macros, just don’t tell [URL=“http://blogs.zdnet.com/web2explorer/?p=90”][COLOR=#0000ff]KoolAidGuy[/COLOR] how you did it.

:stuck_out_tongue: