Skip to content

Getting started

Hoai Phuoc Truong edited this page Nov 26, 2022 · 15 revisions

Getting Started

This is a guide (not comprehensive) for most basic features of Repeat.

The UI

Once launch, the program will host a local web server at port 65401. Note that this server is only hosted locally and is not visible to other machines in the same network.

To make this server accessible from another machine, consider using port forwarding. Simplest port forwarding method is to use SSH.

Note that the program will also launch a tray icon like below

tray_icon

On the program home page, there are three main sections:

Code section

This section is for writing new tasks and viewing code of existing tasks. For more information about different coding languages that Repeat supports, see the languages page. The default coding language is "manual". With this code language, the task will be built out of the UI provided:

code_section

If the coding language is something else, there will be a simple text editor section:

code_section

Editing code

The default coding language is "manual", which is a simple UI driven way to construct simple tasks that don't involve too much logic. If more complex logic/operation is required for the task, see languages page for how to switch between languages.

The UI provides a primitive editor to edit code. However, as the code grows more complex, we can use a custom editor to edit the code. Simply click on the custom editor button custom_editor to open the default editor depending on the language file extension. For Java, the extension is .java, for Python the extension is .py, and for C# the extension is .cs.

Once you've finished editing, use the reload button reload_editor to reload the text into the browser.

Task section

This section is for managing existing tasks and quickly view their assigned activation hotkeys.

task_section

Log section

This section is for viewing log messages. This includes info and error messages. Most error messages are shown in this section.

log_section

Record & Replay

Mouse and keyboard activities can be recorded via the UI. Recording & playback

There are the following options when replaying the recorded task:

  1. Replay n times.
  2. Add delay between replays.
  3. Speed up replays (entering a number smaller than 1 means slow down).
  4. Only record mouse clicks (i.e. ignore mouse movement). This is useful when recording long actions in which mouse movements are not used most of the time.

To generate source code out of a recorded action, choose Tools --> Generate source on the top right drop down menu. Once the source code has been generated, you can use the Creating and managing tasks section below to save the task.

Creating and managing tasks

Task can be created by first compiling compile_task the source code, then add add_task the compiled task to the current task group (see Groups section below).

Once a task has been added to the task section of the main page, it can be renamed by clicking the "Name" column of the task row. The task can also be enabled/disabled by clicking the "Enabled" column of the task row.

A task can be invoked directly by selecting the run button run_task_button. The popup will ask for run details (e.g. run for how many times, with how much delay between runs, ...)

Finally, the task activation can be configured by clicking the "Activation" column of the task row. See the Task Activation section for more details. add_task

If you need more space to see the task list, click the "expand/shrink" button task_expand_shrink

Task activation

Task activation specifies different ways a task can be invoked. A task may have multiple activation methods. Each activation method has its unique benefit and drawbacks, and can be combined so that different tasks can work together seamlessly.

Preconditions

Preconditions describe the necessary conditions for a task to start. Preconditions are always checked first, and if the conditions aren't met, the task won't be run (regardless of whether other task activations are firing).

This is very useful when you only want a task to run on a specific window/application.

To know the exact name of the active window and processes (or application in Mac), use this button task_expand_shrink. Once you've clicked the button, the active window name and active process name will be logged. You can then copy these names to set the precondition section. Note that not all characters are printable on the web page, so if you have special characters in your window name a simple copy paste may not work. In this case, we should just copy the unique part of the window name that doesn't have any special characters to use as preconditions.

Key chain

A good way to think of key chain is similar to how we press Ctrl+Alt+Del. Take the key chain "A + B + C" as an example. While pressing a key chain A + B + C, all previous keys must be held down before the next key is pressed (e.g. A must be held down when B is pressed, and A and B must be held down when C is pressed) for the key chain to be registered.

A key chain can have one key (i.e. equivalent to a regular key press), or multiple keys. However, most keyboards can only have certain amount of keystrokes be recognized at once. See Rollover for more details.

For key chain with a lot of keys, considering using key sequence (below) instead.

Key sequence

Key sequence is simply a sequence of keys pressed in an order. For example, "A + B + C" key sequence would be invoked after typing the string "abc". Key sequence is different from key chain that the previous key(s) do not need to be held down when the next key is pressed for the sequence to be registered.

Global key actions

This invokes the task on all keystrokes events from the keyboard. There are "key pressed" and "key released" events to be listened to.

Shared variable

Shared variables are variables maintained in the global space. All tasks can read from and write to all shared variables. Assigning a shared variable to task activation means that the task will be invoked when the value of the shared variable is written to (regardless whether the new value is the same as the old value).

This is particularly useful for some common scenarios:

  1. One task can invoke another (i.e. by having one task set a variable and configure another task to be invoked on the same variable).
  2. An external process can invoke the task without any keyboard or mouse input. Since Repeat binary also acts as a CLI, we can use this to set the value of a shared variable to invoke a task. This can happen in the background, or happen as a network event not triggered by keyboard/mouse.

For more information about usage of shared variables, see Shared variables page.

Phrase

A phrase is a string when typed will invoke the task. Note that this only applies to type-able strings. This would not work with strings containing empty characters or those that cannot be typed using the keyboard.

Mouse gesture

Mouse gesture contains several predefined gestures that can be recognized to invoke a task. The default key to start recognizing the mouse gesture is CapsLock. Hold down this key and start drawing using the mouse, then release the key to finish the gesture. If the gesture is recognized, the task will be invoked.

Task Groups

Task groups make it easier to manage tasks when there are too many of them. All tasks in a task group can be enabled/disabled together, making it easy to manage. We can quickly switch between task groups using the drop-down on the main page.

task_groups

Clicking on the task group button (on the left of the drop down) will bring us to the task group page, in which we can rename, enable/disable, add/delete, or rearrange groups.

To move tasks between groups, use the change group button change_group.