Skip to content

Anybox

Anybox 是一个用于保存、查找和整理链接的书签与链接管理应用。Protocol Launcher 基于官方 URL Schemes 文档生成 Anybox URL,包括 save、paste、Quick Find、macOS 工具、iOS 照片动作,以及 x-callback-url save/paste 动作。

使用方式

有两种使用此库的方式:

  • 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
  • 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。

生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

显示 Anybox

On-Demand
ts
import { show } from 'protocol-launcher/anybox'

const url = show()

粘贴剪贴板内容

On-Demand
ts
import { paste } from 'protocol-launcher/anybox'

const url = paste({
  tag: 'Reading',
  starred: 'yes',
})

保存文本内容

On-Demand
ts
import { save } from 'protocol-launcher/anybox'

const url = save({
  text: 'https://example.com/article',
  tag: 'Reading',
  starred: 'yes',
  archive: 'webarchive',
})

下载 URL(macOS)

On-Demand
ts
import { download } from 'protocol-launcher/anybox'

const url = download({
  url: 'https://example.com/file.pdf',
  tag: 'Reading',
})

保存当前标签页(macOS)

On-Demand
ts
import { saveTab } from 'protocol-launcher/anybox'

const url = saveTab({
  tag: 'Reading',
  starred: 'yes',
  archive: 'pdf',
})

从剪贴板打开链接

On-Demand
ts
import { openLinkFromPasteboard } from 'protocol-launcher/anybox'

const url = openLinkFromPasteboard()

将剪贴板链接复制为 Markdown(macOS)

On-Demand
ts
import { copyPasteboardLinkAsMarkdown } from 'protocol-launcher/anybox'

const url = copyPasteboardLinkAsMarkdown()

Quick Find

On-Demand
ts
import { quickFind } from 'protocol-launcher/anybox'

const url = quickFind({
  q: 'research',
})

Quick Save(macOS)

On-Demand
ts
import { quickSave } from 'protocol-launcher/anybox'

const url = quickSave()

Stash Box(macOS)

On-Demand
ts
import { stashBox } from 'protocol-launcher/anybox'

const url = stashBox()

切换 Anydock(macOS)

On-Demand
ts
import { toggleAnydock } from 'protocol-launcher/anybox'

const url = toggleAnydock()

新建笔记(iOS)

On-Demand
ts
import { newNote } from 'protocol-launcher/anybox'

const url = newNote()

最新照片(iOS)

On-Demand
ts
import { latestPhoto } from 'protocol-launcher/anybox'

const url = latestPhoto()

照片(iOS)

On-Demand
ts
import { photos } from 'protocol-launcher/anybox'

const url = photos()

x-callback-url 保存

On-Demand
ts
import { xCallbackSave } from 'protocol-launcher/anybox'

const url = xCallbackSave({
  text: 'helloWorld',
  xSuccess: 'successURL',
  xError: 'errorURL',
})

x-callback-url 粘贴

On-Demand
ts
import { xCallbackPaste } from 'protocol-launcher/anybox'

const url = xCallbackPaste({
  xSuccess: 'successURL',
  xError: 'errorURL',
})