The Automation and Remote Control (henceforth ARC) app allows an Android device to send various configurable commands to a PC.
For example,
if the user needs to type the same text again and again, such as the date, or a company name, or an address,
ARC can be programmed with a macro to automate this. Likewise, if
the user frequently has to manipulate applications such as spreadsheets or calendars
in a repetitive fashion, these tasks can be reduced to a single button click.
The app can be installed through the Google Play App store.
The Automation and Remote Control application is a necessary program that communicates
with ARC to provide functionality and configuration options. The Windows installer
can be downloaded here:
Once the application is installed, it should run automatically at startup.
To launch the configuration console, click on its icon in the Windows notification area:
The platform-independent version can be downloaded here, and can be launched as shown in the following Linux console.
At first, the app and console will not be able to communicate, and the console will inform
you of this with a message similar to the "No connection" error displayed here:
In this case, the Android app needs to connect using the IP 192.168.137.1.
The App can find this by using the
"Auto Scan for Server" button
or, if that doesn't succeed, by the user manually typing it into the app's "Change IP Manually" textbox. The
password and port can generally be ignored.
See Advanced for more information.
The user may change the number of buttons and their colors as follows:
-
The number of buttons may be changed using the dropdown list labeled "Total Items". The default is
two.
-
Various automatic color schemes are available in the dropdown list labeled "Auto Colors".
The default is "Random".
-
When a button is clicked, the other buttons will turn dark and the configuration options for
the selected button appear. After pressing the "Advanced" button, the color, size, and position
of the button can be set.
Basic macros allow the user to type numerous keystrokes with a single keystroke. A typical use would be
an address, a company name, the current date, or anything else that needs to be frequently typed. An example follows:
1. To set up a macro, click on the desired button. In the above picture, the top button has been selected.
2. Select "Macro" from the "Type" dropdown box.
3. Enter the desired text.
4. If desired, click "New" to add another Macro for the same button. These can be selected on
the Android device by dragging the button.
In addition to normal text sequences, a number of special tags may be used. The first set of special
keys are straightforward and correspond to keys on most keyboards.
-
The escape key.
-
The print screen key.
-
The Pause key.
-
The Backspace key.
-
The Enter key.
-
The new line character. This is similar to [enter] but can
be different depending on the system.
-
The Insert key.
-
The Home key.
-
The End key.
-
The Page Up key.
-
The Page Down key.
-
The Delete key.
-
The Tab key.
-
The open brace key: [
-
The closed brace key: ]
-
The colon key. This may be needed in rare cases,
as the [skip-to] tags require the use of the actual colon character on labels.
- , , , etc, through
The function keys, F1 through F24.
In addition to normal text sequences, a number of special tags may be used. The first set of special
keys are straightforward and correspond to keys on most keyboards.
- , , and
Simulate the respective "ctrl", "alt", and "windows" keys. They each work in the same manner. For example, to simulate ctrl-v enter:
[ctrl]v[-ctrl]
-
Simulates the "shift" key. While this can be used to capitalize a sequence of letters:
[shift]this will be written in capital letters[-shift]
...it is more typically used in combination with other keys. For example, this will open the
Windows task manager (ctrl-shift-esc):
[ctrl][shift][esc][-shift][-ctrl]
-
Moves the cursor, thus simulating the arrow keys. The following command will move the cursor
5 times to the right, 2 times up, 2 times down, and 3 times to the left.
[cursor]right 5, up 2, down 2, left 3[-cursor]
-
The [keypress] tag simulates holding down the specified keys, while [keyunpress] releases the same.
Notice that there is a 10 second shutoff for [keypress] to prevent accidentally locking up the system.
If more than 10 seconds is required, multiple instances, or the use of a [loop] tag is needed.
In the following example, the letters "abc" are repeated over and over for two seconds. There is no guarantee regarding
the order of the letters.
[keypress]abc[-keypress]
[delay]2000[-delay]
[keyunpress]abc[-keyunpress]
-
Unpresses all keys being pressed with [keypress].
-
The number of milliseconds to pause before each keystroke occurs. This does not apply to [keypress].
In the following example, the characters "1234567890" will take a total of five seconds to
be typed.
[typingdelay]500[-typingdelay]
1234567890
-
This will ignore the line breaks in subsequent text. This is important when the associated macro is
intended for automation rather than outputting blocks of text. The following example will write
the date three times with newlines following each instance, and then three times on the same line.
[date][-date]
[date][-date]
[date][-date]
[ignorenewlines]
[date][-date]
[date][-date]
[date][-date]
-
This reverses [ignorenewlines]
-
Loads a file into the current macro. In the following example, the contents of body_of_text.txt runs
in between "Header Information" and "Footer Information".
Header Information
[load]c:\data\body_of_text.txt[-load]
Footer Information
-
Defines the directory for all [load] tags. The following example works exactly as the previous. Notice
that if this is not defined, or if the file is not otherwise found, the application will also
attempt to find any [load] tag's file by looking in the directory of the configuration file.
[lib]c:\data\[-lib]
Header Information
[load]body_of_text.txt[-load]
Footer Information
-
Causes a delay for a specified number of milliseconds. The following will output the word
'start', then pause for 2.5 seconds, then output the word 'end':
start [delay]2500[-delay] end
-
For any subsequent [cursor] commands, [cursordelay] will pause a given number of milliseconds for
each cursor movement. In the following example, the cursor will move right five times, then left
two times, and take seven seconds to complete.
[cursordelay]1000[-cursordelay]
[cursor]right 5, left 2[-cursor]
-
After any tag is executed, this will pause for a given number of milliseconds. The following will
take four seconds to execute.
[tagdelay]1000[-tagdelay]
[date][-date]
[date][-date]
[date][-date]
[date][-date]
-
Delays the given number of milliseconds for every newline (enter key) encountered.
-
Works the same as [tagdelay] and [newlinedelay]. Notice that this will make the following example take
eight seconds to complete: Four seconds for the tags, and four seconds for the newlines.
[defaultdelay]1000[-defaultdelay]
[date][-date]
[date][-date]
[date][-date]
[date][-date]
-
Multiplies all other delays by the given amount. The following example will take 6 seconds to complete.
[delaymultiplier]1.5[-delaymultiplier]
[tagdelay]1000[-tagdelay]
[date][-date]
[date][-date]
[date][-date]
[date][-date]
-
The default button contains the text from the configuration. Using the [title] tag, the button
can contain custom text. The following example will override the text to "Restart Server".
[title]Restart Server[-title]
-
Stops execution of the macro. In the following example only "First Line" is outputted.
First Line
[exit]
Third Line
-
Makes a popup and pauses execution until the user presses the "Okay" button.
-
Stops the currently running macro. This contrasts to [exit] in that it causes a different
macro to stop. If a configuration has one or more long-running macros, it is a good idea for one
of the buttons to consist only of a [stop], so that any process that goes awry can be forced to quit.
It cannot be used with any other characters preceding it.
-
Pauses the current running macro.
-
Unpauses the current paused macro. It cannot be used with any other characters preceding it.
-
Pauses the current running macro, and then unpauses it on a second press. It cannot be used with any other characters preceding it.
-
Disables the given tag. In the following example, the user sees the first popup, but not the second.
[prompt-pause]
[disable][prompt-pause][-disable]
[prompt-pause]
-
Enables the given tag. In the following example, the user will see both the first and second popups.
[prompt-pause]
[disable][prompt-pause][-disable]
[enable][prompt-pause][-enable]
[prompt-pause]
-
Sets the destination of output to a file, or to the keyboard. Keyboard is the default setting.
In the first example,
all of the output will go to the file "c:\data\output.txt". Note that in this example, the file
will be cleared prior to being written to. In the second, the output will
be appended instead. In the third example, the default keyboard output will be resumed after writing to the file.
[target]file,c:\data\output.txt[-target]
This will be written to a file.
[target]file,append,c:\data\output.txt[-target]
This will be appended to a file.
[target]file,c:\data\output.txt[-target]
This will be written to a file.
[target]keyboard[-target]
This will be shown on the screen, as usual.
-
Defines how the app behaves when a button is clicked while already running. The options are as follows:
ignore
, which disregards any clicks while running; and consecutive
, as in the example, which queues multiple clicks to run one after the other.
Consecutive is the default.
[multiclick]consecutive[-multiclick]
-
This defines which tags will be followed by a newline, when they are followed by a new line in
the macro. By default, only [date] and [varout] are
configured this way. The following example is equivilent to the default setting:
[tags-with-newlines]date,varout[-tags-with-newlines]
-
Sets the ID of the tag. This is used mainly with the [page] tag. It can be any text.
[id]Button #1[-id]
-
Moves the given buttons a given number of pages. The following example will move all buttons
that have multiple pages 1.
[page]button=all,delta=1[-page]
The second example will move the button with the id "Button #1" back a single page. In addition,
the "flip" variable is set to false. This will prevent, for example, a button going from page
1 to page 3 (out of three). The default setting of "flip" is true.
[page]button=Button #1,delta=-1,flip=false[-page]
The last example sets the button to a specific page.
[page]button=Button #1,set=2[-page]
Note that when a macro uses a [page] tag, no other functionality can be used with it.
Loops, Controls, and Variables
These tags provide some programming-like features. Notice that advanced users may prefer
the
Java Integration features instead.
-
Repeats a sequence of text a specified number of times. If a zero (0) is indicated,
the loop will run infinitely, until an error occurs or [stop] command is sent. For example, the following will output
The word 'repeated' is repeatedrepeatedrepeated three times
:
The word 'repeated' is [loop] 3 repeated[-loop] three times
-
For any subsequent [loop] commands, [loopdelay] will pause a given number of milliseconds each iteration.
The following example will take five seconds to complete.
[loopdelay]1000[-loopdelay]
[loop] 5
Hello!
[-loop]
-
The [skip-to] tag moves the process to wherever the specified label is located.
[skip-to]the-end[-skip-to]
This line is NOT written.
[label]the-end[-label]
This line IS written.
-
Prompts the with a number of options. The options are defined with a word or phrase that end in a colon.
The text that follows the selected option is then processed. The option window can be configured with
the following special option:
-
pre:
This is text that is processed for every subsequent option before any of
that option's specific text.
-
post:
This is text that is processed for every subsequent option after any of
that option's specific text.
-
always-on-top:
This forces the window to be on top of any others.
-
position:
This sets the position of the window. The default is in the
middle of the screen.
-
disable-hot-keys:
This disables the hotkeys (F1, F2, etc).
The following example shows several options as well as several configuration options.
[options]
pre:
This text will be written first.
post:
This text will be written last.
position:
100/200
Write The Date:
[date][-date]
Run Test One:
[skip-to]test-one[-skip-to]
Run Test Two:
[skip-to]test-two[-skip-to]
Exit Application:
[exit]
[-options]
-
Sets a variable. The name of the variable must begin with a letter or underscore, and
the rest of the variable must consist of letters, numbers, or underscores. In the following
example, the variable "Name" is set to "Value".
[varset]Name,Value[-varset]
-
Works just as [varset] but only actually sets the variable if it hasn't been already. This
is typically used when a variable is expected to be set from the cache of previous processes
when that macro is run for the first time.
-
Outputs a variable. In the following example, the output will be "Value".
[varset]Name,Value[-varset]
[varout]Name[-varout]
-
Sets a variable to another variable. In the following example, the output is "Value".
[varset]Name1,Value[-varset]
[varset-from-var]Name1,Name2[-varset-from-var]
[varout]Name2[-varout]
-
Creates an input box allowing the user to set the query. In the following example, the user
is requested to set the "Name" variable, and that value is then outputted.
[varquery]Name[-varquery]
[varout]Name[-varout]
-
For numeric variables, adds or subtracts a value. In the following example, the number 15 will be outputted.
[varset]Name,20[-varset]
[varmod]Name,-5[-varmod]
[varout]Name[-varout]
-
Clears a variable.
-
Defines the scope of the variable. A global variable is available to all configurations. A common variable is available
to all buttons of the same configuration. A normal variable is only available to the button in which it is defined. The follow
example shows each. Note that 'normal' is the default scope.
[varset]key1,value1,normal[-varset]
[varset]key2,value2,common[-varset]
[varset]key3,value3,global[-varset]
-
Changes the default scope. In the following example, the default is changed to global.
[default-var-option]global[-default-var-option]
-
Similar to [varset], [def] allows any text including other macros. It is not cached and so must be
defined in every macro in which it is used. It is best to keep commonly used [def] instances in a file
that can be reused by different macros with [load]. In the following example a letter template is
outputted, and the
cursor is placed in the empty body.
[def]letter
[date]MMM dd, YYYY[-date]
[varout]username[-varout]
ACME Corp
444 Industrial Way,
Chicago, IL
Sincerely,
[varout]username[-varout][cursor]up 3[-cursor]
[-def]
[varset]username,John Doe[-varset]
[defout]letter[-defout]
This allows using Java code from a macro. The user should have a basic command of
the Java programming language.
-
Used in a minimal way, any code between the [java] tags is inserted in the main(String args[]) method.
In the default configuration, all text that goes to System.out will be outputted as macro text. So this
example...
[java]
System.out.println("Hello World!");
[-java]
...is equivilent to the following code:
public static void main(String args[])
{
System.out.println("Hello World!");
}
...with "Hello World!" comprising the text of the macro.
-
In the next example, a static method and class
are placed in a [body] tag. The text in the [main] tag goes to the main() method. If a [body] tag
is used, the [main] tag must also be used. The resulting output will be "Here's my new object: Hello World!".
[java]
[body]
private static class TestObject
{
public String toString()
{
return "Hello world!";
}
}
private static void makeAnObject()
{
TestObject obj=new TestObject();
System.out.println("Here's my new object: "+obj);
}
[-body]
[main]
makeAnObject();
[-main]
[-java]
-
The variables defined with the [varset] tag are automatically integrated into all generated Java code. Setters and getters
are created and any changes to the associated variables will be preserved once the [java] tag process finishes. In the following example,
the variable "var1" is defined, then changed. The output from this example is:
Here's my new object: Hello World!
Goodbye World!
In addition, the [settings] tag allows configuring the process in various ways. If a [settings] tag
is used, a [main] tag is required. In this example the
"showcode" setting is changed to "true" which will popup the generated Java code for debugging purposes.
The "showerrors" setting is also changed to "true" which will popup any data sent to the System.err PrintStream.
Also included is the "fastmode" setting. In the default compilation process, two variables, "line" and "loop"
are set by default. These simply indicate the line of the [java] tag and the progress of any ongoing
loops. In "fastmode", these variables are omitted, allowing a better chance that re-compilation won't
be necessary.
[ignorenewlines]
[varset]var1,Hello World[-varset]
[java]
[body]
private static class TestObject
{
public String toString()
{
return getVar1();
}
}
private static void makeAnObject()
{
TestObject obj=new TestObject();
System.out.println("Here's my new object: "+obj);
}
[-body]
[main]
makeAnObject();
var1="Goodbye World!";
[-main]
[settings]
showcode=true,
showerrors=true,
fastmode=true
[-settings]
[-java]
[enter]
[varout]var1[-varout]
-
Additional settings include 'runmacro' which by default is set to true. Turning this to false allows
testing compilation or other issues without the risk of running the actual macro. The 'template' setting
will be covered in the next section.
In addition, the [import] tag may be used to include standard Java import statements. If
an [import] tag is used, the [main] tag is required.
Also note that numbers
work as expected. All numbers formatted with a decimal point become Double objects, with all others becoming
Long objects.
[ignorenewlines]
[varset]var1,Hello World[-varset]
[varset]number1,1[-varset]
[java]
[import]
import javax.swing.*;
[-import]
[body]
private static class TestObject
{
public String toString()
{
return getVar1();
}
}
private static void makeAnObject()
{
TestObject obj=new TestObject();
JOptionPane.showMessageDialog(null,"Here's my new object: "+obj);
}
[-body]
[main]
makeAnObject();
number1++;
[-main]
[settings]
showcode=false,
runmacro=true,
template=c:\temp\myTemplate.java
[-settings]
[-java]
[enter]
[varout]var1[-varout]
[enter]
[varout]number1[-varout]
-
If the template setting is used, as in the previous example, the file it points to will override the internal template used to
generate code. The internal template is as follows, and the basic structure of any overriding template must be the
same.
_IMPORT
public class _CLASS
{
_BODY
_VARIABLES
public static void main(String args[])
{
_MAIN
_END
}
}
-
Notice that when the source code is generated, variables that are otherwise valid can cause
compilation errors due the creation of identical getters and setters. The following
example will fail as two instances of "setKey" and "getKey" will exist.
[varset]key,val1[-varset]
[varset]Key,val2[-varset]
[java]
System.out.println("Hello World!");
[-java]
-
This allows configuring the app to take screenshots automatically at specified tags.
In this example, tags generate screenshots while blank lines and [mouse] movements do not. The
delay of 200 milliseconds occurs after the event and before the screenshot is taken.
[screenshots]skipblanks,skipmousemovement,c:\temp\screenshots,delay=200[-screenshots]
First Line
[leftclick]
[openbrace]
[closedbrace]
LastLine
In this example, screenshots are disabled.
[screenshots]none[-screenshots]
-
Sets the location in which the screenshot files will be saved. If this is not set, the
directory of the configuration is used. This tag isn't necessary if a directory is
set by [screenshots]. In the following example, the directory is
set to c:\screenshots
[screenshot-directory]c:\screenshots[-screenshot-directory]
-
Takes a single screenshot.
-
This creates a webpage using the previously generated screenshots. The webpages can
be observed without a server or additional tools. The following simple example creates
a webpage with images scaled to 800/600, and can be seen here. Press
"next" or "previous" to see the steps of the script. The
optional browser parameter automatically loads the webpage.
[ignorenewlines]
[command]erase c:\temp\screenshots\* /Q[-command]
[screenshot-directory]C:\temp\screenshots[-screenshot-directory]
[screenshots]every-line,skipblanks,c:\temp\screenshots\[-screenshots]
First line
[enter]
[loop] 4
Top of loop[enter]
[loop] 2
Second line [varout]loop[-varout]
[enter]
[-loop]
[-loop]
Last line
[screenshots-webpage]dimensions=800/600,browser=C:\program files (x86)\Mozilla Firefox\firefox.exe[-screenshots-webpage]
-
This will take a screenshot when a key or mouse event is detected. In the following example, screenshots
will be taken infinitely, until a [stop] command is sent from another button, after which a website
of all the images will be created.
[screenshot-directory]C:\temp\screenshots[-screenshot-directory]
[loop] 0
[screenshot-on-event]
[delay]25[-delay]
[-loop]
[onexit]
[screenshots-webpage]dimensions=800/600,browser=C:\program files (x86)\Mozilla Firefox\firefox.exe[-screenshots-webpage]
[-onexit]
Shortcuts are various pre-set macros that perform common functions, such as Navigating back
in a web browser, showing the desktop, bringing the mouse to the center of the screen, etc.
Application Launching runs an executable or batch file in the normal manner. Many common
applications are included, such as Firefox, Chrome, notepad, etc. Notice that the supplied
directories and filenames are typical defaults, and don't necessarily correspond to every system.
This allows using your device as a touchpad. It can be configured to disable clicking, and
to multiply the movement speed.
Saving And Uploading
An uploaded configuration must correspond to a configuration on your PC. By pressing the
"Save and Upload" button, the Console will automatically update the saved copy of your configuration,
or ask you to give it a name if you haven't done so. In addition, the "Save" button will save
your configuration without uploading it.
As seen in the
initial screenshots of the console and app,
the user can optionally set a password and a port. The port should not be changed unless another
application requires the default (15222). In any case, the port and password of the console must
match those of the app. If the port is changed, the app and console must
be completely restarted.