A small AppleScript that grabs the URL of Safari's active tab and runs fabric link <url> (stand-in until Fabric ships a native Safari extension).
Two versions in this gist:
fabric-link.applescript— minimal, zero dependencies. Notification posts via AppleScript's built-indisplay notification(icon is the script's host app, e.g. Script Editor or Raycast).fabric-link-alerter.applescript— notification shows the Fabric app icon and clicking it opens Fabric.app. Requiresalerter— a modern (UNUserNotificationCenter-based) replacement forterminal-notifier, which is abandoned and has broken click handling on macOS Sonoma/Sequoia.
- macOS (Sonoma 14+ recommended), Safari
fabricCLI installed and authenticated- First run prompts for Automation + Notification permissions — allow both
The script auto-locates fabric via (1) login-shell PATH, (2) ~/.fabric/bin/fabric, (3) /opt/homebrew/bin/fabric, (4) /usr/local/bin/fabric.
- Save the
.applescriptinto a folder Raycast watches (Raycast → Extensions → Script Commands → Add Directories). chmod +x <path>/fabric-link.applescript- The command appears in Raycast as "Fabric Link (current Safari tab)". Bind a hotkey if you want.
Pick any of:
- Shortcuts.app — create a shortcut with a single "Run AppleScript" action containing the script body. Toggle Pin in Menu Bar or assign a keyboard shortcut in System Settings → Keyboard → Keyboard Shortcuts → Services.
- Script Editor — open the file, File → Export… → File Format: Application. Drop the resulting
.appin your Dock. - Terminal —
osascript /path/to/fabric-link.applescript
Use fabric-link-alerter.applescript if you want:
- The notification to show Fabric's icon instead of Script Editor's / Raycast's
- Clicking the notification to open (or foreground) Fabric.app
Install alerter:
brew install vjeantet/tap/alerterThen same setup as above.
terminal-notifier (previously the common tool for this) was last released in November 2017 and is built on the deprecated NSUserNotification API. On macOS Sonoma/Sequoia its click handlers (-activate, -execute, -open) frequently do not fire at all. alerter is the maintained successor using the modern UNUserNotificationCenter API and works reliably on current macOS.