In KM10, is window.KeyboardMaestro.ResizeWindow() broken in Custom HTML Prompts?

It appears to me that in KM10, in a Custom HTML Prompt, calling window.KeyboardMaestro.ResizeWindow(x,y,width,height) doesn't do anything. (x,y,width,height are variables). Can anyone verify this? I want to make sure I'm not going crazy[ier].

Edited to add @peternlewis to this.

Seems to work fine for me.

Custom HTML Prompt.kmactions (1.5 KB)

Keyboard Maestro Export

1 Like

I using window.KeyboardMaestro.ResizeWindow() extensively, I too can confirm that it is working in KM10 (note: I using Catalina)

1 Like

I wasn't putting the parameters in a string. Silly me.

1 Like

Do you mind giving some examples of how you’re using the resize window function? Just trying to think of a scenario I’d use that? (I’m sure it’s useful; but I’m not thinking creatively enough).

@cpennington,

Just to understand why ResizeWindow is important is because standard window APIs like moveTo, resizeTo , resizeBy (Window moveTo() Method) do not work in KM Custom Prompt Window, hence this function is useful to move/resize window programmatically.

For example, in my case,
KM's ResizeWindow function can be used to restore the position and size of window from where it last appear. These window bound properties (x,y, width, height) is saved to KM variable and send to ResizeWindow.

Can also be called for dragging from content area (without dragging from the titlebar since KM10 support title-less window).

For example, I build a resizable and draggable transparent custom prompt window that can use to show the bound of the window onto the menu (another KM's feature) so I don't have to rely on other application to do it.

image

1 Like

Check out this post I just made: Custom HTML Prompt WindowPositionController.

1 Like