Bluetooth AS script to Python Help

Posted on
Sun Oct 28, 2018 4:29 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Bluetooth AS script to Python Help

Hi All,

Need a little help converting the following AS into Python (knowing nothing about Python :) )

AS ....

on run eventArgs

set bluetoothName to [deviceName] of eventArgs

if bluetoothName is "Vangelis" then

tell application "IndigoServer"
execute group "Vangelis Home"
end tell
end if


This AS script takes a feed (bluetoothName) from another program (EventScripts) that listens out for my phone connecting (and disconnecting) from Bluetooth

Any help would be greatly appreciated..

Vangelis

Posted on
Sun Oct 28, 2018 3:28 pm
jay (support) offline
Site Admin
User avatar
Posts: 18215
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Bluetooth AS script to Python Help

Given that the script is executed from somewhere else, it's unlikely a Python conversion is what you need.

Rather, you can either call Indigo's RESTful API from your AppleScript or you can try the script that we posted on Github that allows you execute commands from AppleScript via the Python scripting environment.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Oct 31, 2018 6:35 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Re: Bluetooth AS script to Python Help

Thanks Jay. This put me on the right track with the RestfulApi. Due to Apple Sandboxing I was unable to run the curl command straight from AS (within the application) however I was able to call a Bash script (that contained the curl command) which achieved the objective.

...Vangelis

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron