Re: AppleScript-Users Digest, Vol 7, Issue 105
Re: AppleScript-Users Digest, Vol 7, Issue 105
- Subject: Re: AppleScript-Users Digest, Vol 7, Issue 105
- From: Kevin Bradley <email@hidden>
- Date: Tue, 23 Feb 2010 02:05:41 -0600
What you want is something that selects the track by the artist's name. Like this:
Tell application "itunes"
set theSong to file track of playlist 1 whose name is "push it" and artist is "Salt-N-Pepa"
play theSong
end tell
Kevin Bradley
--
"You may find, after a time, that having a thing is not as pleasing as wanting a thing. It is not logical, but it is often true."
-- Spock
On Feb 22, 2010, at 2:01 PM, email@hidden wrote:
> Date: Mon, 22 Feb 2010 09:12:27 -0600
> From: Josh Cheek <email@hidden>
> Subject: how to tell iTunes to play specific song
> To: email@hidden
> Message-ID:
> <email@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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