I explain the approach I am using but this is work in progress.
The basic principle is to use an intermediary application which “drives” the target application in “autopilot mode” through a combination of targetting windows, images or key sequences. The user is out of the interaction.
In some situations the user might be prompted to take a decision.
The choice of automation tool depends on the host OS. Some tools work only in Windows, others only in Linux, and some work across platforms. The scripts written will depend on syntax of the OS (e.g. Windows file paths vs. Linux file paths).
I have dual boot Windows and Ubuntu where Ubuntu 16.04 is my OS of choice.
The tools I have looked at are:
AutoHotKey is a Windows only tool not of use to me as a Ubuntu user but I see that there is now IronAHK which is cross platform.
I pursued, only today as I write this, the alpha release of
Note that this is a 389 Mb installation and you might choose to defer this route and try Actiona first.
I installed Mono today as part of my experiment in
Atom < -- > VS Code and then tried the Mono hello world example.
This creates hello.exe which I could run in Ubuntu by the command …
That is as far as I have got with the AutoHotKey/Mono route.
This blog suggests that this route (in Linux) is experimental
Returning to my main preferred tool Actiona I compiled a script to run hello world in VS Code from Atom.
Actiona has one distinct advantage when running in Atom.
Actiona compiled scripts have extension *.ascr which in fact is XML format and can be viewed in Atom and even edited from within Atom if tweaks in script dialogue embedded text are required.
Assuming that we have dual windows (sessions) of Atom and VS Code running the script runs through these actions.
From Atom run script by the command …
The script is run using a command in process-palette.
Within yourautomationscript.ascr are these actions …
command > code -n args
This launches a new session of VS Code open at the file defined in args.
Start by launching Actiona GUI.
If Docky is installed GUI icon is seen alongside Atom and VS Code sessions.
The first action we will create in GUI is Command.
Input parameters are:
… note: do not add any args to this command line
… note: the file path is your choice from your Atom files directory
Next we might add a Pause action of a few seconds to allow VS Code session to be initiated.
When this script is tested by clicking in Actiona GUI we see a new session of VSCode being launched and the contents of file README.md is seen in VSCode window.
We might add to the script a Message Box to explain to the user the next steps. This can be useful when we are using Actiona to walk the user step-by-step through a workflow (instead of the common practice of using animated gifs or video tutorials).
Let us now try to automate the launched VS Code window.
The most effective way of automating the target window is through key sessions.
The action to use in the script is Device > Key where multiple key sequences can be defined.
One obstacle is the use of external applications such as Nautilus. For example in opening folders and files we must use Nautilus. Added note: I now see a way around this.
If a key sequence is not available for a particular VS Code action we can create a target image (such as a button or icon) to search for. For this we use the Window action which can target attributes such as window name.
Ensure that VS Code window is maximised otherwise some icons leaking out of background windows (such as Atom) might confuse the actionscript operating on VS Code window, particularly if images are targetted.
Leverage VS Code command line options https://code.visualstudio.com/docs/editor/command-line which are easier to automate than targetting images.
After creating the Actiona script it can be run from within Atom by using the command
Such commands can be launched through Atom
script. That is, the Actiona GUI is only used when creating and testing the automation script.
This is a very basic example or Atom to VSCode communication. Much more advanced interactions can be created.
I am creating a library of such actionscripts. Indeed some scripts might be applied to Atom.