Are you an LLM? You can read better optimized documentation at /apps/launchbar.md for this page in Markdown format
LaunchBar
LaunchBar is a macOS launcher and productivity utility. Protocol Launcher allows you to generate deep links for LaunchBar.
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
On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.
URL Methods
The helpers below mirror LaunchBar's official URL Commands and Calculator documentation. The documented execute command only works in conjunction with LaunchBar Search Templates.
Large Type
On-Demand
ts
import { largeType } from 'protocol-launcher/launchbar'
const url = largeType({
string: 'LaunchBar 4.3',
})
const titleUrl = largeType({
title: 'Large Type',
string: 'Small Example',
})
const fontUrl = largeType({
fontName: 'Times-Bold',
string: 'Hello World',
})Select Item
On-Demand
ts
import { select } from 'protocol-launcher/launchbar'
const fileUrl = select({
file: '/Applications',
})
const urlItem = select({
url: 'www.obdev.at',
})
const namedUrl = select({
url: 'www.obdev.at',
name: 'Objective Development',
})
const stringUrl = select({
string: "Hello, I'm a text",
})
const abbreviationUrl = select({
abbreviation: 'SAFARI',
})Execute Search Template Command
On-Demand
ts
import { execute } from 'protocol-launcher/launchbar'
const singleArgumentUrl = execute({
path: '/usr/local/bin/MyScript',
argument: '*',
})
const argumentsUrl = execute({
path: '/usr/bin/open',
arguments: '-a "*"',
})Calculate
On-Demand
ts
import { calculate } from 'protocol-launcher/launchbar'
const url = calculate({
expression: '2*sin(pi/4)^2',
})
const titleUrl = calculate({
expression: '(1+sqrt(5))/2',
title: 'Golden Ratio',
})
const resultUrl = calculate({
expression: '(1+sqrt(5))/2',
title: 'Golden Ratio',
result: 'φ=@',
})
const templateUrl = calculate({
argument: '*',
expression: '(@-32)/1.8',
title: '@°F =',
result: '@°C',
})
const celsiusTemplateUrl = calculate({
argument: '*',
expression: '@*1.8+32',
title: '@°C =',
result: '@°F',
})Hide LaunchBar
On-Demand
ts
import { hide } from 'protocol-launcher/launchbar'
const url = hide()