I am trying to automate an Automise-script from a web server running on the same machine.
What I am trying to do is to control our entrance door from a button on the intranet page. The computer is running the access card software, and has a GUI element to open the entrance, normally controlled by a receptionist or similar. Automise works great when I run the script from the machine directly, but when I try to execute ATCMD.EXE from a PHP system()-call I get the following output:
The application is not currently logged onto a desktop. You will need a desktop login session in order to use the GUI Automation actions.
I was hoping this would work as the machine is logged on and running the appropriate software, but it seems like these two sessions are not connected. Is there any other way I can trigger Automise in the current running session?
Thanks for your post. Sounds like a great project for Automising. :-).
The problem isn’t the Automise session, it’s that PHP is running in the context of a web server service and therefore can’t see the desktop session.
Probably the best solution is to use some kind of intermediary to communicate between the web server and the desktop login session. One way would be to have the Automise project already running, using a Wait For File action to wait on a particular file name. Then the PHP script can just create the file, which will trigger Automise to keep running. Automise can then delete the file after the operation is complete, and loop around to wait on the file name again.
Thanks, that worked great! The PHP script now uses touch() to create a file, and Automise picks up on it quickly and executes the rest of the script.
At the same time I get a semaphore that I can check for, and make the PHP script display a message if someone else has clicked the door open button already. (Using file_exists to check)