Running the latest SS (4.2.10). My AppleScripts are no longer working. For example, to arm specific modes for a specific camera, I had this script...
tell application "SecuritySpy" set schedule "Armed 24/7" camera number 0 mode Actions set schedule "Armed 24/7" camera number 0 mode MotionCapture end tell
This no longer does anything. Maybe the camera number somehow changed? How do I know which camera is which "camera number" for AppleScript (though, I've tried 0, -1, 1, etc. without any positive results)? I tried searching the forums, the AppleScript (Examples) section in SS help, and Google in general and wasn't able to find anything.
I am also having issues with applescript not work with my arm/disarm scripts.
example:
tell application "SecuritySpy" arm camera name "Master Bedroom" mode Actions arm camera name "Guest Bedroom" mode Actions arm camera name "Upstairs Hall" mode Actions arm camera name "Computer Room" mode Actions end tell
The above used to enable Actions, but no does nothing. No errors are displayed.
This is strange because nothing should have changed in this regard between the previous version (4.2.9) and the current version (4.2.10). I've just tested this with 4.2.10 and can't see any problems, it just works for me.
The only thing I can think of that could cause this is if you have Schedule Overrides in place, that are overriding the schedules you are attempting to set via AppleScript. Try selecting "Clear All Schedule Overrides" from the Control menu in SecuritySpy, and then trying your scripts again.
If this doesn't resolve the problem, could you both please grab the previous version and compare them side by side to confirm that there is definitely a difference between versions? You can obtain it here: download SecuritySpy 4.2.9.
As for the camera numbers, you can get these from the Camera Info window. Click on the header bar (where the column header names are shown) to get a menu to add the relevant column. The camera names will not change between SecuritySpy updates.
Sometimes when there are two versions of an application installed, AppleScript gets confused about which one it should send commands to. Could this have been possible in your case - did you have two versions of SecuritySpy on your Mac? Ideally you should make sure there is just one version of SecuritySpy, in the Applications folder. I can't think of anything else that might have caused this problem.
Just tested and applescript is not working again for 4.2.10. And it's not just getting the camera modes, but any of the SecuritySpy commands.
For example:
tell application "SecuritySpy" get camera names end tell
Returns: missing value
If I quit SecuritySpy and relaunch then it starts working again. So, it seems like it may be something occurring after SecuritySpy has been running for some time. I've also tested this on a 2nd mac (view mode) and it too has the same issue.
I've downgraded to 4.2.9 and will see if same behavior occurs.
The same for me with the following script where only the shell script was working (Mac OS 10.13.6, camera D-Link dcs-5020L). it was running perfectly on version 4.2.9 that had been previously deleted:
tell application "SecuritySpy" ptz preset3 camera number 1 delay 7 set sensitivity 50 camera number 1 set schedule "Armed 24/7" camera number 1 mode Actions end tell
No error message displayed.
Noting that the new version was not working properly, version 4.2.9 prefs files have been cleared (but I'm nor sure that all prefs files have been erased) and 4.2.10 reinstalled and configured identically but not working again.
So, I've downgraded (result all Ok) and reinstalled 4.2.10 and this time everything works. There may be something to see there...
After a few trials and recommissioning, the same problems reappeared. There is surely a little thing wrong somewhere. In the meantime I downgrade but Ben will fix it (or see what's wrong with us?).
No change for me and an error occurred on the following script running 4.2.9 that I had not yet tested: ____________________________ tell application "SecuritySpy" open video window camera number 1 set bounds of first window to {1510, 23, 1920, 365} delay 7 close video window camera number 1 end tell ___________________________
script error
Error in SecuritySpy: It is impossible to set window 1 to {1510, 23, 1920, 365}.
This fix involved re-writing a lot of the scripting code, so please test your scripts and let me know if you spot any issues.
If you are using Script Editor, please quit and reopen it after you have installed and opened the beta, so that it can refresh its dictionary.
@cwibal - opening/sizing windows was never officially supported, so I don't know how your particular script ever worked. However we have now officially added this capability with a new "set window" command. For example, here is how to open and resize the "All Cameras" window:
set window "All Cameras" x 100 y 100 width 640 height 480 visible true
Just use the window name to refer to a window (for individual camera preview windows, this is the same as the camera name).
SS beta installed 5 minutes ago, for now everything works but I'm still waiting a few hours to restart the tests. As for my window management script I simply exploited the dictionary of the application and did a little cooking with some information gleaned here and there and of course, I will try the new command. Thank you
tell application "SecuritySpy" ptz preset1 camera number 1 set sensitivity 50 camera number 1 set schedule "Armed 24/7" camera number 1 mode MotionCapture set schedule "Armed 24/7" camera number 1 mode Actions end tell
Hello, Re-reading my previous post proves that a vacation was well needed. So we forget this model of nonsense and I make the thing clear in a future comment. With apologies
The cleaning was done and the problem remains that in the following the instructions "soundMenu" and "scriptMenu" do not work while "transformationMenu" and "soundSourceMenu" work well.
The "soundMenu" and "scriptMenu" parameters require the whole file name of the sound/script, including the file extension, which you are omitting in your above script.
So, for example, if your sound is stored in the file "Hero.aiff" (which is the case for the macOS "Hero" sound that SecuritySpy makes available by default), then you will need to specify soundMenu=Hero.aiff as the parameter and value.
Likewise, the script file will normally have the extension ".scpt" so you will need to specify scriptMenu=Send_iMessage.scpt for that.