AppleScript no longer working to arm/disarm camera?
  • 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.

    Any suggestions?
  • 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.
  • I downgraded to 4.2.9 and Applescript is working again with that version.

    I then upgraded to 4.2.10 and Applescript is still working. So maybe something went wrong with the original upgrade.
  • 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.
  • Only one version was installed.

    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.
  • Hello,

    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:

    property thePath : "http://*****:********@imac.local:8000/++camerasetup"

    do shell script "curl -d " & "'cameraNum=1&transformationMenu=2&mcCaptureMovieCheck=1&frontCheck=1&resetTimeText=5&action=save' " & thePath

    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...

  • ! Rectification on what I just posted.

    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?).
  • I've been running 4.2.9 for over 24 hrs now and no issues with Applescript.
  • Could you all please try the latest beta version of SecuritySpy and let me know if the problem still occurs? Thanks.
  • 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}.
  • to complete the previous message: number -10006 from window 1
  • I downloaded the beta and ran it. At first applescript was working, but less than 15 minutes later it then failed. Same issue as before.
  • Just for MacOS reference, on the main SecuritySpy system I am running 10.13.6. On the view only system, 10.14.5. Both experience the same issue.
  • In short, except shell scripts nothing works.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!