# Integrate with Desktop Apps via Custom URL Schemes

Operating systems allow applications to register a custom URL scheme (as opposed to, e.g., `https://`). Applications (including the Web Browser) can use this to deep-link into and perform actions in other desktop applications

Some popular productivity applications supporting URL schemes:

* [Drafts](https://docs.getdrafts.com/docs/automation/urlschemes)
* [Omnifocus](https://inside.omnifocus.com/url-schemes)
* [Obsidian](https://help.obsidian.md/Concepts/Obsidian+URI)
* [Zoom](https://marketplace.zoomgov.com/docs/guides/guides/client-url-schemes)
* [Slack](https://api.slack.com/reference/deep-linking#client)
* [Microsoft Power Automate](https://learn.microsoft.com/en-us/power-automate/desktop-flows/run-desktop-flows-url-shortcuts#create-a-run-url)

### Using a Custom URL Scheme

To use a custom URL scheme, you can use the `@pixiebrix/browser/open-tab` brick just like with a normal URL

Depending on the application, you may need to specify a different encoding for spaces URL query parameters using the `spaceEncoding`. For most cases, the default `%20` encoding is what's expected. But you may need to use `+` in some cases.

### Advanced: Disable Browser Confirmation

{% hint style="warning" %}
By disabling the confirmation, a malicious site could trick you into performing an action in a desktop application. That being said, most applications do not expose destructive actions via URL schemes for this reason
{% endhint %}

When you try to navigate to a link with a custom URL scheme, Chrome will prompt you to open the application:

<figure><img src="/files/PZOd9RmLFGxpHGQWaE2c" alt=""><figcaption></figcaption></figure>

If you're trying to trigger a lot of actions, that can become tedious. Here [are some steps for disabling the confirmation in Chrome](https://superuser.com/questions/1481851/disable-chrome-to-ask-for-confirmation-to-open-external-application-everytime/1518982#1518982).

#### MacOS

1. [Open the terminal](https://www.howtogeek.com/682770/how-to-open-the-terminal-on-a-mac/)
2. In the prompt, enter the following with the URL scheme for the application you're using. For example, the [Drafts](https://docs.getdrafts.com/docs/automation/urlschemes) URL scheme is `drafts://`, so we'd enter:

   ```yaml
   defaults write com.google.Chrome URLAllowlist -array-add 'drafts://*'
   ```
3. Restart Chrome

### Desktop Developer Resources

* [Mac: Defining a Custom URL Scheme for Your App](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pixiebrix.com/integrations/integrate-with-desktop-apps-via-custom-url-schemes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
