Script Kit 2.0 Release Candidate #1365
Replies: 2 comments 17 replies
-
@johnlindquist I upgraded to this and it would not allow my script to work any longer, the async function that returned an array to the arg method would no longer allow me to search. I quickly went to the site and downloaded the older version I had and once installed everything seems to have broken. I thought that using AppZapper to remove all associated files and removing my .kenv/ directory would have solved this but even after a reinstall that is not happening. Upon first open I get a t.map is not a function call. |
Beta Was this translation helpful? Give feedback.
-
Bravo @johnlindquist! The new format for actions is fantastic! I struggled a bit before to get the -> right arrow to enable showing of flags. Now it works flawlessly. The design refresh is really great too! |
Beta Was this translation helpful? Give feedback.
-
Script Kit 2.0 Release Candidate
Download for your platform from the releases page:
https://github.com/johnlindquist/kitapp/releases/tag/v1.99.82
New Main Menu
The main menu has been re-designed and optimized for your keyboard-centric workflows.
New Custom OSX Window
Prompts like
editor
andterm
which useignoreBlur
will now convert the window into an "app" window which can be accessed bycmd+tab
, is pinned when switching spaces, and shows up in Mission Control. This is also forward-looking to v3 which I'll talk about more in the future...Keywords
Borrowed directly from Alfred, keywords allow you to trigger a script by typing a keyword followed by a space.
A keyword can be a single character or a word. For example,
c
forclipboard
.Built-in Keywords
s
- Displays Snippets from your Snippets Directoryc
- Displays Clipboard Historyf
- Find script by searching script contentskit
- Access kit settingskenv
- Access kenv optionsnpm
- Add/remove npm packagesspell
- List spelling suggestions for the inputAnd many others. To see them all, type
keyword
into the Script Kit prompt.To create a custom keyword for your own scripts, add:
If the first prompt is an
await arg()
, it will display the list in the main menu. Otherwise, it will jump to the next prompt.Also, if the first prompt is a static list and you shave off the few milliseconds required to load the list from your script, you can cache the list (after the first run) by adding:
Use caching sparingly, as it's only useful for
// Keyword
and// Shortcut
where the first prompt is anarg
with a static list.Pass Main Menu Input to a Script
The
Pass
metadata allows you to type into the main menu without your script being filtered out of the list. Once you select the script, the input you've typed will be "passed" into the script. You can access the "passed" input usingflag?.pass
. For example, if you want to pass the main menu input to the input of you first arg:Pass "postfix"
Image you want to type: "How many moons does Jupiter have?" and have the "?" automatically trigger a script that reaches out to an AI service. You can do this by adding a "postfix" to the
Pass
metadata.This will automatically trigger the script when you type a "?" at the end in the main menu and the entire input will be passed to the script as
flag?.pass
.Multi-select Prompt
await select()
Probably the most requested feature, Script Kit now has a
select
prompt which allows you to pick multiple choices.Themes Per Light/Dark Mode
You can now customize which theme will be active for both light and dark more or use the same theme for both.
Snippets Directory
In your ~/.kenv/snippets directory, create .txt files you want to use as snippets. For example:
~/.kenv/snippets/lorem.txt
The "Lorem Ipsum" snippet will now appear in the Snippets menu using the
s
keyword. Select the snippet will paste it into the current application.Adding Snippet metadata will allow you to invoke the snippet anywhere on your system. It's a best practice to use a "postfix", such as ",,", to avoid triggering the snippet when you don't want to.
Snippet Creator
Typing
ns
from the main menu will launch the quick snippet creator. There's a helpful guide there that will show all the available options. Just to list a few:and many more...
If you need more advanced scenarios, for example clipboard history:
Actions
The new
actions
array makes it much easier to assign shortcuts and behaviors when you have a choice selected. You can access the actions menu by pressingright
on the keyboard, then quickly search to execute the action you want to take with the currently focused choice:Previews on All Prompts
You can build-out helpful previews on the right side for all prompts now (see the Snippet Creator above for a great example). This is especially useful for prompts like
editor
,drop
, andterm
where you may need reminders on what the script is doing or steps you want to guide the user through.Move kenv to a Different Directory
Type
kit move
into the main prompt to move your kenv directory to a different location. This is useful if you want to keep your scripts in dotfiles or other setup.onClick and onKeydown Globals
Custom TypeScript Loader
The new custom loader eliminates the need to watch .ts files for changes (which caused many issues from a long-running app). We now have a customized loader that can run any TypeScript file instantly.
An awesome benefit of this is you can create a script anywhere on your system, such as
~/Desktop/my-script.ts
(or js if you prefer) and run it from script runner:~/.kit/bin/kit ~/Desktop/my-script.ts
.If we get enough requests, we will allow you to run the scripts from the built-in file browser through the app as well.
Watch Scripts for npm Install
As you're writing your scripts in your favorite editor, Kit.app will detect if you've added a new npm package and automatically prompt you to install it using the Kit.app built-in terminal.
Road to v2
The plan is to release v2 in mid-December. I'll be focusing on updating documentation, guides, tips, and tricks to finally help everyone get a more complete grasp of what Script Kit is capable of. There are a few more APIs which haven't been announced which will be included as well.
Questions?
Please ask below. We're always happy to help figure out better workflows to optimize your day. Happy scripting!
- John
Beta Was this translation helpful? Give feedback.
All reactions