Feature request: option for ‘Prompt for User Input’ window to appear under the mouse cursor

There's nothing obviously wrong with the code -- this, for example, works as expected for me:

set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
	set mouseCoords to getvariable "Local_mouseCoords" instance inst
end tell

set AppleScript's text item delimiters to ","
set mouseX to text item 1 of mouseCoords as number
set mouseY to text item 2 of mouseCoords as number

tell application "System Events" to tell process "ShortcutsViewService"
	set position of window 1 to {mouseX, mouseY}
end tell

Due you, by any chance, have System Settings... -> Displays set to something other than "Default"? That issue cropped up on the Forum a month or so ago -- if you aren't set to "Default" then the macOS "get" APIs appear to have a different coordinate system to the "set" APIs. My guess is that "get" coords are scaled bet "set" are native.

So if that is the case for you and your scaling remains fixed you should be able to work out a "fiddle factor" to apply to the coordinates to bring the two systems into line.

When you have Icon Chooser open the menu item gets a tick mark -- use that!

You’re absolutely right — I’d completely forgotten about that approach. Using it, everything now works perfectly. Thank you very much.

For a Custom HTML Prompt, what’s the correct way to move its window to the current mouse cursor position? I tried using “Set Next Engine Window Position” and the variable ‎%CurrentMouse%, but I couldn’t get it to work.

From the Wiki:

HTML Window Design

You can define the size and position of the window using any of the following attributes to the HTML body element:

HTML Body Attribute Definition/Use
data-kmwindow May be either: a size (width, height); a rectangle (left, top, width, height)
data-kmwidth width
data-kmheight height
data-kmleft position of left side
data-kmtop position of top
data-kmwindowid an ID that can be used with the Execute a JavaScript in Custom Prompt action

For example:
<body data-kmwindow="SCREEN(Main,Left,20%),SCREEN(Main,Top,20%),420,560">

So how about trying

<body data-kmleft="MOUSEX()" data-kmtop="MOUSEY()">

Add a few pixels to MOUSEY() if you want to account for the title bar and remember that the edge of your screen is a limit -- the window will spawn as close to your pointer as it can while remaining entirely on screen.