Skip to content

Instantly share code, notes, and snippets.

@yazanzaid00
Last active October 2, 2025 21:05
Show Gist options
  • Save yazanzaid00/34593dced357648d29708b10d39a0cbb to your computer and use it in GitHub Desktop.
Save yazanzaid00/34593dced357648d29708b10d39a0cbb to your computer and use it in GitHub Desktop.
Run macOS Shortcuts Links Silently in the Background

ShortKit: Headless Shortcuts Launcher for macOS

Tired of shortcuts:// links opening the Shortcuts GUI app every time? ShortKit is a lightweight AppleScript application that registers its own custom shortkit:// URL scheme, allowing you to silently trigger Shortcuts in the background—no GUI.


Installation

1. Create the AppleScript

Open Script Editor and paste:

on open location theURL
    set oldDelims to AppleScript's text item delimiters
    set AppleScript's text item delimiters to {"?"}
    if (count of text items of theURL) < 2 then return
    set query to text item 2 of theURL

    set AppleScript's text item delimiters to {"&"}
    set pairs to text items of query

    set AppleScript's text item delimiters to {"="}
    set shortcutName to do shell script "echo " & quoted form of (text item 2 of item 1 of pairs) & " | sed -E 's/%20/ /g'"
    set textInput to do shell script "echo " & quoted form of (text item 2 of item 3 of pairs) & " | sed -E 's/%20/ /g; s/%7C/|/g'"

    set AppleScript's text item delimiters to oldDelims

    tell application "Shortcuts Events"
        run shortcut named shortcutName with input textInput
    end tell
end open location

Compile, then File → Export as an Application named ShortKit.app in /Applications.


2. Define the URL Scheme

Open ShortKit.app/Contents/Info.plist and insert:

<key>LSBackgroundOnly</key>
<true/>
<key>LSUIElement</key>
<true/>
<key>LSMultipleInstancesProhibited</key>
<true/>
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleTypeRole</key>
    <string>Viewer</string>
    <key>CFBundleURLName</key>
    <string>ShortKit URL Scheme</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>shortkit</string>
    </array>
  </dict>
</array>

In Terminal, verify and register:

plutil /Applications/ShortKit.app/Contents/Info.plist

3. Testing

Open The new URL scheme with your shortcuts name/input:

shortkit://run-shortcut?name=AirDrop%20Sorter%20Notification&input=text&text=reveal%7C/Users/yazan/Library/Mobile%20Documents/com~apple~CloudDocs/Downloads/IMG_8311.PNG

ShortKit will silently execute your Shortcut with exactly the text provided—no prompts, no interruptions.

Official Documentation: See Apple’s Shortcuts User Guide for more details about the native shortcuts:// URL scheme. ShortKit extends this capability on macOS by running shortcuts silently, without launching the Shortcuts app UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment