What is Surroga?

Surroga can be downloaded on AppStore. We continue to make Surroga the best automation utility ever to fit you needs. We need you help to shape the future direction of new features and improvements. If you have any comments about Surroga, please feel free to let us know. We will reply every feedback email.
- What is Surroga?
- Script
- Statement
- Actions
- Variables
- In-App Purchases
- Privacy & Security
- Privacy Statement
What is Surroga?
Surroga is a keyboard & mouse automation utility for macOS.- Send keystrokes or typing.
- Move, click, and drag anything via mouse.
- Calculate numbers.
- Text recognize & process.
- Image recognize & click.
- Flexible screenshots.
- Flexible copy & paste.
- Conditional delay.
- Open 3rd-part Apps.
- Call terminal commands.
- Nested scripts and loops.
- Variables
- Conditions
- Programmable UI, include sound, flash-screen and pop-up.
Script
To remove a script, select it via the script list at left sidebar, then press the DELETE key on the keyboard. Or, click the script via the mouse right button, the click the Delete option in the context menu.
Select a script, then click , choice Share or Share as Protected.
The protected script is not editable, and will not create the logs.
Statement
Statement group expressions and control the flow of execution.
Sort Statements
Drag the statement via mouse to change its order in the statement queue.
Delete a Statement
In the script editor, click a statement via the mouse right button, the click the Delete option in the context menu.
By default, one statement include only one action. When a statement is executed, this action will be executed.
On the other side, we can insert an IF sub-statement into a statement. The IF sub-statement is consist of one or more Conditions. The action of the statement, so called THEN sub-statement, will be executed only when all conditions are true. In the other words, all conditions are AND conditions.
By default, one statement include only one action. After some conditions are inserted into this statement, the original action of the statement, now is called THEN sub-statement.
The action of the statement, so called THEN sub-statement, will be executed only when all conditions are true.
If Conditions are false, then execute the ELSE statement (just one action).
Surroga doesn't support LOOP statement yet. Instead, it support flexible repeating at script level.
To initialize a loop, consider two scripts, main and sub-script. In the main script, we initialize the variable name VAR by assign a value(1) to it before call the sub-script. In the sub-script, it increase the VAR by 1 each time, and repeat until VAR is greater than 5. Surroga ship with a on-board script named "Counting". To view the results of this script, open a window that support text inpurt (typing keys), the click the system status bar -> Surroga -> Run -> General -> Counting.
RETURN statement will abort the current script, and return to its parent script.
RETURN statement doesn't returns any value to its parent script. Instead, if we want to do this, assign the value to one of variables before return, then read the value of the variable in the parent script. In Surroga, the scope of variables are global. Variables are shared by all scripts.
In Surroga, it is implemented as an action.
EXIT, also called ABORT, END or STOP statement. This statement only only abort the running of the current script, but also its parent script, ..., parent of parent. Finally, it abort the 'Root' script.
In Surroga, it is implemented as an action.
Actions
Type a keystroke.
Enter some text by send keystrokes automatically.
Move the mouse cursor to
- text in window / on screen.
- color in window.
- image in window.
- point at screen or in window.
- relative to the current position.
Click the mouse button at the calculated position.
- Click on text in window / on screen.
- Click on color in window.
- Click on image in window.
- Click at point in window / on screen.
- Click at the current mouse cursor position with offset.
Match Precision
The different matching precisions are used when search colors or images in window / on screen:
- Exact:strict, minimum results, fastest, gives a chance to miss.
- Recommended
- Loose:maximun results, slowest, gives a chance to get wrong results.
To accelerate the image recognizing,
- We should use the smallest size of the sub-image to search for. The suggested size is 32 X 32.
- The sub-image should contains unique content other than the remains in the original image
- The color of the top-left pixel of the sub-image should be the least color in all pixels of the original image.
Search Region
Specify the search region to speed up the search and boost the precision. It also be used to distinguish the similar or same target objects in the visual content.
If we look at the whole area as a nine-square grid
↖️ | ⬆️ | ↗️ |
⬅️ | ❤️ | ➡️ |
↙️ | ⬇️ | ↘️ |
then define search regions:
- All
- Upside: at top, 1/3 of height, full width.↖️⬆️↗️
- Center: at center, 1/3 of height, full width.⬅️❤️➡️
- Downside: at bottom, 1/3 of height, full width.➡️⬇️↘️
- Top Left: 1/9 in size↖️
- Top Right: 1/9 in size↗️
- Bottom Left: 1/9 in size↙️
- Bottom Right: 1/9 in size↘️
Take a screenshot of screen or window.
We can specify the content to capture:
- Entire Screen
- Selected Portion of Screen
- Selected Window.
- Selected Portion of Selected Window
We can also specify the position of the origin of the portion. For a frame which size is (100,100):
- the top-left corner of the window: (0, 0, 100, 100)
- the top-right corner of the window: (-100, 0, 100, 100)
- the bottom-left corner of the window: (0, -100, 100, 100)
- the bottom-right corner of the window: (-100, -100, 100, 100)
Window Title
The most macOS app shows more than one windows at the same time. For example, if we click the about option of an app, this app will shows at least two windows, the main window and the about window. For Safari, every Tab own its window. We can specify the Window Title to distinguish these windows. For Safari, the window title, in most cases, is the title of Tab.
Optimize Performance
There are some tips to optimize the performance when capture screen content.
- Choice optimized for Performance instead of Quality.
- Reduce the size of the target window as possible. The best way is expose the target region to capture only.
- Output the captured image to Variables instead of Pasteboard.
Recognize text from image. No matter where that image comes from.
Obviously, it's possible for an image to contain more than one piece of text. So, the results of recognizing-text is array of text that encoded as a JSON string, instead of just one text in a basic variable. For example, for an image that only contains a number, 32, this actions returns the array "[32]". Next, use Decode Array from JSON action to get the array [32]. Then, use Get the First Element in Array action to get 32。
Pop-up a modal dialog.
Send a local notification that showed on the current device. Notifications are used to show the status of running script, or notify users to do necessary operations.
Variables
A variable is a container used to store content such as text, number, or image. Variables will make your scripts more powerful and flexible.
Variable, Array & Dictionary
There are three kinds of variables are supported in Surroga.
- Variable: Basic variables also called general-purpose variables. They are used to store text, numbers and images.
- Array: Array is an ordered series of elements. We can get or set the element by its index in an array.
- Dictionary: Dictionary is a collection whose elements are key-value pairs. We can use a key to retrieve the corresponding value, which can be any object.
In Surroga, the scope of variables are global. Variables are shared by all scripts.
In-App Purchases
Paid features include:
- Variables
- Calculate
- Conditions
- Control Flow(IF/ELSE/RETURN, etc.) & Error Handling
- Export & Import
For example, when insert a new action into script, some actions in the candidate action list are disabled for picking. It means these actions are paid features. They will be unlocked after payment.
Non-Consumable vs. Subscription
Monthly-Subscription, Yearly-Subscription and Pro shared the same features but payment. Both of three unlock all features. Subscriptions are for monthly or yearly. Pro is lifetime.
Nothing happen after payment?
Surroga embedded a built-in shop from Apple that fully maintained by Apple. If the payment was completed, Apple should tell the application when network available. There are some sugguestions below:
- Restart Surroga and try again when network available.
- Click the Restore button in the built-in shop in application.
Privacy & Security
Surroga can perform lots of tasks of applications and control your Mac. As such, it needs your security permissions to do these jobs for you. These permissions may vary according to different macOS versions. In most cases, the app will need ask for these permissions at the Privacy & Security at the System Settings.
Accessibility
Allows control of your mouse and keyboard, and monitoring your mouse and keystrokes. It is required for following app features:
- Automate a keystorke
- Automate a mouse movement/clicking/dragging
Screen Recording
Allows capture the screen. It is used for following app features:
- Automate to capture the user-specified window/screen.
- Automate to text recognize on the user-specifed window/screen.
- Automate to click the user-specified text/image on the user-specifed window/screen.
- Automate to search the user-specified window/screen for the user-specified image/text/color.
Privacy Statement
Data Not Collected.
The developer does not collect any data from this app.
Which app features will use screen recording?
- Automate to capture the user-specified window/screen.
- Automate to text recognize on the user-specifed window/screen.
- Automate to click the user-specified text/image on the user-specifed window/screen.
- Automate to search the user-specified window/screen for the user-specified image/text/color.
Accessibility and Screen Recording permissions are needed to implement the essensial features of this app. The storken keys or screenshots are automated by the user's own, and never send to the developer. Please visit Privacy & Security for more infomation.
What data does your app collect via screen recording?
The data, user-specified image or text, was recorded by the user's own willing. No data was collected by this app or the developer.
For what purposes are you collecting this information? What plan for uses of this data.
No data was collected by the developer. No plan to use.
Will the data be shared with any third parties?
No.
Where will this information be stored?
This information was stored in device RAM. It will lost if app quit, or device shutdown/reboot. If the users choice output the data to system pasteboard, then they can visit macOS system instead of this app.