johnlindquist / kit

Script Kit. Automate Anything.
https://scriptkit.com
MIT License
3.91k stars 138 forks source link

MacOS Sonoma: setActiveAppBounds targets the Kit.app prompt #1352

Open ryanomackey opened 1 year ago

ryanomackey commented 1 year ago

Hi 👋

First off, love this project. Post Sonoma upgrade though, it looks like setActiveAppBounds is seeing Kit as the "frontmost" app here:

https://github.com/johnlindquist/kit/blob/1827ac44a6ae33f771348bae144b4f38dfe97152/src/lib/desktop.ts#L314

Was able to get around it by adding this to my script before calling setActiveAppBounds:

await applescript(`
  tell application "System Events"
    tell process "Kit" to set its visible to false
  end tell
`);

setActiveAppBounds({ top, left, right, bottom })

Not sure if it would make sense to add that to setActiveAppBounds's script or not. Maybe there's a better way to grab the second frontmost process? AppleScript scares me.

johnlindquist commented 1 year ago

Thanks @ryanomackey . I'm working on a new custom window type for Script Kit that can better handle window focus/spaces/etc. Hopefully I can tackle this as well.

JosXa commented 6 months ago

Has this been addressed already @johnlindquist ?