documentation:Plug_In_Actions
Differences
This shows you the differences between two versions of the page.
| documentation:Plug_In_Actions [2016/05/30 06:42] – created peternlewis | documentation:Plug_In_Actions [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Plug In Actions ====== | ||
| - | |||
| - | Keyboard Maestro has support for user written and contributable plug in actions. | ||
| - | |||
| - | A Third Party Plug In Action consists of a folder with a name (which should generally closely match the action name), and must be made up of only ASCII alphanumerics, | ||
| - | |||
| - | The folder contains a set of files, including: | ||
| - | |||
| - | * Keyboard Maestro Action.plist – an XML file describing the action. | ||
| - | * A script file whose name must be made up of only ASCII alphanumerics or underscores, | ||
| - | * An optional 64x64 png icon. | ||
| - | |||
| - | The format of the Keyboard Maestro Action.plist is a Cocoa property list containing a dictionary with the following keys and values: | ||
| - | |||
| - | | Name | the name of the action (which appears in the Category/ | ||
| - | | Script | the name of the script, made up of only ASCII alphanumerics or underscores, | ||
| - | | Icon [optional] | the name of the icon png file, made up of only ASCII alphanumerics or underscores plus .png | | ||
| - | | Title [optional] | the title displayed on the action, which can include %Param%XYZ% tokens. It should usually not include other tokens. If it is missing, the Name will be used | | ||
| - | | Timeout [optional number] | the default timeout in seconds. Set it to 0 if the action needs no timeout. | ||
| - | | Author [optional] | the author of this action | | ||
| - | | URL [optional] | a URL for the author or this action | | ||
| - | | Help [optional] | a short (Tool Tip) explanation of this action | | ||
| - | | Results [optional] | what to do with the output of the script if any. Possible Values: None, Window, Briefly, Typing, Pasting, Variable, Clipboard – multiple values can be used, seperated by a bar (%%|%%), the first specified value is the default | | ||
| - | | Parameters [optional] | an array of parameters to the script, each entry is a dictionary as described below | | ||
| - | |||
| - | Each parameter in the Parameters array is a dictionary with the following keys: | ||
| - | |||
| - | | Label | the name of the parameter. The same rules as Keyboard Maestro Variable Names apply. The label is displayed to the user and used to pass the parameter to the script. Obviously, the label must be unique amongst all parameters | | ||
| - | | Type | the type of the parameter. Possible Values: String (single line), TokenString, | ||
| - | | Default [optional] | the default value when the action is created | | ||
| - | | Menu [required if Type is PopupMenu] | the values of the popup menu, separated by %%|%% | | ||
| - | |||
| - | Warning: Keys are case sensitive. | ||
| - | |||
| - | Parameters are passed to the script via environment variables with names starting with KMPARAM‗ similar to how variables are passed to shell scripts with the Execute Script action. | ||
| - | |||
| - | <code applescript> | ||
| - | set myText to do shell script "echo $KMPARAM‗My‗Text" | ||
| - | </ | ||
| - | |||
| - | In normal use, once a plug in action is read, it will stay in memory and changes will not be noticed (although the script will be executed each time, so changes to that will be noticed). | ||
| - | |||
| - | <code applescript> | ||
| - | tell application " | ||
| - | tell application " | ||
| - | </ | ||
| - | |||
| - | Keyboard Maestro Plug In Actions go in the FILE{{{~/ | ||
documentation/Plug_In_Actions.1464590521.txt.gz · Last modified: by peternlewis
