MACRO: Variable Inspector Prompt and Dictionary Editor v3.2

You're dang right I don't have to! :rofl: But if I can, and it's not hard, then I might.

You still didn't answer the question, though, but I'm guessing you'd like to see it formatted "pretty" if I can, right?

Hopefully most developers are okay with critiques.

Absolutely! :100: (I never know what that emoji is supposed to me, but I'm using it as "100%".)

I must have not understood your question. I just wanted to read the HTML code in a pretty manner, not as HTML commands.

That's what I thought. After a brief look online, I can't find anything that I could use easily for this. There's lots of websites that will do this for free, but none of them have APIs I can call from Javascript.

There's Javascript packages I could try and use, but frankly, it's more effort than it's worth. I suspect there might be a way to do it with BBEdit and a text filter of some kind, but I doubt it's easy.

So you're probably out of luck.

Is there some way you can create a button that passes the value to Safari for reading there?

Thanks for the idea. But he just wants the HTML reformatted, not rendered as a web page.

"He"? Do you regularly speak to your friends in the third person? I should be a second person pronoun. I'm not important enough to merit a three, (like the Queen's third-person "We are not amused") only a two.

Also, can you tell me the difference between "reformat" and "render"? I don't understand. I even googled it and they seem to be the same.

Well, sh!t. Sorry about that. I'm old - yeah, I'll blame it on that. Quick - look over there! :roll_eyes:

OK, let me restate it: I was under the impression that you just wanted it reformatted for display. In other words, turn this:

<h1>The world's most expensive cars</h1><ul><li>Bugatti La Voiture Noire: $18.68 million</li><li>Pagani Zonda HP Barchetta: $17.5 million</li><li>Rolls Royce Sweptail: $13 million</li><li>Bugatti Centodieci: $9 million</li><li>Lamborghini Veneno Roadster: $8.3 million</li></ul>

to this:

<h1>The world's most expensive cars</h1>
<ul>
    <li>Bugatti La Voiture Noire: $18.68 million</li>
    <li>Pagani Zonda HP Barchetta: $17.5 million</li>
    <li>Rolls Royce Sweptail: $13 million</li>
    <li>Bugatti Centodieci: $9 million</li>
    <li>Lamborghini Veneno Roadster: $8.3 million</li>
</ul>

That's what I mean by reformatting.

By rendering, I mean turning it into this:


The world's most expensive cars

  • Bugatti La Voiture Noire: $18.68 million
  • Pagani Zonda HP Barchetta: $17.5 million
  • Rolls Royce Sweptail: $13 million
  • Bugatti Centodieci: $9 million
  • Lamborghini Veneno Roadster: $8.3 million

Am I wrong about what you want?

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