kit
kit copied to clipboard
Snippets doesn't work on my mac os Ventura 13.1 (M1 Pro)
Apple M1 Pro Ventura 13.1 Kit Version 1.40.62 (1.40.62)
I switched on the toggle in Privacy and Security/Accessibility and Privacy and Security/Input Monitoring for Kit app. Then I type snippet text, for example "kit,," from Sample Snippet example in a text editor (vs code) or anywhere else, nothing happens.
You'll also need to manually start the keyboard watcher to snippets to run:
Thank you @johnlindquist, that really helped me! Although it doesn't work in some cases, but I'll play around with it 😀
and by the way could you explain why keyboard.type from the example does not work, but setSelectedText does?
You may need to hide the prompt first:
// Name: Testing Keyboard Type
import "@johnlindquist/kit"
await hide()
await keyboard.type(`Hello world!`)
Open testing-keyboard-type in Script Kit
Also, some apps like Google Docs, interfere with typing by trying to automatically correct text, etc. So results may be inconsistent in "smart" editors fighting over keyboard control
thanks again @johnlindquist, impressive work
I swear they were working before. Is there anything interfering that can chagne this?
@danielo515 If you adjust your log level to "silly", do you see it tracking your keystrokes in ~/.kit/logs/kit.log?
Adjusted, opened the log and nope, there is no log about keystrokes. I have raycast running, which also triggers snippets and it works. May it be interfering?
Yeah, it's definitely possible. Does this fix it?
I can try and add some logic of something like:
"if hasn't detected a keystroke in 1 minute, restart watcher"
There's no way to detect if it's "on" otherwise (that I'm aware of)
That sounds reasonable to me. However, I tried manually restarting it and it doesn't make a difference either. It is weird because it worked before.
On Thu, Feb 2, 2023 at 6:24 PM John Lindquist @.***> wrote:
Yeah, it's definitely possible. Does this fix it?
[image: CleanShot 2023-02-02 at 10 21 33] https://user-images.githubusercontent.com/36073/216396629-3fff5ba1-0862-4a26-a688-04fabc498573.png
I can try and add some logic of something like:
"if hasn't detected a keystroke in 1 minute, restart watcher"
There's no way to detect if it's "on" otherwise (that I'm aware of)
— Reply to this email directly, view it on GitHub https://github.com/johnlindquist/kit/issues/1013#issuecomment-1414103543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARKJWIFI4B7V4UMEWPZQQ3WVPUTDANCNFSM6AAAAAAUA3B45I . You are receiving this because you were mentioned.Message ID: @.***>
--
https://danielorodriguez.com
I would trying quitting Kit.app then disabling/re-enabling permissions, then re-opening Kit.app.
OSX permissions can be finicky
I had similar issues... adding await hide()
before the type command helped.
I have same issue for weeks now. I'm currently on MacOS Ventura 13.4.1. I've tried re-enabling permisions, wake watchers, etc. I even tried to do clean reinstall of ScriptKit. No luck.
Snippets and Shortcuts do not work for me :(
Logger don't show any error, i tried with simple snippet example
[silly] kitState.snippet = kit,,
But nothing happened.
Ok, I found solution for my issue:
- I needed to disable and re-enable permisions for few settings. And most important was Privacy & Security/Input Monitoring. Probably docs needs update to cover Mac OS Ventura changes in settings structure.
- For my custom kenv directory I needed to "trust" kenv, by selecting kit (tab)/manage kenv/Trust kenv and follow "danger zone" instruction.
Now all my snippets and shortcuts are working again.
After last changes with trust, solution described above doesn't work anymore.
Only way I found is to move all my scripts to "main" kenv.
@wysher by "latest changes", do you mean you're on the latest build and it stopped working?
There haven't been any changes to the "trust" system... But I did update the key watching library to the latest version.
What does it say in your "~/.kit/logs/kit.log" when you add a snippet script to a kenv?
@johnlindquist I referred to last trust changes here https://github.com/johnlindquist/kit/releases/tag/2023-07-01-02-47-34 When I wrote about my findings few days ago I had previous version. The one, which doesn't show prompt after trusting kenv with "Scripts located in the following directory are now trusted to run automatically" and "How to Distrust"
Logs after trusting kenv now:
[2023-07-07 12:43:20.970] [info] 👩⚖️ Trusted Kenvs [ 'shared-kenv' ]
[2023-07-07 12:43:20.970] [info] 🌈 Refreshing Scripts...
[2023-07-07 12:43:20.970] [info] Reset all idle processes
[2023-07-07 12:43:20.971] [info] 66828: 🛑 removed
[2023-07-07 12:43:20.971] [info] Ensure idle process
[2023-07-07 12:43:20.983] [info] Ignoring /Users/work/.kenv/kenvs/shared-kenv/scripts/snip-email.js // Snippet metadata because it's not trusted in a trusted kenv.
[2023-07-07 12:43:20.983] [info] Add "KIT_WORK_DANGEROUSLY_TRUST_KENVS=shared-kenv" to your .env file to trust it.
[2023-07-07 12:43:20.983] [info] Ignoring /Users/work/.kenv/kenvs/shared-kenv/scripts/todoist.ts // Shortcut metadata because it's not trusted.
[...]
[2023-07-07 12:43:21.071] [info] Add one idle process
[2023-07-07 12:43:21.073] [info] 👶 Create child Prompt process: 68640 []
[2023-07-07 12:43:21.074] [info] 68640: 🟢 start idle Prompt
[2023-07-07 12:43:21.826] [info] Attempt Hide: Blur
[2023-07-07 12:43:21.833] [info] 65940: Blur caused exit. Provide a "onBlur" handler to override.
[2023-07-07 12:43:21.845] [info] DISCONNECT
[2023-07-07 12:43:21.846] [info] EXIT { pid: 65940, code: 0 }
[2023-07-07 12:43:21.846] [info] 65940: 🟡 exit 0. Prompt process: /Users/work/.kit/cli/kenv-trust.js
[2023-07-07 12:43:21.846] [info] 65940: 🛑 removed
[2023-07-07 12:43:21.846] [info] Attempt Hide: remove
[2023-07-07 12:43:21.879] [info] Prompt window in bounds.
[2023-07-07 12:43:21.984] [info] changes [
'/Users/work/.kenv/kenvs/shared-kenv/scripts/snip-email.js',
'/Users/work/.kenv/kenvs/shared-kenv/scripts/todoist.ts',
]
@wysher Ok, thanks, I'm digging into it. I'll try to get back to you today