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_JavaScript_in_Google_Chrome [2016/06/07 02:00] JMichaelTX ADD screenshots of Action list and Exec JS Action |
action:Execute_a_JavaScript_in_Google_Chrome [2017/03/22 00:10] peternlewis [Using Keyboard Maestro Variables] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{:action:javascript-icon.png?nolink|}} | ||
====== Execute JavaScript in Browser ====== | ====== Execute JavaScript in Browser ====== | ||
- | **The Execute JavaScript Action is available ONLY for [[action:Execute_a_JavaScript_in_Safari|Safari]] and [[action:Execute_a_JavaScript_in_Google_Chrome|Google Chrome]].** | + | **The Execute JavaScript Action is available ONLY for [[action:Execute_a_JavaScript_in_Safari|Safari]], [[action:Execute_a_JavaScript_in_Google_Chrome|Google Chrome]], and, as of Ver 7.1, [[action:Execute_a_JavaScript_in_Custom_Prompt|Custom HTML Prompt]]** |
- | * These are actually two separate Actions, one for each browser. | + | * These are actually three separate Actions, one for each browser, and one for [[action:Custom_HTML_Prompt|Custom HTML Prompt Action]] |
* This action allows you to execute a specified JavaScript, either from a file or text entered in the Action itself, and return the results. | * This action allows you to execute a specified JavaScript, either from a file or text entered in the Action itself, and return the results. | ||
* If you need to access other Mac apps, see [[action:Execute_a_JavaScript_For_Automation|Execute JavaScript for Automation (JXA) Action]] | * If you need to access other Mac apps, see [[action:Execute_a_JavaScript_For_Automation|Execute JavaScript for Automation (JXA) Action]] | ||
Line 34: | Line 35: | ||
``` | ``` | ||
- | If your Keyboard Maestro Variable contains spaces, they must be replaced with underscores in the JavaScript.\\ | + | If your Keyboard Maestro Variable contains spaces, they must be replaced with underscores in the JavaScript. |
- | So, for example:\\ | + | |
+ | So, for example: | ||
Keyboard Maestro Variable Name: My KM Data | Keyboard Maestro Variable Name: My KM Data | ||
JavaScript Reference: document.kmvar.My_KM_Data | JavaScript Reference: document.kmvar.My_KM_Data | ||
Line 50: | Line 52: | ||
{{:action:km-browser-javascript-output.png?nolink|}} | {{:action:km-browser-javascript-output.png?nolink|}} | ||
+ | |||
+ | ===== Related Forum Topics ===== | ||
+ | |||
+ | * [Execute JavaScript in Custom Prompt Question ](https://forum.keyboardmaestro.com/t/execute-javascript-in-custom-prompt-question/4491) | ||
+ | |||
+ |