• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
how to tell iTunes to play specific song
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to tell iTunes to play specific song


  • Subject: how to tell iTunes to play specific song
  • From: Josh Cheek <email@hidden>
  • Date: Mon, 22 Feb 2010 09:12:27 -0600

I can get the specific song I want, but can't figure out how to tell it to play it (the api is a little sparse)

set start_time to 120 + 27
set end_time to 120 + 42
tell application "iTunes"
    set my_search_results to (search playlist 1 for "Salt-N-Pepa" only artists)
    play (track whose file track id is my_search_results)
    set player position to start_time
    delay end_time - start_time
    stop
end tell


I can also get it to play the song like this
tell application "iTunes"
  play track "push it" in playlist 1
end tell

but it always finds "push it" by Garbage, which isn't the song I want it to play.

I've been messing with this for a few hours now, and can't figure out what to do.

Also, is there an API more prolific than the one in the Script Editor's library? The only AppleScript experience I have was some playing around in Automator.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: how to tell iTunes to play specific song
      • From: LuKreme <email@hidden>
    • Re: how to tell iTunes to play specific song
      • From: hd <email@hidden>
  • Prev by Date: Re: Ability to run multiple scripts at once
  • Next by Date: Re: terminal problems
  • Previous by thread: Re: Where's My Dialog?
  • Next by thread: Re: how to tell iTunes to play specific song
  • Index(es):
    • Date
    • Thread