wackazong
09-10-2003, 06:35 AM
Hi!
I have a small problem: I use the following script to rate a track and set the "modified" date to today:
on ratethetrack(keyCode)
try
tell application "iTunes"
set tempvar to composer of current track
set composer of current track to "*"
set temprate to keyCode * 20
if temprate > 100 then set temprate to 0
set rating of current track to temprate
set composer of current track to tempvar
end tell
on error
beep
end try
end ratethetrack
The keycode is from "1" to "5". All works very well, but sometimes itunes hangs (that means the music stops for up to two seconds) when I activate this routine.
My question: Is there any way to ckeck wether iTunes is very busy and then postpone the script? Or is there a better way that doesnt use as much of iTunes' resources?
THX!
ALEXander.
I have a small problem: I use the following script to rate a track and set the "modified" date to today:
on ratethetrack(keyCode)
try
tell application "iTunes"
set tempvar to composer of current track
set composer of current track to "*"
set temprate to keyCode * 20
if temprate > 100 then set temprate to 0
set rating of current track to temprate
set composer of current track to tempvar
end tell
on error
beep
end try
end ratethetrack
The keycode is from "1" to "5". All works very well, but sometimes itunes hangs (that means the music stops for up to two seconds) when I activate this routine.
My question: Is there any way to ckeck wether iTunes is very busy and then postpone the script? Or is there a better way that doesnt use as much of iTunes' resources?
THX!
ALEXander.