Help converting AppleScript with iTunes to Python with Music

Posted on
Mon Dec 09, 2019 3:49 pm
kcossabo offline
Posts: 38
Joined: Dec 02, 2007

Help converting AppleScript with iTunes to Python with Music

Posted this in the wrong forum...


Help me please? I am sure there is massive GREAT reasons for a program that only runs on a Mac to stop supporting the Apple Scripting language, but, I need assistance with getting my whole house audio working again after mistakenly upgrading to the crippled 7.4

Below is a simple tell iTunes to play (I have one to pause as well) music.... .is it easy in Python??? Goggling for Python control of Apple Music results in strange music sold in iTunes and apps that write music, not the code.

Thank you in advance.

# Indigo no longer supports execution of embedded AppleScripts. For help
# translating AppleScripts to python see: http://indigodomo.com/applescript
#
# The original AppleScript was:
#
# tell application "iTunes"
# if player state is stopped then
# play playlist "Vinal Recordings - My Fav"
# set shuffle enabled to true
# -- set shuffle in playlist "2 stars and greater" to true
# else
# stop
# end if
# end tell

Posted on
Mon Dec 09, 2019 4:19 pm
kcossabo offline
Posts: 38
Joined: Dec 02, 2007

Re: Help converting AppleScript with iTunes to Python with M

:?: :?: :?: :?:

Is it this simple?

Put the AppleScript into a Script file via the Script Editor
Execute the file verse embedded???

Posted on
Mon Dec 09, 2019 4:30 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Help converting AppleScript with iTunes to Python with M

kcossabo wrote:
:?: :?: :?: :?:

Is it this simple?

Put the AppleScript into a Script file via the Script Editor
Execute the file verse embedded???



Yes it is!

--
Korey

Posted on
Mon Dec 09, 2019 5:40 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Help converting AppleScript with iTunes to Python with M

kcossabo wrote:
Put the AppleScript into a Script file via the Script Editor
Execute the file verse embedded???


As we say on the page linked in the comments of your script, scripts that don't target IndigoServer will continue to run if executed externally.

Note that we've been warning of this change (and describing why) for a couple of years, and we've gone out of our way to make sure that everywhere we discuss 7.4 mentions that AppleScript support to the Indigo Server would be deprecated. This should not come as a surprise to anyone who simply reads through the release information or does the most cursory search on the these forums.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Dec 09, 2019 6:56 pm
kcossabo offline
Posts: 38
Joined: Dec 02, 2007

Re: Help converting AppleScript with iTunes to Python with M

IMHO

The information has grown, commented, and have limited top level knowledge.

‘AppleScript no longer supported’

AppleScript support only via external file.

There is a difference. Stating you are moving from AppleScript to python, should have a clear, but full support via a file.

IMHO, first sticky should be, move your script to a file, and you will continue as you wee.

My humble opinion.

Posted on
Mon Dec 09, 2019 7:29 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Help converting AppleScript with iTunes to Python with M

kcossabo wrote:
The information has grown, commented, and have limited top level knowledge.


The article linked to in the script is very accurate and gets right to the point.

kcossabo wrote:
‘AppleScript no longer supported’

AppleScript support only via external file.

There is a difference.


Yes - and one does not equal the other. The article linked explains the difference.

kcossabo wrote:
Stating you are moving from AppleScript to python, should have a clear, but full support via a file.


That is not correct. AppleScripts that target the Indigo Server no longer work, which is literally what the first sentence says, and is repeated in the first sentence of the second paragraph. One option is to convert those types of scripts to Python, but there are other recommendations in that article. Many of the requested script conversions didn't need any script at all because there are now lots of 3rd party plugins that can do many of the things AppleScripts were used for before Indigo 5.

kcossabo wrote:
IMHO, first sticky should be, move your script to a file, and you will continue as you wee.


Again, that is not correct. AppleScripts that target the Indigo Server no longer work. And most Indigo AppleScripts do target the server. The one you posted above happens to (happily) be one one that will work as an external script because it doesn't target the Indigo Server (tell application IndigoServer).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests