I have updated the macro to use document.kmvar. One advantage of using document.kmvar in async custom prompt is that I don't have to add a pause action after the prompt action. Without the delay, there is possibility that the macro is completed before the prompt get the chance to read the local variable (happen especially if prompt is the last action of macro). Another possibility is use global variable which I try to avoid if can let do with local variable.
@macdevign_mac — Thank you for this macro! You have no idea how happy I am that you created and shared this at this time! Kudos!
I am going to be moving about a dozen macros to use it to display various messages throughout my day.
A couple of desires:
Would it be easy to move all of the settings into the Custom Prompt with HTML part? This would make it easier to integrate into my existing macros.
Since my messages are designed to interrupt me (Stand up for 1 minute!, or Colemak-DHm Typing Practice Time! for example), I may be typing when it appears, and my typing may accidentally dismiss it. It is easy to change the Press any key to close the window to only the Esc key will close the window?
In my own attempts at designing one of these display messages, I have found that a message that blocks the entire screen is very helpful, as it fully catches and focuses my attention (example screenshot below).Can your code display the background over all (or most of) of the screen? My attempts at making your macro full sized have failed this far (second screenshot).
It would be even better if it didn't always display on the main screen. To explain - I have a 2-screen setup and you macro always displays on the main screen. I want it to display on whichever screen contains the frontmost app window when it runs.
use this custom version to fill whole screen and close on Escape key. Even though it center the text, you may need to twitch the CSS accordingly. displaywindow.html.zip (3.4 KB)
For this, I have no idea as the front seem to be the correct parameter according to the wiki at https://wiki.keyboardmaestro.com/function/SCREEN
Most likely you need to try rest of the index value for the SCREEN index parameter to figure what's work. Perhaps you can ask Peter on this ?
the variable "Local_inputJson" is used to specify those values as shown in example. The custom prompt retrieve those values from Local_inputJson variable using KM's GetVariable function..