Skip to content
ExtraBar Docs
← Back to site

Scripts#

The Run Script action lets you execute scripts directly from your menu bar. Write a quick shell command, run a Python script, or automate with AppleScript — all triggered with a click or keyboard shortcut.

Adding a script action#

  1. Open ExtraBar and click Manage on a preset
  2. Click the app settings icon (⚙) on any item
  3. Click + Add → Run Script
  4. Configure the script settings

Script source#

You can provide a script in two ways:

  • File — Point to a script file on disk. Use the Browse button to select the file, or type the path manually. ExtraBar sets the language from the file extension automatically and falls back to Shell Script for unknown extensions.
  • Inline — Write the script directly in ExtraBar's built-in editor, which highlights syntax for the selected language. Inline scripts are stored with the action and run directly by ExtraBar.

You can also load a file's contents into the inline editor using the Load from File button, or empty the editor with Clear.

Scripts run directly on your Mac. They are not executed by the app the menu belongs to, so you can attach a script to any app or folder.

Supported languages#

Pick the language from the Language menu. AppleScript and the shells are always available. Other languages are detected automatically — if the interpreter is installed on your Mac, it shows up as an option, and the interpreter path appears below the menu. A language that is no longer installed is marked (Not Installed).

  • AppleScript — .applescript, .scpt
  • Shell Script (zsh) — .command
  • Bash — .bash
  • Zsh — .zsh
  • POSIX Shell — .sh
  • Python — .py
  • PHP — .php
  • Node.js — .js, .mjs, .cjs
  • Ruby — .rb
  • Perl — .pl, .pm
  • Lua — .lua

ExtraBar checks standard paths including /usr/bin, /opt/homebrew/bin, and /usr/local/bin for interpreters.

Arguments#

Add command-line arguments to pass to your script. Each argument is a separate entry — click Add Argument to append one, and remove entries you no longer need. Arguments are passed to the script in order.

Shell environment#

Control how the shell environment is set up when your script runs. This matters when your script depends on tools installed via Homebrew or custom PATH entries.

  • Default environment — No shell profile loading. The script runs with a minimal environment.
  • zsh (load profile) — Loads .zprofile and .zlogin. Use this when your script needs Homebrew or other PATH additions.
  • zsh (interactive) — Loads .zshrc. Use this when your script needs aliases or functions from your shell config.
  • bash (load profile) — Loads .bash_profile or .profile.

Output window#

When Show output window is enabled (on by default), ExtraBar opens a floating panel that shows live script output as it runs. The window displays:

  • Script name and language
  • Streaming stdout and stderr output (errors highlighted)
  • Exit code when the script finishes
  • A 10-second auto-close countdown on completion — click Keep Open to stop it