Macro
Overview
You can automate series of tasks by writing macros. Macros are written in JavaScript and executed in SmoothCSV Application.
Macros would be executed through Rhino, which is an implementation of JavaScript written in Java.
There are basically 2 ways to create macros.
- Record keys
You can record series of keyboard commands by selecting the menuStart Recording Macro
. Then selectStop Recording Macro
to stop recording. It will generate JavaScript code and you can see it in theMacro Editor
panel. - Manually write codes in JavaScript
You can write macros inMacro Editor
panel.Macro Editor
panel will be shown by selecting the menuToggle Macro Tools
.
Global Variables
You can use the following global variables.
- App (class)
A class that represents the application itself. - Clipboard (class)
A class that provides static methods to access the OS’s clipboard. - Window (class)
A class that provides static methods to show dialogs. - CsvProperties (class)
A class that represents CSV Properties. - Macro (class)
A class which encapsulates macro script. You can call another macro from a main macro through this class. console
(the instance of Console)
A object which is very similar to browsers’ console API.console
has a methodlog
that outputs its arguments to SmoothCSV’s console.
Global scope itself can be accessed by the name global
.
Macro API
Note: SmoothCSV’s macro APIs are implemented in Java, though macro scripts themselves are written in JavaScript.