Skip to content

how to execute an AppleScript via SecuritySpy Webserver

edited August 2023 in AppleScript

A few years ago it was possible to execute an AppleScript through the SecuritySpy webserver by

http://user:password@192.168.178.220:8020/++doScript?name=script.app

However this doesn't work anymore for me and the error "404 File not found"

What do I do wrong?

Comments

  • the "script.app" has been placed in the folder "~/SecuritySpy/Scripts/" and is visible for usage in the "Preferences/Cameras/Actions"

  • Sorry about this, it seems to be a bug in the latest version. This should now be fixed in the latest beta version of SecuritySpy (currently 5.4.4b1) - please test and confirm.

  • Just back from vacation and I can confirm that the latest beta version is working with executing a AppleScript.

    Thanks

  • Hi,

    Is it possible to send a GET command to start a script using a base-64 encoded username/password vs clear text as below?

    http://user:password@192.168.178.220:8020/++doScript?name=script.app

    I am successfully using base-64 username:password elsewhere in GET and POST but I have been unable to do so when invoking ++doScript. The above syntax works as expected. When push comes to shove it's not a big deal as sSpy is operating on local LAN and accessed as might be required via a VPN.


    Thank You.

  • This should be possible - use the "auth" parameter described in the "Authentication in URL" section of the Web Server Specification page. The "username:password@" method is not universally supported these days.

  • edited August 2023

    Hi Ben,

    FYI: Apparently it appears to be some weird combination of browser and ??????.

    http://192.168.0.85:8441/++doScript?name=doShell.scpt&auth=Y2pzLuckyHRsZUJpdCE=

    Above works when sending from Hubitat but not when using a browser (tried both Firefox and Safari). When sent from a browser I am confronted with a user/password login box.


    http://192.168.0.27:8441/setSchedule?cameraNum=1&schedule=1&override=0&mode=C&auth=Y2pzLuckyHRsZUJpdCE=

    Above works from Hubitat and when using either Firefox and Safari.

    Given my ultimate intent is to send GET from Hubitat server, I guess it could be said all is well. ?


    thank you

    Quick follow up. I just downloaded and installed a copy of Brave Browser. I did not modify any of the default preferences. It is a fresh install. Same result when sending GET; the user:password dialog window is presented.

  • SecuritySpy's reply to the "doScript" command is a redirect back to the "scripts" page containing the list of scripts, but this redirect won't have the auth parameter carried through. So what is probably happening when issuing this request from a browser is that the command is being accepted and executed, then the browser is following the redirect, finding it can't access the scripts page, and asking for auth. This is expected behaviour from a web browser. In contrast, Hubitat is probably simply ignoring the response, which is more appropriate for the type of application that it is. In any case, I'm glad this now does what you want!

  • As always.

    Thank You for the clarification/explanation.

Sign In or Register to comment.