Dismissing html prompt window

I have the following code in html prompt that process some xml string and returns to KM.
However, window.KeyboardMaestro.Submit(‘OK’) does not dismiss the html prompt window.
I don’t need to display anything in that html prompt window. Is there way to just dismiss it?
This used to work in earlier KM, but it leaves an empty window in the latest KM.
Thanks!

<script>
function KMInit() {
	variable = window.KeyboardMaestro.GetVariable('variable')
	// do stuff
	window.KeyboardMaestro.SetVariable('variable', variable)
	window.KeyboardMaestro.Submit('OK')
}
</script>

Basically, KMInit is too early in the window process to call submit. Behaviour changed because closing the window at this point would actually cause a crash.

Change your code to be KMDidShowWindow() instead of KMInit() and that will probably be ok.

Awesome! That fixed it! Thanks!

1 Like