This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
action:Execute_a_Shell_Script [2021/10/14 04:45] peternlewis |
action:Execute_a_Shell_Script [2021/10/14 05:08] peternlewis [Execute a Shell Script] |
||
---|---|---|---|
Line 16: | Line 16: | ||
If the script fails, the action will fail (v9.0+), potentially aborting the macro. | If the script fails, the action will fail (v9.0+), potentially aborting the macro. | ||
+ | |||
+ | Keyboard Maestro sets the environment variables for the script to include all your variables, using a prefix of `KMVAR_` and your variable name with spaces changed in to underscores (‗). For example, your Keyboard Maestro “File Name” variable will be available as the environment variable `KMVAR_File_Name`. | ||
+ | |||
+ | Keyboard Maestro also provides (v10.0+) a number of environment variables that contain information about the executing macro. These include: | ||
+ | |||
+ | ^environment variable^meaning^ | ||
+ | |`KMINFO_MacroName`|The name of the parent executing macro| | ||
+ | |`KMINFO_MacroUUID`|The UUID of the parent executing macro| | ||
+ | |`KMINFO_MacroGroupName`|The name of the macro group containing the parent executing macro| | ||
+ | |`KMINFO_MacroGroupUUID`|The UUID of the macro group containing the parent executing macro| | ||
+ | |`KMINFO_ThisMacroName`|The name of the executing macro| | ||
+ | |`KMINFO_ThisMacroUUID`|The UUID of the executing macro| | ||
+ | |`KMINFO_ThisMacroGroupName`|The name of the macro group containing the executing macro| | ||
+ | |`KMINFO_ThisMacroGroupUUID`|The UUID of the macro group containing the executing macro| | ||
+ | |`KMINFO_TriggerTime`|The [[/unixtime|unixtime]] the parent macro started executing| | ||
+ | |`KMINFO_TriggerBase`|The type of the trigger that started the parent macro| | ||
+ | |`KMINFO_Trigger`|The trigger description of the trigger that started the parent macro| | ||
+ | |`KMINFO_TriggerValue`|the value associated with how the parent macro was triggered| | ||
+ | |`KMINFO_ActionResult`|The success or failure of the immediate past action| | ||
+ | |`KMINFO_LastWindowID`|The window ID of the most recently displayed Keyboard Maestro Engine window| | ||
+ | |`KMINFO_PromptWithListText`|The text typed in the most recently executed [[action:Prompt_With_List|Prompt With List]] action| | ||
+ | |`KMINFO_PasteByNameText`|The text typed in the most recently executed [[action:Paste_by_Name|Paste by Name]] action| | ||
==== Using Keyboard Maestro Variables ==== | ==== Using Keyboard Maestro Variables ==== |