AppleScript Question

Posted on
Mon Oct 21, 2013 7:45 am
jltnol offline
Posts: 994
Joined: Oct 15, 2013

AppleScript Question

Ok so, I'm basically trying to get iTunes to play a particular playlist on a schedule. I've got a very small Applescript, that works when activated via the Applescript Editor... it opens iTunes, and plays the playlist I want.

When I put the script into a Schedule in the PRO section and click the PRO Radio Button, and hit the Compile & Test icon, it works perfectly as well. :D

But when the Schedule is activated either manually or via the time it is supposed to activate, all it does is cause iTunes to play from where ever it was playing last,NOT the playlist specified. :oops:

So in the Schedule Window, the Schedule is set for 7:30 AM, the Condition is the Applescript(which compiles and tests AND runs ok), and for Actions, I have tried both No Action(nothing happens...), and an Action of Type: Play iTunes, Device: iTunes.

Any suggestions of what I've got wrong here ? :|

Posted on
Mon Oct 21, 2013 8:15 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: AppleScript Question

could you publish your script?

Posted on
Mon Oct 21, 2013 8:45 am
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: AppleScript Question

Sure. Like I said, it runs fine in Applescript, and when I hit the Compile and Test button it runs just fine.

Here's the script.. WWNO is the playlist:

tell application "iTunes"
activate
end tell

tell application "iTunes"
play playlist "WWNO"
end tell

Posted on
Mon Oct 21, 2013 9:00 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: AppleScript Question

I tried that script works fine for me .. and you can shorten it
tell application "iTunes"
activate
play playlist "classical" -- my playlist
end tell

problem must be in your schedule.. what is the "pro" section and which radio button to you use" is it "execute actions now"?

have attached the action section of my schedule that works

Karl
Attachments
itunes schedule.tiff
itunes schedule.tiff (68.78 KiB) Viewed 3511 times

Posted on
Mon Oct 21, 2013 9:03 am
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: AppleScript Question

It shouldn't be in the condition but rather should be an action (you don't need the first tell block, just the last one will be fine). For your action select Server Actions->Script and File Actions->Execute Script and select Embedded AppleScript. Paste in your script into the box under that.

Make sure your condition has Always selected.

The PRO section you're talking about only shows when you're using a trial or Lite (in which case stuff in it is disabled).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 21, 2013 10:14 am
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: AppleScript Question

Thanks Jay!

Problem Solved.

:P

Posted on
Wed Feb 12, 2014 2:51 pm
scriptures4life offline
Posts: 18
Joined: Apr 22, 2011

Re: How to get Indigo to Play an iTunes Playlist

kw123, jltnol, jay (support):

Thanks for posting this. We should put this on the iTunes Wiki (http://www.perceptiveautomation.com/wik ... ins:itunes) to show how to get Indigo to play a playlist. :D

THANKS AGAIN!

All house lights and block heater are Insteon switches. Running Indigo Pro.

Posted on
Thu Feb 13, 2014 3:21 pm
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: AppleScript Question

That is the documentation for the iTunes plugin - which doesn't support playlists.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests

cron