User Tools

Site Tools


action:Execute_a_JavaScript_in_Custom_Prompt

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
Next revision Both sides next revision
action:Execute_a_JavaScript_in_Custom_Prompt [2016/04/27 04:06]
peternlewis
action:Execute_a_JavaScript_in_Custom_Prompt [2023/09/12 05:01]
peternlewis
Line 1: Line 1:
-The Execute JavaScript in Custom Prompt action(7.1+) allows you to execute a specified JavaScript, either from a file or text within a currently open Custom HTML Prompt. The JavaScript is executed in all [Custom HTML Prompt](https://​wiki.keyboardmaestro.com/​action/​Custom_HTML_Prompt) action with a matching windowid, or all if no windowid is specified. The JavaScript can return results. Options for the results of a JavaScript results are:+====== ​Execute JavaScript in Custom HTML Prompt ​======
  
-  ​*ignore results. + 
-  *display results in a window. +===== Options for Returning Results ===== 
-  *display results briefly. + 
-  *display results large. +  ​* ignore results. 
-  *type results. +  * display results in a window. 
-  *paste results. +  * display results briefly. 
-  *save results to variable. +  * display results large. 
-  *save results to the system clipboard or a named clipboard. +  * type results. 
-  *save results asynchronously ​ — the action ​runs while the macro continues on.+  * paste results. 
 +  * save results to variable. 
 +  * append ​results to variable. 
 +  * save results to the system clipboard or a named clipboard. 
 +  * save results ​to a file. 
 +  * asynchronously ​ — the script ​runs while the macro continues on, no results are returned.
  
 If the results are to be saved to a variable or a clipboard then further text areas appear in the action allowing you to specify the variable or specific clipboard. If the results are to be saved to a variable or a clipboard then further text areas appear in the action allowing you to specify the variable or specific clipboard.
  
-The JavaScript ​can access variables by using the window.KeyboardMaestro ​functions described in the [Custom HTML Prompt](https://​wiki.keyboardmaestro.com/​action/Custom_HTML_Promptaction.+===== Using Keyboard Maestro Variables ===== 
 + 
 +You can use the window.KeyboardMaestro ​facilities of the [[action:​Custom_HTML_Prompt|Custom HTML Prompt]] to read and write Keyboard Maestro variables. 
 + 
 +===== Specify the Custom HTML Prompt ===== 
 + 
 +You can specify a [[action:Custom_HTML_Prompt]] with a matching [[action:​Custom_HTML_Prompt#​HTML_Window_Design|data-kmwindowid]] to apply the JavaScript to, otherwise it will be applied to all open Custom HTML Prompt windows. 
 + 
 +===== See Also ===== 
 + 
 +* [[Browser_Actions|Browser Actions]] 
 +* [[Browser_Window_Actions|Browser Window Actions]] 
 +* [[Browser_Form_Actions|Browser Form Actions]] 
 +* [[Wait_For_Browser_to_Finish_Loading| Wait For Browser to Finish Loading actions]] 
 + 
 +=== Actions === 
 + 
 +* [[action:​Execute_a_JavaScript_in_Front_Browser|Execute a JavaScript in Front Browser]] 
 +* [[:​Actions|See all Actions]] 
 + 
 +==== Forum ====
  
 +- [[https://​forum.keyboardmaestro.com/​t/​execute-javascript-in-custom-prompt-question/​4491|Execute JavaScript in Custom Prompt Question]]
action/Execute_a_JavaScript_in_Custom_Prompt.txt · Last modified: 2023/11/28 03:07 by peternlewis