launching SecuritySpy via applescript

cinghialino
edited June 2013 in SecuritySpy
Hi all,

I am evaluating SecuritySpy to remotely see my apartment, and I have already set up an application on my phone (Tasker) to send an ssh command to execute an applescript on my mac that opens SecuritySpy and set the cameras in active mode every time I leave home.

The script works perfectly when I run it from the applescript editor, but when I launch the same script from ssh
(by using the command "open pathtothescript/script") it doesn't find any camera. this is the applescript:

tell application "SecuritySpy"
get active mode delay 0
end tell

should I include some other parameter?

Comments

  • Try this script:

    tell application "SecuritySpy"
    activate
    active mode
    end tell

    Does this work OK for you?
  • Hi Ben, thank you for your help.

    The script actually works in local, but no luck via ssh (of course I save the script first as an app with the option "run only" checked): same problem - application starts but no camera is recognized.
  • When you say "no camera is recognized", can you tell me exactly what you mean? Do you get an error message?

    Note that if you are using a local device (e.g. USB webcam or the computer's internal camera), then you must be logged in to the user account in which you are running SecuritySpy, otherwise the OS blocks access to these devices. If the account is logged out, or if it is running in the background with another user (or the login screen) running in the foreground, then this won't work. Is this applicable to your setup?
  • When I say "no camera is recognized", I mean the status says "no video". No error notification whatsoever.
    Yes, I am using an USB camera, but it's the only device attached and the bus should be pretty available, also it doesn't explain why the app works flawlessly if I launch it via mouse and not ssh..
    I am trying to launch it via ssh with the same username I'm logged in.
  • Please disable any screensaver you have enabled on the computer. This could be the difference between activating SecuritySpy using the mouse vs using SSH. Does that fix it?
  • no it didn't fix it.
  • If you run the script using the Terminal on the Mac in question, while sitting in front of it, does it work then? (as opposed to from your phone)

    What is the camera you are using - internal camera, USB camera, network camera?
  • Hi Ben sorry for the huge delay.
    Yes the script works when run from the mac. Both activation and deactivation.
    The camera that I'm using is USB, but I've been trying also with another remote camera (on another computer)