스위치바 API


Switchbar는 설정한 규칙에 따라 브라우저와 이메일 클라이언트에서 링크를 열 수 있는 URL 기반 API를 제공합니다.

URL 형식

switchbar://open/<link>

지원되는 링크 유형:

  • https://
  • http://
  • mailto:

링크를 퍼센트 인코딩하지 않고 그대로 덧붙이세요.

Switchbar는 기존 규칙과 링크 설정을 적용합니다. 일치하는 규칙이 없으면 링크를 열 위치를 선택하라는 메시지가 표시됩니다.

예시

터미널

macOS

open "switchbar://open/https://example.com"
open "switchbar://open/mailto:hello@example.com"

Windows

start "" "switchbar://open/https://example.com"

AppleScript

open location "switchbar://open/https://example.com"

JavaScript

window.location.href = "switchbar://open/https://example.com";

Swift

let url = URL(string: "switchbar://open/https://example.com")!
NSWorkspace.shared.open(url)

Choosy 호환성

Switchbar는 Choosy URL 스킴도 지원하므로 기존 스크립트와 연동 기능을 수정 없이 사용할 수 있습니다.

지원되는 URL 접두사:

x-choosy://open/
x-choosy://prompt.all/
x-choosy://prompt.running/
x-choosy://best.all/
x-choosy://best.running/

적절한 접두사 뒤에 대상 링크를 덧붙이세요.