Apple Script Help
  • From what I understand SecuritySpy is able to work with Apple Scripts. Do to the lack of IFTTT or HomeKit support in the new version of SecuritySpy I am looking to work around this.

    I have a camera at my front door and a lifx light plugged into the front door light. I would like two things to happen. I would like motion to turn on the light at the front door and motion to trigger a light in the house to blink red letting us know there is motion at the front door.

    Software I am using for the lifx commands is LIFXstyle - http://blog.peacockmedia.software/2014/12/scripting-to-create-effects-with-your.html

    I am looking for help with SecuritySpy Apple Script commands. I have no clue what a Apple Script command would look like for SecuritySpy when motion is detected.. plus my Apple Script are pretty weak..

    Any help would be great, thanks!!
  • Firstly, you should create an AppleScript that contains a command to turn the lamp on. The page you link to is quite helpful and contains information for how to do this. For example, here is a script that should work:

    tell application "LIFXStyle"
        set state of first lamp whose title is "Front Door" to 1
    end tell

    To create the script:

    - Open Script Editor (you'll find it in /Applications/Utilities/).
    - Enter your script (e.g. copy and paste the above and modify as appropriate).
    - Save the script to your ~/SecuritySpy/Scripts/ folder (this is within your Home user folder).
    - In SecuritySpy, this script will now be available as an Action under Preferences -> Cameras -> Actions.

    You probably want the light to turn off again after a short time, in which case you can do something like this:

    tell application "LIFXStyle"
        set state of first lamp whose title is "Front Door" to 1
        delay 20
        set state of first lamp whose title is "Front Door" to 0
    end tell
  • Thanks Ben, I will give it a go :)

Howdy, Stranger!

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