macOS
macOS is a graphical operating system developed by Apple Inc. As the first commercially successful graphical user interface system, it is designed specifically for the Macintosh series of computers, featuring an XNU hybrid kernel architecture and inheriting UNIX system characteristics. Protocol Launcher allows you to generate deep links to open and interact with built-in macOS apps like Calendar, FaceTime, Find My, Mail, SMS, and Wallet.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
Open Calendar
Open the Calendar app, optionally with a webcal subscription link.
import { calendar } from 'protocol-launcher/macos'
// Open Calendar app
const url = calendar()
// Open Calendar with webcal subscription
const url = calendar({
link: 'https://p10-calendars.icloud.com/holiday/CN_zh.ics',
})Open FaceTime
Open the FaceTime app, optionally with a phone number.
import { facetime } from 'protocol-launcher/macos'
const url = facetime({
phone: '1234567890',
})Open Find My
Open the Find My app, optionally specifying a tab (devices, items, or friends).
import { findMy } from 'protocol-launcher/macos'
// Open Find My app
const url = findMy()
// Open Devices tab
const url = findMy({
tab: 'devices',
})
// Open Items tab
const url = findMy({
tab: 'items',
})
// Open Friends tab
const url = findMy({
tab: 'friends',
})Open Mail
Open the Mail app.
import { mail } from 'protocol-launcher/macos'
const url = mail()Open SMS
Open the SMS app, optionally with a phone number.
import { sms } from 'protocol-launcher/macos'
// Open SMS app
const url = sms()
// Open SMS with phone number
const url = sms({
phone: '1234567890',
})Open Wallet
Open the Wallet app.
import { wallet } from 'protocol-launcher/macos'
const url = wallet()Open Address Book
Open the Address Book app.
import { addressbook } from 'protocol-launcher/macos'
const url = addressbook()Open Feedback
Open the Feedback Assistant app, optionally to submit new feedback.
import { feedback } from 'protocol-launcher/macos'
// Open Feedback Assistant
const url = feedback()
// Open Feedback Assistant to submit new feedback
const url = feedback({
type: 'new',
})Open Notes
Open the Notes app.
import { notes } from 'protocol-launcher/macos'
const url = notes()Open Reminders
Open the Reminders app.
import { reminders } from 'protocol-launcher/macos'
const url = reminders()Open Stocks
Open the Stocks app, optionally with a stock symbol.
import { stocks } from 'protocol-launcher/macos'
// Open Stocks app
const url = stocks()
// Open Stocks with symbol
const url = stocks({
symbol: 'GE',
})Open Videos
Open the Videos app.
import { videos } from 'protocol-launcher/macos'
const url = videos()Open Weather
Open the Weather app.
import { weather } from 'protocol-launcher/macos'
const url = weather()Open Books
Open the Books app.
import { books } from 'protocol-launcher/macos'
const url = books()Open Music
Open the Music app.
import { music } from 'protocol-launcher/macos'
const url = music()Open Photos
Open the Photos app.
import { photos } from 'protocol-launcher/macos'
const url = photos()Open Podcasts
Open the Podcasts app.
import { podcasts } from 'protocol-launcher/macos'
const url = podcasts()Open System Preferences
Open the System Preferences (Settings) app, optionally with a specific preference pane.
import { systemPreferences } from 'protocol-launcher/macos'
// Open System Preferences
const url = systemPreferences()
// Open Security & Privacy pane
const url = systemPreferences({
pane: 'com.apple.preference.security',
})
// Open Software Update pane
const url = systemPreferences({
pane: 'com.apple.preferences.softwareupdate',
})Open Airport Utility
Open the Airport Utility app.
import { airport } from 'protocol-launcher/macos'
const url = airport()Open Dictionary
Search dictionaries for a term.
import { dictionary } from 'protocol-launcher/macos'
// Search dictionary
const url = dictionary()
// Search dictionary with term
const url = dictionary({
term: 'hello',
})Open Freeform
Open the Freeform app.
import { freeform } from 'protocol-launcher/macos'
const url = freeform()Open Help Viewer
Open the Help Viewer app, optionally with a specific collection.
import { helpViewer } from 'protocol-launcher/macos'
// Open Help Viewer
const url = helpViewer()
// Open Help Viewer with collection
const url = helpViewer({
collection: 'WelcomeToMac',
})Open Printer Settings
Add a printer, optionally with a hostname or IP address.
import { printer } from 'protocol-launcher/macos'
// Add printer
const url = printer()
// Add printer with host
const url = printer({
host: '192.168.1.100',
})