PHP & UI Vision RPA


I’ve been using iMacro along with PHP for a few years now to do some browser automation. Now I want to use UI Vision, but I can’t open the browser with PHP:

private $pathToLog = "C:\\iMacros2\\imacros-error\\log.txt";
private $pathToApp = "C:\\iMacros\\App2";
private $pathToRun = "\\";
private $pathToBrowser = "C:\Program Files\Google\Chrome\Application\chrome.exe";

// create TmpMacroFile
$tmpMacroFile = $this->createTmpMacroFile();

$cmd = 'start "' . $this->pathToBrowser .  '" "file:\\\\' . $this->pathToApp . $this->pathToRun . '?macro=' . $tmpMacroFile . '&direct=1&savelog=' . $this->pathToLog . '"';
$output = exec($cmd);

// delete TmpMacroFile

Currently, the script runs successfully, but no browser opens (at least not in the foreground). The script runs on a WindowsServer2016

Is there a way to run the macro visible in Chrome with PHP on Windows Server 2016? With iMacro this was possible with the function new COM(“imacros”);

With the Ui.Vision command line the calling script (here: your PHP script) needs to run in a regular user account and not e. g. started as a Windows service.

The way I do it is - for example with task scheduler:

  • Create an Autologin for the server

  • Then, in task scheduler, use “Run only when user is logged on”

  • Also check “Run with highest privileges’” (not really needed I think, but I check it)