macOS: Run a Node.js script from your macOS menu bar

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


I wanted to quickly add a fast way to run a Node.js script from the menu bar.

Many options exist, including making your own macOS menu bar app, or using 3rd party apps.

But macOS gives us an easy way as well, using good old AppleScript.

Open the Script Editor app on macOS

Open its settings and enable Show Script menu in menu bar:

Now click the File → New menu to open the script editor:

To run my Node.js script I added this line

do shell script "cd /Users/myself/dev; /opt/homebrew/bin/node script.js"

As a JS dev I must note that you can also use JavaScript for Automation (JXA) to do the same thing:

const app = Application.currentApplication()
app.includeStandardAdditions = true
app.doShellScript('cd /Users/myself/dev; /opt/homebrew/bin/node script.js')

but I prefer AppleScript in this case, feels more “native”.

I used cd so the .env file I put in that folder was picked up by Node.

Then I clicked the script name, added a good name, and saved into my user’s scripts folder, which can be found in ~/Library/Scripts

After all these steps, I was able to find my script in the menu bar, like this:

That’s it!

Now I can run it, and a spinning gear shows up, notifying me when it’s finished:

Pretty cool!

Lessons in this unit:

0: Introduction
1: How to use the macOS terminal
2: Productivity gains of using a Mac and an iOS device
3: A way to set up automations in macOS easily
4: How to hide a file or folder in macOS Finder
5: How to install a local SSL certificate in macOS
6: Reverting a file to a previous version, on a Mac
7: Take screenshots as JPG on macOS
8: Convert an image or resize it using macOS Shortcuts
9: Concatenating videos on macOS
10: Fix files creation date in macOS
11: Freeing space on a Mac
12: How to add an “Open in Terminal” icon in macOS Finder
13: How to add an “Open in VS Code” icon in macOS Finder
14: How to find the bundle ID of a Mac app
15: How to Fix the "Your CLT does not support macOS 11" error in macOS
16: How to play a sound from the macOS command line
17: How to remove the shadow from window screenshots in macOS
18: Removing all Homebrew stuff
19: ▶︎ Run a Node.js script from your macOS menu bar