manual:Plug_In_Actions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| manual:Plug_In_Actions [2021/06/02 04:13] – [PIA PList] Convert to lists in table cells JMichaelTX | manual:Plug_In_Actions [2023/10/06 06:28] (current) – [Retrieving Parameters in a Script] peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Plug In Actions ====== | ====== Plug In Actions ====== | ||
| - | You can develop custom [[: | + | You can develop custom [[: |
| - | ===== Third Party PIAs ===== | + | ===== Third Party Plug In Actions |
| - | You can download | + | You can download |
| - [[https:// | - [[https:// | ||
| - [[https:// | - [[https:// | ||
| Line 11: | Line 11: | ||
| ===== How to Install ===== | ===== How to Install ===== | ||
| - | PIA Install Files are `.zip` Archive Files | + | Plug In Action |
| - **Initial Install:** Drop on the Keyboard Maestro app Dock icon | - **Initial Install:** Drop on the Keyboard Maestro app Dock icon | ||
| - | * This will create a PIA sub-folder by the same name as the `.zip` file | + | * This will create a Plug In Action |
| * Do _not_ unzip the file | * Do _not_ unzip the file | ||
| - | - **To Update** An Existing | + | - **To Update** An Existing |
| - | - First Manually Delete or Move the PIA Sub-Folder from:\\ FILE{{{~/ | + | - First Manually Delete or Move the Plug In Action |
| - Then Drop the `.zip` file onto the Dock Icon | - Then Drop the `.zip` file onto the Dock Icon | ||
| - | ===== How To Use a PIA ===== | + | ===== How To Use a Plug In Action |
| _Plug In Actions_ are used just like the built-in Keyboard Maestro [[: | _Plug In Actions_ are used just like the built-in Keyboard Maestro [[: | ||
| - | After you have installed a PIA, you may need to restart both the Keyboard Maestro Editor and Engine in order for the new PIA to be recognized by Keyboard Maestro. | + | After you have installed a Plug In Action, you may need to restart both the Keyboard Maestro Editor and Engine in order for the new Plug In Action |
| - In the Keyboard Maestro Editor, goto _File > Quit Engine_. | - In the Keyboard Maestro Editor, goto _File > Quit Engine_. | ||
| - Quit and re-launch the Keyboard Maestro Editor. | - Quit and re-launch the Keyboard Maestro Editor. | ||
| - | To insert a PIA into your Macro, use any of the normal methods to insert Actions: | + | To insert a Plug In Action |
| - Display the _Actions Panel_ from the menu or with the shortcut ⌘K, and select the _Third Party Plugins_ folder: | - Display the _Actions Panel_ from the menu or with the shortcut ⌘K, and select the _Third Party Plugins_ folder: | ||
| - | * {{ : | + | * {{: |
| - Menu _Edit > Actions > Third Party Plugins_ | - Menu _Edit > Actions > Third Party Plugins_ | ||
| - _Insert Action by Name_, using shortcut ⌘⌃A. | - _Insert Action by Name_, using shortcut ⌘⌃A. | ||
| - | Enter the PIA form fields (parameters) that are shown on the action form. | + | Enter the Plug In Action |
| - | ===== Building a PIA ===== | + | ===== Building a Plug In Action |
| - | ==== How to Create a PIA ==== | + | ==== How to Create a Plug In Action |
| - | There is no easy way to create a _Plug In Action_. | + | There is no easy way to create a _Plug In Action_. |
| * [Fixed Wait for Safari to Finish Loading Plug In Action ](https:// | * [Fixed Wait for Safari to Finish Loading Plug In Action ](https:// | ||
| - | **Steps to Create a PIA** | + | **Steps to Create a Plug In Action** |
| - | - **Folder: | + | - **Folder: |
| - | - **Plist: | + | - **Plist: |
| - | * See [[Plug_In_Actions# | + | * See [[Plug_In_Actions# |
| - | * The PIA Plist is an XML which defines the Action form you see in the Keyboard Maestro Editor, and identifies the name of the script file that will be run when the PIA is executed in a triggered macro. | + | * The Plug In Action |
| - | - **Script: | + | - **Script: |
| - **Icon: | - **Icon: | ||
| - | - **Zip Install File:** When you are finished with all of these files, create a `.zip` archive from the PIA Folder. | + | - **Zip Install File:** When you are finished with all of these files, create a `.zip` archive from the Plug In Action |
| - | ==== PIA Folder ==== | + | ==== Plug In Action |
| - | **A _Plug In Action_ is Contained in a Folder**,\\ **Whose Name:** | + | **A _Plug In Action_ is Contained in a Folder**, **Whose Name:** |
| - Should generally closely match the action name | - Should generally closely match the action name | ||
| - Must be made up of only ASCII alphanumerics, | - Must be made up of only ASCII alphanumerics, | ||
| Line 59: | Line 59: | ||
| - Is stored in the Keyboard Maestro Macros.plist to reference the plugin action. | - Is stored in the Keyboard Maestro Macros.plist to reference the plugin action. | ||
| - | **The PIA folder contains a set of files, including: | + | **The Plug In Action |
| - Keyboard Maestro Action.plist – an XML file describing the action. | - Keyboard Maestro Action.plist – an XML file describing the action. | ||
| - A script file | - A script file | ||
| Line 67: | Line 67: | ||
| - Icon File: 64x64 png icon (optional). | - Icon File: 64x64 png icon (optional). | ||
| - | **The PIA Folder must be stored as a `.zip` archive file for installation.** | + | **The Plug In Action |
| - | ==== PIA PList ==== | + | ==== Plug In Action |
| The format of the Keyboard Maestro Action.plist is a [Cocoa Property list](https:// | The format of the Keyboard Maestro Action.plist is a [Cocoa Property list](https:// | ||
| Line 75: | Line 75: | ||
| ^ Key ^ Description ^ | ^ Key ^ Description ^ | ||
| ^ Name | **Name of the action**.\\ (which appears in the Category/ | ^ Name | **Name of the action**.\\ (which appears in the Category/ | ||
| - | ^ Script | **Name of the script file** which will be run when the PIA is executed.\\ | + | ^ Script | **Name of the script file** which will be run when the Plug In Action |
| ^ Parameters | **An array of parameters to the script**< | ^ Parameters | **An array of parameters to the script**< | ||
| * Each entry is a dictionary [[Plug_In_Actions# | * Each entry is a dictionary [[Plug_In_Actions# | ||
| - | * These parameters will appear as form fields in the PIA in the Keyboard Maestro Editor. | + | * These parameters will appear as form fields in the Plug In Action |
| - | * They allow the user of the PIA to enter the data to be processed by the script. | + | * They allow the user of the Plug In Action |
| * **Optional** | * **Optional** | ||
| </ | </ | ||
| Line 99: | Line 99: | ||
| ^ URL | URL for the author or this action \\ **Optional** | | ^ URL | URL for the author or this action \\ **Optional** | | ||
| ^ Help | A short (Tool Tip) explanation of this action \\ **Optional** | | ^ Help | A short (Tool Tip) explanation of this action \\ **Optional** | | ||
| + | ^ HelpURL | A URL for the Help link for the action (v11.0+) \\ **Optional** | | ||
| ^ Results | **What to do with the output of the script if any**.\\ Possible Values:< | ^ Results | **What to do with the output of the script if any**.\\ Possible Values:< | ||
| * None | * None | ||
| * Window | * Window | ||
| * Briefly | * Briefly | ||
| + | * Large | ||
| * Typing | * Typing | ||
| * Pasting | * Pasting | ||
| * Variable | * Variable | ||
| + | * AppendVar | ||
| * Clipboard | * Clipboard | ||
| - | </ | + | * File |
| + | * Asynchronously | ||
| + | </ | ||
| ==== Plist Parameters ==== | ==== Plist Parameters ==== | ||
| Line 128: | Line 133: | ||
| </ | </ | ||
| ^ Menu | Values of the popup menu, separated by %%|%%\\ **Optional** unless Type is _PopupMenu_. | | ^ Menu | Values of the popup menu, separated by %%|%%\\ **Optional** unless Type is _PopupMenu_. | | ||
| - | ^ Default | Default value of the Parameter | + | ^ Default | Default value of the Parameter |
| Each parameter in the Parameters array is a dictionary with the following keys: | Each parameter in the Parameters array is a dictionary with the following keys: | ||
| Line 139: | Line 144: | ||
| - | _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. | + | _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. |
| - | So a parameter named "My Text" would be in an environment variable KMPARAM‗My‗Text.\\ | + | So a parameter named "My Text" would be in an environment variable KMPARAM‗My‗Text. Note that `spaces` in the variable names _must_ be replaced with `underscores` in your script. |
| - | Note that `spaces` in the variable names _must_ be replaced with `underscores` in your script. | + | |
| Line 179: | Line 183: | ||
| </ | </ | ||
| - | ==== Reload to Use Updated | + | ==== Reload to Use Updated |
| Line 189: | Line 193: | ||
| </ | </ | ||
| - | ==== PIA Failure ==== | + | ==== Plug In Action |
| - | If the Plug In script fails, the action will fail (v9.0+), potentially aborting the macro. | + | If the Plug In script fails, the action will fail, potentially aborting the macro. |
manual/Plug_In_Actions.1622607190.txt.gz · Last modified: by JMichaelTX
