iPhone 4 Review
Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.

Topic: Changing a Rating on a desktop's Shared Playlist from a laptop.

Reply Thread Tools Topic Search
 
Old 11-10-2003, 10:49 PM
#1
 
Freshman Lounger
 
Join Date: Nov 2003
Posts: 9
Changing a Rating on a desktop's Shared Playlist from a laptop.

I've been trying to find a way to do this for way too long.

I listen to the shared playlist from my desktop machine--the one with all the music--from my laptop. However, since it's a shared playlist, I can't make any changes to the Ratings on my desktop's playlist from the laptop without a lot of hastle (third-party iTunes network remote, VNC, etc.)

This is a real drag since a lot of my music sorting and playlist management relies on Ratings.

I've been using Synergy and loving it, especially the ability to raise or lower the rating of a song with a keyboard shortcut. However, since you can't make changes to a remote playlist, this functionality is nonexistent when listening to a Shared Playlist.

What I'd love to have is a way to do the following:
(1) based on the song currently playing in iTunes,
(2) on the remote machine, tell iTunes / change the Library file to
(3.1) increment and decrement the Rating of that song and/or
(3.2) display the song's current rating and let me enter a new rating (in number of stars).

I have admin access on both machines, so this method could be executed by using scripts with the Terminal and a connection to the desktop machine, Remote Apple Events, or some other voodoo, so be it; whatever works.

I can't help but think that most of the necessary parts for this have already been completed; they just haven't been joined together for this particular task. I'm a total AppleScript n00b, otherwise I'd just cobble it together myself... but RTFM takes time, and no reason to reinvent the wheel. :-)

Any ideas?
darkside is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote

Become a member of the iLounge Forums and the ad above will disappear.

Old 11-12-2003, 07:26 PM
#2
 

Mod
 
Join Date: Jun 2003
Location: Providence, RI, USA
Posts: 705
May be possible

I haven't done much network scripting, so I'm not sure of how to actually tap the iTunes app on the other machine ("using terms from" comes to mind). However, I have mentioned elsewhere that you can get quite a bit of necessary info about a shared track. By getting its name, album and artist, you pretty much know where to look for it on the remote machine. I'm just not sure how to access the iTunes on the other machine, which is what you would need to do to change a track's tags. (set thisSharedTrack to some track of library playlist 1 of [remote iTunes application] whose name is myName and album is myAlbum and artist is myArtist...?)

Not for nothin', but this kind of talk could lead to the sort of file sharing that Apple frowns upon.
__________________
Visit Doug's AppleScripts for iTunes
Doug Adams is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote
Old 11-12-2003, 09:56 PM
#3
 
Freshman Lounger
 
Join Date: Nov 2003
Posts: 9
Re: May be possible

Thanks for the interest

Quote:
Originally posted by Doug Adams
Not for nothin', but this kind of talk could lead to the sort of file sharing that Apple frowns upon.
A pitty, if that is the case... even though Apple's policy towards piracy hasn't been as draconian as others, I was disapointed to find that I couldn't change my music on my computer from another one of my computers.

I completely understand why Shared Playlists are so tightly restricted... but wouldn't it be nice (considerate, even?) to have "administrator" or "owner" access to playlists through a separate password?

I submited a feature request to Apple for something like this a while ago... maybe if enough others subit one... :-)
darkside is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote
Old 11-16-2003, 08:20 AM
#4
 

Mod
 
Join Date: Jun 2003
Location: Providence, RI, USA
Posts: 705

After some experimenting, I've put up a couple of tips on controlling iTunes on a remote machine, and also how to copy the currently playing shared track from the remote machine to the local machine. The article, "Control iTunes On A Remote Machine" uses UPMs so you can open the example scripts in your own Script Editor.
__________________
Visit Doug's AppleScripts for iTunes
Doug Adams is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote
Old 11-21-2003, 12:28 PM
#5
 
