MACRO: Variable Inspector Prompt and Dictionary Editor v3.2a

I see the difference. I think I would settle for reformatting if that cleans up the mess. But I was hoping for rendering. And I would also settle for a button that opens a browser so that the rendering is done there.

As I said, I have lots of variables that contain HTML, and reading raw HTML is a pain. I can't remember what all these variables are storing. So anything at all that you can provide would help.

Wouldn't a button to open the variable in a browser be fairly trivial?

I... don't actually know. Maybe - it depends on what the browser does with partial HTML snippets.

Can you post a few examples? I'm guessing you know to to do that, but if not, put 3 backticks on a line by itself, then paste the HTML below it, and end with a line of 3 backticks. (```)

I just browsed through all my global and dictionary variables on this Mac, and didn't find any. I guess that means I must be using Local Variables for my HTML (probably obtained through curl statements), due to good programming practices, so I'm hereby withdrawing my request. Sorry about that.

1 Like

Hey, Dan.

I was inspecting the variables in a macro with Accessed Variables set to 1 and the other options left blank, and I was surprised to see over 160 variables accessed. After some troubleshooting, there seems to be something funky going on with the Custom Floating HTML Prompt action.

I set up a new macro with only two actions 1) a blank Custom Floating HTML Prompt action, 2) a Variable Inspector Prompt action:

The inspector shows 162 variables. Am I missing something?

Hey @evanfuchs, there is a known β€œbug” where if you use a custom prompt, and then use the accessed variables token it returns every single variable in your database. There’s a thread floating around somewhere that discusses it but I can’t remember where right now.

EDIT: Found it

See this post Dan Thomas replied to me on as well.

2 Likes

Ah man! I searched around a bit before posting because I vaguely remembered kinda sorta maybe something about that. Thanks for pointing me in the right direction.

2 Likes

Holy cow @DanThomas , this is amazing. Thanks very much :+1:t2:

1 Like

Hi Dan, sometime in the not-too-distant past I started seeing a sizing issue on the Inspector. Namely, it does not save any adjustments I had previously made to it's location and size, and whenever reducing it's height the buttons disappear.

I perused the topic here and downloaded the most recent version but the issue still persists. I thought you had helped me with this issue in the past but I'm not seeing anywhere in this topic about it.

Attached is a screen recording in case that helps. Any ideas where I can start to debug the issue?

Screen Recording (click to expand/collapse)

Screen Recording 2022-09-07 at 07.17.45

My guess is that somewhere in your macro, you set the size or position manually. Or else you're deleting or resetting the DND__VipAppData variable somewhere.

1 Like

Ok I realized my error. I had forgotten that it saves it's current position to the DND__ variable upon closing... and since I'm having that issue where the Reload and Done buttons disappear when reducing it's height I never clicked Done after resizing... so it was never updating it's size.

I was able to change the size/location now. I do still have the disappearing buttons issue but it's not a big deal.

1 Like

Not sure why the buttons are disappearing, but at least you figured out the position issue.

1 Like

I used this for the first time today. Very slick! Easy to use and helped me clean up the mess I made from my early scripts before I learned of local and instance variable. Thank you for creating and sharing this.

1 Like

Done.

1 Like

New version 3.2a solves an annoying issue when resizing the prompt window.

2 Likes

Hello Dan (@DanThomas) :wave:

Installed the new version today and I get this error:

MACRO ERROR OCCURRED  on  2024-09-05 02:05:12
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This info was pulled from the KM Engine Log for the
Last Macro error that occurred.

MACRO:
------------------------------------------------------------------------------------------------------------
25)Inspect All Global Variables & Dictionaries
------------------------------------------------------------------------------------------------------------

Action Type:	Custom Prompt
Action Name:	Custom Floating HTML Prompt β€œVariable Inspector Window”

ACTION ERROR:	 get HTML file. 

KM Engine Log:	
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Custom Prompt failed to get HTML file. Macro β€œ25)Inspect All Global Variables & Dictionaries” cancelled (while executing Custom Floating HTML Prompt β€œVariable Inspector Window”
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

Log File:  ~/Library/Logs/Keyboard Maestro/Engine.log

Maybe you have an idea why that happens?!

Just in case my environment:

  • macOS Monterey 12.7.3 on an iMac 27inch 2020
  • KM 10.2

Thanks in advance :pray:

Greetings from Germany :de:

Tobias

1 Like

Looks like the same error I got as well. Meesa thinks he has an HTML prompt that references a file (instead of embedded HTML), but I haven’t had time to troubleshoot. Thanks for posting this.

Referencing a HTML File is actually the right thing this macro should do… the Macro creates the File as temporary one which gets deleted after the Prompt is closed … That’s the normal behavior of this Macro.

Greetings from Germany :de:

Tobias

My bad, guys. I just uploaded a fixed version. Let me know if it solves your issues. Thanks,

Well, crap, guys. The comments are missing from the version I just uploaded. It'll work just fine as it is, but I'll upload a fix for that either later tonight, or tomorrow morning.

I've been working on a semi-automated way to offload large comments, and other things, and I guess I tested it on VIP.

:expressionless:

All right, everything should be uploaded correctly. Sheesh. Sorry.

1 Like