Skip to content

Add bettercapture extension#28828

Open
qlaffont wants to merge 8 commits into
raycast:mainfrom
qlaffont:ext/bettercapture
Open

Add bettercapture extension#28828
qlaffont wants to merge 8 commits into
raycast:mainfrom
qlaffont:ext/bettercapture

Conversation

@qlaffont

@qlaffont qlaffont commented Jun 17, 2026

Copy link
Copy Markdown

Description

Adds a new extension to control BetterCapture — a free, open-source macOS screen recorder — from Raycast.

BetterCapture has no CLI or AppleScript API today. This extension integrates via two strategies:

  1. URL scheme (preferred) — When BetterCapture supports bettercapture:// URLs, commands use deep links with no extra permissions.
  2. Keyboard shortcut relay (fallback) — On current releases, Toggle Record relays the user's configured BetterCapture global shortcut via AppleScript.

Commands

Command Action
Toggle Record Stop an active recording, or open content selection (Pick Content / Select Area) to start a new one
Open Recordings Open the BetterCapture output folder in Finder (~/Movies/BetterCapture by default)

Both commands are no-view and show a HUD on success or a failure toast with actionable setup instructions.

Integration details

  • Toggle Record
    • If bettercapture://toggle is available → opens URL (BetterCapture handles stop vs. content selection)
    • Otherwise → launches BetterCapture if needed, reads KeyboardShortcuts_toggleRecording from UserDefaults, relays keystroke via System Events
    • Requires BetterCapture Toggle Recording shortcut configured + Raycast Accessibility permission on current releases
  • Open Recordings
    • If bettercapture://open-recordings is available → opens URL (respects custom output folder inside BetterCapture)
    • Otherwise → opens ~/Movies/BetterCapture in Finder

Upstream URL scheme proposal: jsattler/BetterCapture#170 · Discussion: jsattler/BetterCapture#169

Source repo: qlaffont/bettercapture-raycast

Screencast

Recommended demo flow:

  1. Run Toggle Record while BetterCapture is idle → content picker opens
  2. Select content, run Toggle Record again → recording stops
  3. Run Open Recordings → Finder opens the output folder

Use Raycast Window Capture (Preferences → Advanced) with "Save to Metadata" to add store screenshots.

Setup (for reviewers)

  1. Install BetterCapture: brew install bettercapture
  2. Open BetterCapture → Settings → Shortcuts → set Toggle Recording (required for fallback path)
  3. Grant Raycast Accessibility in System Settings → Privacy & Security (required for fallback path)
  4. Run npm run build in extensions/bettercapture and test the distribution build in Raycast

Checklist

@raycastbot raycastbot added new extension Label for PRs with new extensions platform: macOS labels Jun 17, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@qlaffont qlaffont marked this pull request as ready for review June 17, 2026 08:06
@socket-security

socket-security Bot commented Jun 17, 2026

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a new bettercapture extension that controls the BetterCapture macOS screen recorder from Raycast via two no-view commands: Toggle Record and Open Recordings.

  • Implements a dual-strategy integration: URL scheme (bettercapture://) when supported, with an AppleScript keyboard-shortcut relay as the fallback for current BetterCapture releases.
  • Error handling is well-structured with a typed BetterCaptureError class surfacing actionable messages via Toast; all previous review feedback (category, changelog heading, recordings folder opening, shortcut error wrapping) has been addressed.

Confidence Score: 5/5

Safe to merge; the integration logic is straightforward and well-guarded, with no data-loss or silent-failure paths on the happy route.

All changed files are new extension code with no impact on other extensions. The core commands are no-view and all error paths show actionable toasts. The two findings are minor polish items that don't affect correctness on current BetterCapture releases.

extensions/bettercapture/src/lib/bettercapture.ts — the supportsUrlScheme plist index assumption will need verification when upstream PR #170 lands.

Important Files Changed

Filename Overview
extensions/bettercapture/src/lib/bettercapture.ts Core library with two integration strategies (URL scheme + AppleScript fallback); minor concern around hardcoded PlistBuddy index path and synchronous app launch call
extensions/bettercapture/src/lib/carbon-keys.ts Carbon key-code mapping table and AppleScript serializer; logic looks correct, errors are properly propagated
extensions/bettercapture/src/toggle-record.ts No-view command; catches both BetterCaptureError (actionable message) and unexpected errors (generic message) and surfaces them via Toast
extensions/bettercapture/src/open-recordings.ts No-view command; delegates to openRecordings() and handles errors appropriately
extensions/bettercapture/package.json Valid Raycast manifest with $schema, "Applications" category, macOS platform, correct command modes; all dependencies are used in source files
extensions/bettercapture/eslint.config.js Uses defineConfig from eslint/config with @raycast/eslint-config; follows the correct ESLint v9 flat-config pattern
extensions/bettercapture/CHANGELOG.md Uses [Initial Release] heading with {PR_MERGE_DATE} placeholder; follows Raycast changelog conventions

Reviews (5): Last reviewed commit: "Format bettercapture.ts with Prettier 3...." | Re-trigger Greptile

Comment thread extensions/bettercapture/package.json
Comment thread extensions/bettercapture/CHANGELOG.md Outdated
Comment thread extensions/bettercapture/src/lib/bettercapture.ts
qlaffont and others added 4 commits June 17, 2026 10:12
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread extensions/bettercapture/src/lib/bettercapture.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants