Skip to content

Longshot

Longshot is a powerful screenshot and screen recording tool for macOS. Protocol Launcher allows you to generate deep links to trigger actions like screenshot, recording, OCR, and more in Longshot.

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.

Start Screenshot

On-Demand
ts
import { snip } from 'protocol-launcher/longshot'

const url = snip({
  func: 'start',
})

Start Area Recording

On-Demand
ts
import { record } from 'protocol-launcher/longshot'

const url = record({
  func: 'startArea',
})

Start OCR

On-Demand
ts
import { ocr } from 'protocol-launcher/longshot'

const url = ocr({
  func: 'start',
})

Start Screen Measurement

On-Demand
ts
import { rule } from 'protocol-launcher/longshot'

const url = rule({
  func: 'start',
})

Open Preferences

On-Demand
ts
import { pref } from 'protocol-launcher/longshot'

const url = pref({
  page: 'shortcuts',
})