Skip to content

Inter App Communication

BB9z edited this page Apr 21, 2023 · 2 revisions

B9ChatAI supports the utilization of URLs with the b9chatai:// or b9software.chat-ai:// prefix. These URLs can be used to interact with B9ChatAI and carry out particular tasks in other applications.

Work with Raycast

By using Raycast Quicklinks, you can invoke B9ChatAI in this powerful productivity application to quickly switch to a specific conversation and send content quickly.

guide raycast-send

In the conversation menu, you can copy the link used for Quicklink:

guide copy-intent-links

Simply paste the copied link when creating a Quicklink:

guide raycast-create-quicklink

Send Selected Text in Browsers

Currently, you can send text via JavaScript bookmarks. In the menu above the chat, you can find the option to copy the chat browser bookmark. Clicking on it will copy the bookmark URL to the clipboard:

Chrome

Video:

jsbookmark-chrome.mp4

Reference steps:

  1. Copy the bookmark link from the app menu
  2. Add a bookmark in Chrome and modify the URL
  3. Select text, click on the link in the bookmark bar; if everything works correctly, the selected text will be sent to the app

Safari

Video:

jsbookmark-demo-safari.mp4

Reference steps:

  1. Copy the bookmark link from the app menu
  2. Create a bookmark
  3. Find the bookmark you just created and modify the address
  4. Select text, click on the link in the bookmark bar; if everything works correctly, the selected text will be sent to the app

Tip: Safrai can always show the Favorites bar in the menu

Send Text from Terminal or Shell Scripts

You can control B9ChatAI through the open command

# Send "say hello from Terminal" to the default chat
open "b9chatai://send?text=say%20hello%20from%20Terminal"

# Send content to a chat with conversation ID 'demo'
open "b9chatai://send?id=demo&text=say%20hello%20from%20Terminal"

App Scheme Details

An app invocation link generally consists of the following three parts:

URL parts
  • Scheme, which can be b9chatai:// or b9software.chat-ai://
  • Command: Tells the app which action to perform
  • Parameters: Contains several parameters

All fields are case-sensitive.

send command

Supported from v0.2, currently supports two parameters

  • id, optional, chat ID, you can copy and set them in the chat settings.

    • If not specified, it first looks for a chat with an ID of 'default'; if none is found, it uses the first chat in the list
    • If the specified ID does not exist, no action is performed
  • text, optional, the text content to be sent. Not sending text is equivalent to activating the specified chat, which can be used to switch between chats

Use SchemePlayground for debugging

You can download this helper program to debug link invocation

Download SchemePlayground.zip