Desktop automation: File Selection Popup of native mac app appears in the browser screen

After installing the new xmodules I have following problem with following macro:

“Name”: “MM Reporting SQLite”,
“CreationDate”: “2026-9-7”,
“Commands”: [
{
“Command”: “XDesktopAutomation”,
“Target”: “true”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “prompt”,
“Target”: “Please enter the Password”,
“Value”: “Password”,
“Description”: “”
},
{
“Command”: “comment”,
“Target”: “”,
“Value”: “”,
“Description”: “SQL Studio”
},
{
“Command”: “XRun”,
“Target”: “/Applications/DB Browser for SQLite.app/Contents/MacOS/DB Browser for SQLite”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_CMD+KEY_O}”,
“Value”: “”,
“Description”: “”
},

…

At the last Xtype Command a File Selection Popup will be triggered. But not in SQLite App. It is assigned to the browser screen

Thanks for the detailed macro, this one is a timing race that the new module exposes. XRun starts the app and returns immediately, and macOS only brings the app to the front once it has finished launching, which for DB Browser for SQLite takes a second or more. XType sends its keys to whatever window is in front at that moment. With the old modules the XType step was slower, so the app usually won; the new module is faster and now sends Cmd+O while Chrome is still in front.

Two fixes, use either:

  1. Launch through open, which waits for the app to launch and activates it:
    XRun | /usr/bin/open | -a "DB Browser for SQLite"
    then pause | 1000 before the XType.
  2. Keep your XRun as is, add pause | 3000 after it, and optionally an XClick into the app window (for example on its title text via XClickText) right before the XType so the focus is guaranteed.

We will make the XRun step itself wait for a .app to come up in a future XModule update, so the pause becomes unnecessary.