Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remote control iTunes like a console CD player Apps
I have a KeySpan DMR and a JVC Remote for various uses. Among other things, I use it to control iTunes from any app that it isn't set up for it (i.e. most apps).

Read the rest of the hint for the basic how-to...

[robg adds: Some knowledge of AppleScript is required, as this hint provides the scripts but little in the way of instruction on implementing them with the KeySpan DMR. Still, if you've got one, this should help you get started with customization ... and my apologies to HesNikke, as this one sat in the queue for a longggg time!]


Panther proven!


I have my 1-5 keys bound to a variation of this AppleScript:

-- enter the number of stars you want to rate the current song :
property userRating : 5 
tell application "iTunes"
 set currVolume to sound volume
 if currVolume > 50 then
  set sound volume to currVolume / 3
 else
  set sound volume to currVolume / 2
 end if
 say "now setting " & name of current track & 
 " to  a rating of " & userRating  & " stars."
 set the rating of the current track to userRating * 20
 set sound volume to currVolume
end tell
And to make things complete, I also have the following buttons so that I can listen to my music in bed or while I sleep:

Stop:

tell application "iTunes"
 try
  set thename to (name of current track)
  set theartist to (artist of current track)
  if theartist = "" then
  else
   set theartist to ", by " & theartist
  end if
  on error
   set thename to ""
 end try
     
 if thename is not "" then
  set currVolume to sound volume
  if currVolume > 50 then
   set sound volume to currVolume / 3
  else
   set sound volume to currVolume / 2
  end if
  say "This is " & thename & theartist
  set sound volume to currVolume
 end if
end tell
Pause: (bonus!)

tell application "iTunes"
 set theRating to (rating of the current track) / 20
 set currVolume to sound volume
 if currVolume > 50 then
  set sound volume to currVolume / 3
 else
  set sound volume to currVolume / 2
 end if
 if theRating = 1 then
  say "this is " & name of current track & 
  ", and you rated it " & theRating & " star."
 else if theRating = 0 then
  say "this is " & name of current track & 
  ", and you haven't rated it"
 else
  say "this is " & name of current track & 
  ", and you rated it " & theRating & " stars."
 end if
 set sound volume to currVolume
end tell
Channel up: (the DMR ignores the volume buttons...)

tell application "iTunes"
 set currVolume to sound volume
 set newVolume to currVolume + 5
 set sound volume to newVolume
end tell
Channel down:

tell application "iTunes"
 set currVolume to sound volume
 if currVolume <e; 14 then -- we don't want it to be TOOO quiet :)
  set newVolume to currVolume - 5
 else
  set newVolume to 10
 end if
 set sound volume to newVolume
end tell
And finally, my simple ones...

Play:

tell application "iTunes"
 playpause
end tell
Fast forward:

tell application "iTunes"
 next track
end tell
Rewind:

tell application "iTunes"
 previous track
end tell
    •    
  • Currently 2.40 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[10,694 views]  

Remote control iTunes like a console CD player | 6 comments | Create New Account
Click here to return to the 'Remote control iTunes like a console CD player' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remote control iTunes like a console CD player
Authored by: Hes Nikke on Oct 17, '03 02:29:20PM
wow, i had forgotten that i had submitted this!

one day i might even upgrade to BlueTooth and Salling Clicker, but that'd set me back $300 or $400, vs the $50 for the DMR, and the IR Remote i've already got ;)

---
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.

[ Reply to This | # ]

Remote control iTunes like a console CD player
Authored by: Hes Nikke on Oct 17, '03 02:32:14PM

btw rob, there was no need to apologize, i know that you put a lot of hard work into this site and i'm sure the queue is about a mile long :)

but since you have apologized, it's excepted ;)

---
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.



[ Reply to This | # ]
Remote control iTunes like a console CD player
Authored by: Hes Nikke on Aug 27, '04 05:02:04PM

lol... i made the upgrade for about $150 in may :)

---
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.



[ Reply to This | # ]
Panther Experiacnes
Authored by: Hes Nikke on Oct 27, '03 11:59:47PM
it seems to work fine with panther - even with fast user switching. however when you i log out of my account, it pops a message saying that the DMR software couldn't be started (even though it worked fine!) this could have something to do with a few other bugs i've run across with the DMR software and the custom mount point system i have implemented with that machine.

---
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.

[ Reply to This | # ]

Remote control iTunes like a console CD player
Authored by: Murphy on Oct 29, '03 08:08:41AM
If you use
repeat while sound volume > currVolume / 3
		set sound volume to (sound volume - 1)
	end repeat
instead of
set sound volume to currVolume / 3
, you get a fade-out effect. You can replace the 1 with any number to have it work faster. My script now looks like this:
property userRating : 5
tell application "iTunes"
	set currVolume to sound volume
	if currVolume > 50 then
		repeat while sound volume > currVolume / 3
			set sound volume to (sound volume - 1)
		end repeat
		--	set sound volume to currVolume / 3
	else
		repeat while sound volume > currVolume / 2
			set sound volume to (sound volume - 1)
		end repeat
		--	set sound volume to currVolume / 2
	end if
	say "now setting " & name of current track & 
		" to  a rating of " & userRating & " stars."
	set the rating of the current track to userRating * 20
	--set sound volume to currVolume
	repeat while sound volume < currVolume
		set sound volume to (sound volume + 2)
	end repeat
end tell


[ Reply to This | # ]
Remote control iTunes like a console CD player
Authored by: Hes Nikke on Aug 27, '04 05:07:56PM

back in may when i was transitioning to Salling Clicker, i thought about doing something like the above... i never got around to doing that though.

i'll implement it tonight :)

---
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.



[ Reply to This | # ]