Skip to content

Instantly share code, notes, and snippets.

@extratone
Created March 22, 2022 11:22
Show Gist options
  • Save extratone/fad566227f81d12c4468149ea293585b to your computer and use it in GitHub Desktop.
Save extratone/fad566227f81d12c4468149ea293585b to your computer and use it in GitHub Desktop.
Excerpt from BBEdit's User Manual regarding its URL Scheme/x-callback-url support.

BBEdit now supports using the ‘x-bbedit’ URL scheme for opening files, and optionally specifying destination line and column numbers. The syntax for this scheme is:

x-bbedit://open?url=file:///path/to/some/file

where ‘/path/to/some/file’ is the actual path to the file you want BBEdit to open.

You can also specify a specific line to select when opening the file; for example: x-bbedit://open?url=file:///path/to/some/file&line=5

or if you also include add a column position, then BBEdit will place the insertion point before the indicated character on the previously-specified line: x-bbedit://open?url=file:///path/to/some/file&line=5&column=42 Try clicking on this URL, and you’ll see that it opens one of your local files in BBEdit, even though you’re viewing it in a browser window:

x-bbedit://open?url=file:///etc/hosts

An ‘x-bbedit’ URL is guaranteed to launch BBEdit when opened from another application, unlike ‘file’ or ‘editor’ URLs, which are at the mercy of the OS to decide which application should open any given file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment