kit
kit copied to clipboard
Blur caused exit. How to keep the window open?
I'm trying to keep a script running while I do something in another window but it keeps closing whenever the ScriptKit window loses focus. The log shows:
[2023-03-18 21:49:37.393] [info] 87957: Blur caused exit. Provide a "onBlur" handler to override.
I've tried a few different types of onBlur handlers, but none has worked, and I can't find any reference to this in the documentation. How do I keep the window open while it's not in focus?
Thanks!
@uniphonic On my phone, so quick answer:
Try:
await arg({ ignoreBlur: true })
ignoreBlur should work on all prompt types
Does this also work on await drop()
? @johnlindquist
@kostasx ignoreBlur
should be on by default when using drop
. Is that not the behavior you're seeing?
@johnlindquist Not really. The ScriptKit window goes away once I focus elsewhere. (running on Mac M1 Monterey)
Same here
@mizagog @kostasx Which version of Script Kit are you on?
This should keep the window from hiding behind other apps when losing focus:
await drop({
placeholder: "Drop a file",
alwaysOnTop: true,
})
Please show me your script if that's not what you're experiencing.
using both works for me!
alwaysOnTop: true,
ignoreBlur: true
@johnlindquist , is there a way to keep multiple ScriptKit windows open simultaneously? For instance, if I want to have multiple "chat" windows going on simultaneously?
When I use
let chatWindow = chat({ ignoreBlur: true, alwaysOnTop: true, onSubmit: async input => { console.log("input",
You said, "${input}"); }, });
This closes any time I try to run different ScriptKit script. Any way to keep multiple of them open, like a typical app would?
Thanks!
@uniphonic no, it's not possible. All the app state is bound to a single window.
Multiple windows will be the major focus of v3 though. (v2 is "done", just doing some housekeeping and releasing soon). Sometime next year is the best I can give you on a timeline.
Multiple windows are arriving as we speak