User Tools

Site Tools


action:Execute_a_JavaScript_in_Google_Chrome

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
action:Execute_a_JavaScript_in_Google_Chrome [2016/06/07 01:29]
JMichaelTX ADD info about KM var use, and section headings
action:Execute_a_JavaScript_in_Google_Chrome [2017/03/22 00:11]
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.+
  
-This action allows you to execute a specified JavaScript, either from a file or text entered in the Action itself, and return the results. ​+ * 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. ​ 
 + * If you need to access other Mac apps, see [[action:​Execute_a_JavaScript_For_Automation|Execute JavaScript for Automation (JXA) Action]] 
 + 
 +{{:​action:​km-execute-javascript-actions.png?​nolink|}} 
 + 
 +{{:​action:​km-execute-javascript-chrome.png?​nolink|}}
  
 ===== Options for Returning Results ===== ===== Options for Returning Results =====
Line 29: 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, 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 45: Line 50:
  
 {{:​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)
 +
 +
action/Execute_a_JavaScript_in_Google_Chrome.txt · Last modified: 2017/08/31 02:11 by peternlewis