Thanks, Pierre L.
What I'm trying to achieve is add a track to up next via its HFS path.
This script works with fixed coordinates and runs in about .3-.5 sec.
set TheTrack to "HD:Users:me:Music:iTunes:iTunes Music:Your Music:test.m4a" -- test track
tell application "iTunes"
set SelTrack to (addTheTrack)
revealSelTrack
activate
-- fixed coordinates for iTunes fullscreen 1440.900
do shell script "MouseTools -x 380 -y 180 -controlKey -leftClick" -- context menu
tell application "System Events" to keystroke "Add to Up Next" & return
end tell
This other script also works but runs in 3-4 sec.
setTheTrackto "HD:Users:me:Music:iTunes:iTunes Music:Your Music:test.m4a" -- test track
tell application "iTunes"
set SelTrack to (addTheTrack)
revealSelTrack
activate
tell application "System Events"
tell process "iTunes" to tell text field 1 of (row 1 whose selected is true) of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 to set {x, y} to position
do shell script "MouseTools -x " & (x + 5) & " -y " & (y + 5) & " -controlKey -leftClick" -- context menu
keystroke "Add to Up Next" & return
end tell
end tell
But, if I set the track reference it runs in about .3-.5 sec.
set SelTrack to file track id 15626 of user playlist id 15622 of source id 75 of application "iTunes"
Getting the file track id is somehow slowing getting coordinates to a crawl and vice versa. Any ideas?