The Execute JavaScript in Custom HTML Prompt action let you execute JavaScript in a Custom HTML Prompt window.
This action allows you to execute a specified JavaScript, either from a file or text entered in the Action itself, and return the results.
You can specify a Custom_HTML_Prompt with a matching data-kmwindowid to apply the JavaScript to, otherwise it will be applied to all open Custom HTML Prompt windows.
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.
You can use the window.KeyboardMaestro facilities of the Custom HTML Prompt to read and write Keyboard Maestro variables.