Script Kit Logo
Script Kit
by John Lindquist

Scripts by Schmedu

JSON 2 YAML

Schmedu's avatar
Eddie
// Name: Json To Yaml Converter
// Author: Eduard Uffelmann
// Twitter: @schmedu_
import "@johnlindquist/kit";
import * as yaml from "js-yaml";
let filePath = await getSelectedFile();
let content = await readJson(filePath);
let result = yaml.dump(content);
let todo = await mini("What to do?", ["Copy", "Save"]);
if (todo === "Copy") {
await copy(result);
} else {
await writeFile(filePath.replace(".json", ".yaml"), result);
}

Connect & Disconnect Bluetooth Devices (via `blueutil`) 📶

Schmedu's avatar
Eddie
// Name: Connect / Disconnect Bluetooth Devices
// Description: Toggles a bluetooth device connection
// Video: https://media.schmedu.com/videos/connect-bluetooth.mp4
// Alert: Make sure to have "blueutil" via brew installed
// Author: Eduard Uffelmann
// Twitter: @schmedu_
// Linkedin: https://www.linkedin.com/in/euffelmann/
// Website: https://schmedu.com
import "@johnlindquist/kit";
import fs from "fs";
const BLUEUTIL_PATH = "/opt/homebrew/bin/blueutil";
if (!fs.existsSync(BLUEUTIL_PATH)) {
let installBlueutil = await arg(
{
placeholder: "Please install blueutil",
},
[
66 lines below • View full script