JavaScript Console in Custom HTML Prompt


#1

So, somehow the JavaScript in my Custom HTML Prompt isn’t working. How do I access the console and/or where the JavaScript errors are logged out?

(I realize in many cases I can just debug the page in a browser, but there are cases like this one where it’s failing as I’m trying to do the Keyboard Maestro integration)


#2

Would you mind sharing your KM macro where you use the Custom HTML Prompt?

I have been wanting to try that, but wasn’t sure how to use.
This would also probably help others help you solve your issue.

Thanks.


#3

There is an example in the Macro Library. The log messages might make it in to the Engine.log file, I’m not sure.


#4

It doesn’t look like they do :crying_cat_face:

However, I did find a solution that works…turning on the web inspector. I did this at the Terminal:

defaults write com.stairways.keyboardmaestro.engine WebKitDeveloperExtras TRUE 

And now I can right click in a Custom HTML Prompt and select Inspect Element and get an inspector window, including a Console tab.

Assuming you don’t want to turn this on for all users, it might useful to add this to the list of hidden preferences on the website


#5

@2shortplanks, thanks for sharing that pref setting.

Are you referring to Safari, Chrome, or both?


#6

Hey JM,

He means inside the Keyboard Maestro Custom HTML Prompt.

-Chris


#7

OK, thanks.


Slider support to display and modify variables
#8

For everyone, like me, wondering just how this works, and what it looks like, here are a couple of screenshots I made AFTER running the above command in Terminal:

I'll add of this to the KM wiki when I get a chance.

The more I learn about the KM Custom HTML Prompt, the more I like it.

To everyone reading this, if you have a working example, please post it to the KM forum. Peter provided one, but it will really help us all learn how to use this if we have more examples.

Thanks.


Form inside KM
#9

This is awesome!

I know I’m late to this thread, but does anyone know if there’s any harm in leaving this turned on?

(And of course I just discovered this AFTER spending hours and hours debugging stupid mistakes…)


#10

There’s no harm in leaving this on as far as I can tell (it is just a standard web view under the hood after all)

I suspect the only reason it’s off by default is to prevent novices accidentally right clicking and selecting it and getting confused with some macro someone shared with them.


#11

Thanks!


#12

Where can I check the inspector?
I ran the command in terminal, restarted the KM engine.
When I right click custom html prompt, I get things like try, disable, rename, and so on. I couldn’t find inspector.
Thanks!


#13

It sounds like you are right-clicking on the KM Action in your Macro.
You need to right-click on the HTML Prompt when you actually display it.
See my screenshot in the above post.


#14

Ah, got it! This is awesome! Thanks!