Group support in Applescript
I looked through the documentation and didn't find anything, so I suspect I know the answer. But just want to confirm I'm not missing something.
Is there a way to toggle an entire group of cameras on or off, as opposed to having to call out the individual camera ID? It'd be pretty handy to enable "all inside cameras", etc, and not have to update the script as you add or remove cameras.
As a followup, assuming that's not possible...can you combine multiple camera IDs in one Applescript command, or do you have to chain multiple "do shell script"s together to get what you need done, done?
Thanks in advance!
Steve
Is there a way to toggle an entire group of cameras on or off, as opposed to having to call out the individual camera ID? It'd be pretty handy to enable "all inside cameras", etc, and not have to update the script as you add or remove cameras.
As a followup, assuming that's not possible...can you combine multiple camera IDs in one Applescript command, or do you have to chain multiple "do shell script"s together to get what you need done, done?
Thanks in advance!
Steve
Comments
I am having so e ti e to try and figure out the “do shell script” commands for SS.
I have tried: do shell script "curl -g http://“ip address:port”/++setSchedule?cameraNum=0&schedule=1&override=3&mode=CA"
I get the “OK” response but no changes are made to the system or triggers.
Can you share a sample command with me? Much appreciated.
As for groups, that is a great idea for my use case also. I know -1 will choose all cameras, but looking forward to Bens responses.
Cheers!
Chris
Yes, looking forward seeing what Ben has to say re:Groups also.
Best, Steve
++setSchedule?cameraNum=0&schedule=1&override=3&mode=CA
If you are having any problem with this not working as it should, please update to the latest beta version of SecuritySpy (currently 5.2.2b11), which should fix any issues.
To reference a group instead of a camera number in the above request, specify the group number plus 1000 (so 1000 is the first group, 1001 is the second group etc.), for example:
++setSchedule?cameraNum=1001&schedule=1&mode=CA
Schedule/override codes can be found in the SecuritySpy Web Server Specification document.
do shell script "curl -d " & "?'cameraNum=1000&camEnabledCheck=1&action=save' http://name:password@192.168.0.1:8000/camerasettings"
tell application "SecuritySpy"
set window "Group Name" visible yes
end tell
Here's how to close a group window:
tell application "SecuritySpy"
set window "Group Name" visible no
end tell
The "set window" command also allows you to position and resize the window, if you want to do so.