User Input #527
Replies: 4 comments 8 replies
|
is it possible to 'preload' the text to make it a bit like: |
|
Is there a way to allow multiple-select on arg options? |
|
It would be great if one could use This would allow for some vim or emacs like For example: // Menu: [C]ycle through windows
// Description: Use arrows up and down to cycle through the stacked windows
let cont = true;
while(cont) {
focusedWindow = await getFocusedWindow();
let keyData = await hotkey({
// this would be the setting I'd like to have
invisiblePrompt: true,
// Exit the script on escape, kind of like exiting a mode
onEscape: async () => {
cont = false;
}
});
if(keyData.key === 'ArrowDown') {
await $`yabai -m window --focus stack.next`;
}
if(keyData.key === 'ArrowUp') {
await $`yabai -m window --focus stack.prev`;
}
}Is this possible already somehow? |
|
Hello, How can I create an |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
User Input
Receive text from a user by adding
argto your script:argwill prompt the user to enter text, wait for the text, then return the value of the text tovalueand continue on with the script.You can then use
valueas a string in your script however you want.If you want to tell the user what information the prompt expects, provide a string:
If you want give the user options to select, provide an array as the second argument:
Drag and drop
Prompt the user to drag and drop a file by using the
dropmethod:Longer Text
Allow the user to input multiple lines of text using
textarea:Pre-load the
textareawith text by passing a string:Code Editor
(💵 In the future, using
editorwill require a paid update)Launch a full code editor using
editor. This is greatPre-load the
editorwith text and specify a language for code highlighting/features:Keyboard Shortcut
If you were to type
cmd+j,keyDatawould give you the following response:{ "key": "j", "command": true, "shift": false, "option": false, "control": false, "fn": false, "hyper": false, "os": false, "super": false, "win": false, "shortcut": "command j" }All reactions