Freshman Lounger
 
Join Date: Nov 2003
Posts: 9

Quote:
Originally posted by Doug Adams
The article, "Control iTunes On A Remote Machine" uses UPMs so you can open the example scripts in your own Script Editor.
Wow; transfering files was an unexpected benefit. This should help when I get an earworm and am in dire need of a track while I'm stranded at work.

BTW, the link in your post is broken; leads to a 404. The link to your Control iTunes on a Remote Machine article is http://www.malcolmadams.com/itunes/i...mcontrol.shtml.

One thing I'm still wondering about... I've got my headphones plugged into my laptop, listening to music from my laptop's iTunes, which is playing Prodigy's "Smack My ##### Up"?which is on a Shared Playlist; the actual MP3 is on my desktop system in the other room.

I look at the Rating and see it's only a 4. Travisty! It should be a 5, naturally. But since it's on a Shared Playlist from my desktop, I can't make any changes to the Rating from my laptop! How can the script be adapted to enable changing the Rating of a song that you're currently listenting to when it's on a Shared Playlist?

Last edited by darkside; 11-22-2003 at 12:20 PM.
darkside is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote
Old 11-21-2003, 01:38 PM
#6
 

Mod
 
Join Date: Jun 2003
Location: Providence, RI, USA
Posts: 705

Something like this:

Code:
global remMachine
-- change this to your info:
set remMachine to "eppc://username:userpass@remote_ip"
tell application "iTunes"
	if player state is not stopped and class of current track is shared track then
		tell current track to set {nom, alb, art, siz} to {name, album, artist, size}
		set rate to button returned of (display dialog "Add or Subtract a Rating star to \"" & nom & "\"" buttons {"Cancel", "Subtract", "Add"})
		try
			with timeout of 300 seconds
				tell me to getSharedTrack(nom, alb, art, siz, rate)
			end timeout
		end try
	end if
end tell
--
to getSharedTrack(nom, alb, art, siz, rate)
	using terms from application "iTunes"
		try
			tell application "iTunes" of machine remMachine
				if exists (some file track of library playlist 1 whose name is nom and album is alb and artist is art and size is siz) then
					set theTrack to (some file track of library playlist 1 whose name is nom and album is alb and artist is art and size is siz)
					tell theTrack
						if rate is "Subtract" then
							if rating is not 0 then set rating to (get rating - 20)
						else if rating is not 100 then
							set rating to (get rating + 20)
						end if
					end tell
				end if
			end tell
		on error errM number errN
			display dialog (errM & space & errN)
		end try
	end using terms from
end getSharedTrack
I edited a couple of inconsequential lines of code from a previous post. I will be adding this to the article at some point also.
__________________
Visit Doug's AppleScripts for iTunes

Last edited by Doug Adams; 11-21-2003 at 04:40 PM.
Doug Adams is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote
Old 11-22-2003, 03:30 PM
#7
 
Freshman Lounger
 
Join Date: Nov 2003
Posts: 9

Excellent! With a bit of tweaking, this does exactly what I wanted it to!

One interesting note; the script didn't like my password for the remote machine as I entered it in the script, so it threw up a system dialog to log into the remote machine... with the option to save it in the Keychain!

My reauthentication timeout hasn't come around yet, but if it works as I hope, this means you won't have to hard code the username and password into the script; just the IP of the remote machine.

Note: I'm running Panther 10.3.1, in case that has bearing on the login handling.
darkside is offline  
Share on TwitterShare on FacebookDigg this Post!Google Bookmark this Post!
Reply With Quote

Topic: Changing a Rating on a desktop's Shared Playlist from a laptop.

Reply Thread Tools Topic Search

Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

twitter facebook RSS twitter facebook RSS




View iLounge History. Read our old Forums Archive (2001-2003)
All times are GMT -4. The time now is 05:06 PM.


Shop for Accessories: Cases, speakers, chargers, etc.