Eventscripts for bluetooth detection of multiple devices!

Posted on
Sun Jul 07, 2013 11:23 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Eventscripts for bluetooth detection of multiple devices!

http://www.mousedown.net/mouseware/EventScripts.html

I highly recommend his for anybody using bluetooth detection on their apps. It recently replaced Proximity, as it allows multiple bluetooth devices and an adjustable amount of retries before timing out.

Between that and Smartphoneradar, my apartment knows when either my gf or i am are home. With a triggerlinc on the door, the apartment starts up based on who is in range and shuts down when nobody is in range.

It rules. Let me know if you run into trouble with the included library of example scripts, it took some tinkering to get them to work.

Posted on
Wed Mar 12, 2014 10:49 am
mariuscd offline
Posts: 1
Joined: Mar 12, 2014

Re: Eventscripts for bluetooth detection of multiple devices

I tried using it, however I cannot make it work, does not seems to trigger my script by the bluetooth device lost or found.

Any pointers on how to make this work?

Thank you.

Posted on
Fri Mar 14, 2014 10:38 pm
Swimmer offline
Posts: 2
Joined: Mar 12, 2014

Re: Eventscripts for bluetooth detection of multiple devices

I purchased Eventscripts and have been able to get the blutetooth found and lost events to work great. What I'm not sure about is how to integrate this into Indigo. I'm new to this whole thing. Any pointers to get me going in the right direction? I'm a decent programmer, just not sure how the Indigo API works.

Thanks.

Posted on
Sat Mar 15, 2014 9:44 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Eventscripts for bluetooth detection of multiple devices

Indigo's AppleScript dictionary describes all the functionality provided - it can also be accessed directly in the AppleScript editor (in a more usable form IMO) by inspecting the IndigoServer app itself located here:

/Library/Application Support/Perceptive Automation/Indigo 6/IndigoServer.app

Note that's the Library folder at the top level of the hard drive, not the one in your user directory.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Mar 15, 2014 5:46 pm
Swimmer offline
Posts: 2
Joined: Mar 12, 2014

Re: Eventscripts for bluetooth detection of multiple devices

Thank You. That is exactly what I needed.
I now have the Bluetooth proximity scripts working.

Posted on
Thu Dec 11, 2014 3:01 pm
jmdraper offline
Posts: 103
Joined: Sep 11, 2014
Location: Surrey, UK

Re: Eventscripts for bluetooth detection of multiple devices

I am trying to get this work and can't quite make the final step. I can get it to work to run a really basic script when an event happens but as soon as I try to use the parameters passed to the script to work out which device has been lost or found, it doesn't work. I am running Eventscripts on a different machine (on same LAN) than Indigo. Don't ask why but this can't be changed. The following works well to change a variable in Indigo triggered from event scripts:

set theRemoteApp to application "eppc://username:password@servername.local/IndigoServer"
using terms from application "Script Editor"
tell theRemoteApp
set «class Valu» of «class Vrbl» "AIsHome" to "true"
end tell
end using terms from

However, when I adapt the script to try to make use of parameters to determine which device has been lost/found, as follows, it doesn't work:

on run eventArgs
set lostDevice to (deviceName of eventArgs)
set theRemoteApp to application "eppc://username:password@servername.local/IndigoServer"
if lostDevice is "A iPhone" then
using terms from application "Script Editor"
tell theRemoteApp
set «class Valu» of «class Vrbl» "AIsHome" to "false"
end tell
end using terms from
else if lostDevice is "B iPhone" then
using terms from application "Script Editor"
tell theRemoteApp
set «class Valu» of «class Vrbl» "BIsHome" to "false"
end tell
end using terms from
end if
end run

If I try running this script in Script Editor it throws an error saying:

error "Can’t make deviceName into type reference." number -1700 from deviceName to reference

But I know almost nothing about Applescript or script editor so this isn't helping me very much.

Any ideas or suggestions gratefully received.

Thanks,
Jon

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests