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


Click here to return to the 'Even better, use an applescript.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Even better, use an applescript.
Authored by: nsarup on Jul 22, '02 08:51:45AM

tell application "iTunes"
set rating of current track to 40
end tell

Nice thing for me as Im using an iMac as a stereo without a mouse (all the usb ports are filled up with iSticks, printer, keyboard and a SoundMate)
Now I can write a script that will increase the rating of the current song when I press the soundmate :)



[ Reply to This | # ]
Even better, use an applescript.
Authored by: nsarup on Jul 22, '02 09:19:01AM

Heres the sort of finished script:

tell application "iTunes"
set theRating to the rating of current track
if theRating is less than or equal to 80 then
set the rating of the current track to theRating + 20
end if
end tell

Now, its not as fast as I wanted it to be. if I save it as an application it has to start each time I want to increase the rating.
Is a shell script faster and where can I find info on how to send the above script from a shell script?



[ Reply to This | # ]
He, another one ;)
Authored by: nsarup on Jul 22, '02 09:58:15AM

Hehe it seems Im conversing with myself ;)
Here a new and improved script. It stays open and is nearly instantanious (right spelled?) when called after it has started up:


on run
increaseRating()
end run

on reopen
increaseRating()
end reopen

on increaseRating()
tell application "iTunes"
set theRating to the rating of current track
if theRating is less than or equal to 80 then
set the rating of the current track to theRating + 20
end if
end tell
end increaseRating



[ Reply to This | # ]
Even better, use an applescript.
Authored by: Hes Nikke on Jul 23, '02 08:10:57AM

i have a KeySpan DMR and a JVC VCR remote control, i just push a number 0-5 (i could do 0-10 if i want) and i rate the current song using 5 script similar to the above, i don't have speed issues mostly because i rate my musice towards the beginign of the song :)

it's kinda intersting because i'm finding myself rating to everything that is played, even though i know that i've rated it before and some times i think i even rated it diffrently.

whats realy anoying is trying to rate the music on FM radio... it doesn't work ;)



[ Reply to This | # ]
Even better, use an applescript.
Authored by: nsarup on Jul 23, '02 01:20:27PM

I think the radio stations would overload while trying to conform to veeryones ratings ;)

The speedproblem wasnt much of a problem when I made the script stay open. Now I use Keys X'ing to make F12 run the script. My concern about the speed was mostly that it was so slow that it, in theory, could happen that the song ended while the script was opening. Then again, it would only be a problem if I tried to rate the song in the last couple of seconds.



[ Reply to This | # ]