brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: the Script menu puts your own AppleScripts in the Mac menu bar

macOS
~/tips/tip-macos-script-editor-script-menu

Script Editor > Settings > General > Show Script menu in menu bar

Shows your own scripts in a menu bar menu, so they run with one click.

Small scripts tend to end up in a folder I never open again. The Mac has had a cure for that for ages, hidden in Script Editor’s settings: a Script menu in the menu bar that lists your scripts, one click away in any app.

Turn it on in Script Editor:

Script Editor > Settings > General > Show Script menu in menu bar

Apple also says to make sure Show Computer scripts is selected. The Script menu icon then appears on the right side of the menu bar, and it already comes with a bunch of useful scripts from Apple. To add your own, save the script as a file and copy it into the Script Editor Scripts folder, which Apple says sits in the Scripts folder of the Library folder on your startup disk. The menu handles applets, droplets and plain uncompiled scripts, and even aliases, including aliases to scripts on remote computers.

Example: a two-line AppleScript that empties the Downloads folder into the Trash, or one that opens a fixed set of Safari tabs for a project. Drop them in that folder and they sit in the menu bar without taking a Dock spot or a keyboard shortcut. For scripts that run now and then, I’d put them here before I’d build a whole app around them.

The caveat: the menu only runs what you put there, with your rights. A script that deletes or moves files does that right away from one click, without asking first, unless you build a confirmation into it. So I’d give the destructive ones a clear name, or add a display dialog line that asks before anything happens.

Further reading: Apple: Access scripts using the Script menu in Script Editor, Apple: Mac Automation Scripting Guide

More macOS tips System Settings > Accessibility > Hover Text > When using the pointer A Smart Folder in Notes collects notes by tag, checklist or date Type # in a Mac note to tag it, then filter by tag in the sidebar tmutil isexcluded ~/Projects/app/node_modules Crop an image in Preview by dragging a frame and clicking Crop All macOS tips (99) All topics

Link