Layout Export, Save and Save As Dialogs do not accept AHK input

Part of my workflow includes providing imperial dimensioned drawings for our clients and metric dimensioned drawings for the shop.

In the past, I simply toggled metric on in SU, updated the Layout file and exported to PDF. At the Export dialog, I have an AutoHotKey (AHK) script that appends “-Metric” to the filename so that, for example, drawing.PDF becomes drawing-Metric.PDF when I press the hotkey - in this case ctrl+alt+m.

In LO2024 and previous versions, the solution worked perfectly.

In SU2025 Pro, the Layout export dialog does not accept input coming from an AHK script. The script works fine everywhere else. A little research reveals that Trimble may have changed the way the dialog works in LO2025.

Note that the script works in SU2025 Save and Save As dialogs but does not work in any of the LO2025 Save, Save As or Export dialogs. Would be nice to have a little consistency…

I realize that I can do it manually, but I’m wondering if anyone has run across this issue and come up with a solution to use AHK scripts in LO2025 dialogs.

Constructive input is appreciated. Thanks!

Maybe share your script.

I found that the menu handlers have been changing from version to version in recent years probably down to the move over to the QT Framework (?).

If you use the window spy you can interogate the menu to see what window title or ahk_class it is.

Thanks for the response.

Yeah, I did use the windows spy tool and still could not get the Export dialog to respond to AHK.

The relevant part of the script that has worked for the past 5 years is simply:

#SingleInstance force
#Requires AutoHotkey v2.0

^!m:: {
send(“{End}{Left 4}”)
send(“-Metric”)
return
}

I spent an hour with Grok and got sent down the UIA.ahk and UIA_Browser.ahk path but still got nowhere. Don’t understand why they use a standard Windows dialog in SU, but not in LO.

Are you are opening the Export dialog with keys alt + f, then selecting Export and then when the dialog pops up you type crtl + alt + m?

Which should move the caret to the end of the filename, move it 4 characters left and then insert -Metric.

I’m using AHK version 1 still, so I converted your script and it works in Layout 2025 if I do the above.

If you have been opening the Export option with a script in 2024, if you haven’t already, you should note that in 2024 Export has a sub menu whereas in 2025 it does not.

I created a shortcut key in both 2024 and 2025 versions of LO - Ctrl+F gets me to the export dialog. I actually thought about going back to v1 of AHK to test. Will try that tonight. I appreciate your thoughts @PaulMcAlenan.