|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
Example AppleScript for RF Security Module
| Author |
Message |
|
Jean
Joined: Feb 21, 2005 Posts: 29
|
 Example AppleScript for RF Security Module
Sorry for this question which must have been answered 1000 times but I have looked all over the forum and looked in applescripts examples and have not found the correct answer
I have defined a variable in Indigo: HomeSecOn ( false)
I am using
using terms from application "Indigo"
on receive security event of eventType with code devID
if eventType is sec_ArmAway_min then
log "Securité On " & devID using type "Security Alert"
end if
continue receive security event of eventType with code devID
end receive security event
end using terms from
This works fine but
How and where in this script can I change the value HomeSecOn to True
Thanks for help
|
| Wed Dec 14, 2005 8:34 am |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11689 Location: Texas
|
 Re: Changing variable Value
Hi Jean,
I think something like this will work (untested):
- Code: Select all
using terms from application "IndigoServer" on receive security event of eventType with code devID if devID is 6 if eventType is sec_ArmAway_min then log "Securité On " using type "Security Alert" set value of variable "HomeSecOn" to "true" else if eventType is sec_ArmHome_min then log "Securité Off " using type "Security Alert" set value of variable "HomeSecOn" to "false" end if end if continue receive security event of eventType with code devID end receive security event end using terms from
Note that I patched into the device ID shown in your Event Log post on the other forum (6).
Regards,
Matt
Last edited by matt (support) on Fri Oct 03, 2008 4:25 pm, edited 1 time in total.
|
| Wed Dec 14, 2005 10:06 am |
|
 |
|
Jean
Joined: Feb 21, 2005 Posts: 29
|
 Changing Variable value
Hi Matt
Tanks for answer
But it doesn't work
this is what I read in log
Error script error: an't set «class Valu» of «class Vrbl» "HomeSecOn" to "true".
Error error sending apple event to self
How do I solve this problem ?
Jean
_________________ jean
|
| Wed Dec 14, 2005 3:52 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11689 Location: Texas
|
 Re: Changing Variable value
Are you running the script directly? It should only be run internally by Indigo as an Attachment Script. Once the script is inside the Indigo User Data/Scripts/Attachments/ folder, Indigo will automatically start running it when it is launched.
And, what version of Indigo are you running? Try the latest beta of Indigo 1.8. I thought I fixed the "C" missing in "Can't" error you are seeing in the Event Log a while back.
Let me know how it goes... If it still is not working, then email me the script file you are using as the security attachment and I'll debug into it.
Matt
|
| Thu Dec 15, 2005 9:29 am |
|
 |
|
Jean
Joined: Feb 21, 2005 Posts: 29
|
 Changing variable value
Hi Matt
Again thanks for your answer and patience which is obviously without limits !
I couldn't get it to work with version 1.6
I downloaded last version 1.8 and your script ( copy paste) worked like a dream
Thanks again
Jean
_________________ jean
|
| Thu Dec 15, 2005 11:51 am |
|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|