Skip to content

Instantly share code, notes, and snippets.

View johnlindquist's full-sized avatar
💭
Eating a taco 🌮

John Lindquist johnlindquist

💭
Eating a taco 🌮
View GitHub Profile
// Name: Actions Example
import { Action } from "@johnlindquist/kit"
/*
Using a "flag" determines where to do to custom logic: After the prompt or in the action
Also, "flags" are supported when running the script in the terminal with `--js`
*/
let actions: Action[] = [
// Name: Testing Regenerate List
import "@johnlindquist/kit"
let choices = ["one", "two", "three"].map(name => ({
name,
value: name,
id: uuid(), // This happens automatically behind the scenes if you don't do it manually
}))
/*
# Script Hub
You can access this on your phone from:
http://kit.local
Run a script by going to http://kit.local/my-script-name
*/
// Name: Move Mouse to Active App
// Background: true
import "@johnlindquist/kit"
import { getFrontmostApp } from "@johnlindquist/mac-frontmost"
import { shakeCursor } from "@johnlindquist/mac-cursor-effects"
let windowID = ""
let windowTitle = ""
let recentlyClicked = false
// Name: Move Mouse to Active App
// Background: true
import "@johnlindquist/kit"
import { getFrontmostApp } from "@johnlindquist/mac-frontmost"
import { shakeCursor } from "@johnlindquist/mac-cursor-effects"
import pkg from "uiohook-napi"
const { uIOhook } = pkg
let windowID = ""
// Name: Move Mouse to Active App
// Background: true
import "@johnlindquist/kit"
import { getFrontmostApp } from "@johnlindquist/mac-frontmost"
import { shakeCursor } from "@johnlindquist/mac-cursor-effects"
import pkg from "uiohook-napi"
const { UiohookKeyboardEvent, UiohookKey, UiohookMouseEvent, uIOhook } = pkg
let bundleIdentifier = ""
// Name: Filter Scripts
// Shortcut: opt 7
// Cache: true
import "@johnlindquist/kit"
let kenv = "kit-examples"
let scripts = (await getScripts()).filter(script => script.kenv === kenv)
// Name: List Kit Examples Scripts
// Shortcut: opt 7
// Cache: true
import "@johnlindquist/kit"
import { parseScript } from "@johnlindquist/kit/core/utils"
import { globby } from "globby"
let kenv = "kit-examples"
// Name: List Kit Examples Scripts
// Shortcut: opt 7
// Cache: true
import "@johnlindquist/kit"
import { parseScript } from "@johnlindquist/kit/core/utils"
import { globby } from "globby"
let kenv = "kit-examples"
// Name: List Kit Examples Scripts
// Shortcut: opt 7
// Cache: true
import "@johnlindquist/kit"
import { parseScript } from "@johnlindquist/kit/core/utils"
import { globby } from "globby"
let kenv = "kit-examples"