"Come to the front"

I use SecuritySpy on my primary desktop, but I'm considering migrating it to a dedicated server. On my primary desktop, I am thinking that I can use ViewCam. Would the motion detection occur on the SecuritySpy instance and be sent to ViewCam, or do they operate mostly independently? In addition, I rely on the "Come to the front and open this camera's video window" feature. This is not available on ViewCam, is it? Maybe I can instead have SecuritySpy remotely trigger ViewCam to bring the window with motion to the front? I looked in AppleScript dictionary, and it seems that Viewcam doesn't have any AppleScript support?

Comments

  • Ben
    Ben
    edited April 2024

    Apologies for my late reply here.

    It's true that ViewCam does not have any AppleScript commands at present, and there is no other way to get it to open a particular camera window when it detects motion.

    The solution is to use SecuritySpy on this viewing Mac (it's free for the purposes of viewing live video from a licensed SecuritySpy server - see SecuritySpy as Remote Viewing Software).

    You can create an AppleScript on the server that is invoked when motion is detected, which tells SecuritySpy on the viewing Mac to open a particular video window. Here's how to do this:

    • Under System Settings > Sharing on the viewing Mac, note the "local hostname" that will be shown there, for example "iMac.local".
    • In this same panel, make sure the "Remote Application Scripting" option is turned on.
    • On the server, using Script Editor, create the following AppleScript:
    tell application "SecuritySpy" of machine "eppc://iMac.local"
    	activate
    	open video window camera name "MyCamera"
    end tell
    
    • Make sure to edit this to include the correct machine name and camera name.
    • Run it to make sure it works (you will be asked for the password of the viewer Mac to authenticate the command).
    • Save this script to the ~/SecuritySpy/Scripts folder on the server Mac (i.e. the Scripts folder within the SecuritySpy folder within the user's Home folder).
    • In SecuritySpy on the server, under Settings > Cameras > Actions, set this script as an Action, and make sure that Actions mode is armed for this camera.