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


Click here to return to the 'Too complicated?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Too complicated?
Authored by: applescripter on Oct 14, '10 01:32:58PM
Am I missing something or is there a problem with tell application "iTunes" to play current track with once

[ Reply to This | # ]
Too complicated?
Authored by: BlaatMekker on Oct 14, '10 05:45:02PM

Ah, I was still lurking this hint for a reader to come by with a more simplistic solution. Thank you.



[ Reply to This | # ]
Too complicated?
Authored by: david-bo on Oct 15, '10 03:02:41AM

How do you use your onliner? I try executing it using either osascript or script editor but nothing happens, iTunes just continue playing when the current track is finished.

---
Koala Surf Camp



[ Reply to This | # ]
Too complicated?
Authored by: applescripter on Oct 15, '10 03:41:49AM
Sorry misread original post, for this script to work the song needs to be paused then played using this script

try this instead

tell application "iTunes"

set t to current track

if player state is playing then

set pos to player position

set dur to duration of t

set e to dur - pos - 2

delay e

pause

end if

play t with once

end tell

It pauses the track near to the end (to minimise disruption) then plays it with once specified

[ Reply to This | # ]