自动传输、远程设置设置和控制许可证。
你可以通过调用 URL offshoot:// 来告诉 OffShoot 执行某些操作。你可以从任何能够打开 URL 的应用程序或脚本中调用此 URL 。
offshoot:// 改为 hedge:// 就可以了。复制/粘贴下面的网址到一个网络浏览器中,按下 Enter 键,OffShoot 将会打开。
offshoot://open
请将下面的命令复制/粘贴到终端中,按下 Enter 键,OffShoot 将会打开。
使用终端
open 'offshoot://open'
使用 PowerShell
start 'offshoot://open'
AppleScript:
do shell script ("open 'offshoot://open'")
Python:
import os
os.system("start 'offshoot://open'")
Python:
import os
os.system("start 'offshoot://open'")
API调用的结果被记录在一个文本文件中。
位置: ~/Library/Logs/Hedge/urlSchemeResponseLog.txt
这个日志将包含一行 success 或 fail 状态。在OffShoot启动时为空,在每次调用后清空。
位置: C:\Users\$username\AppData\Roaming\Hedge\HedgeCallback.log
这是一个多行日志。它在应用启动时和每次调用后都会清空。
$time | $id | $arguments_passed
$time | $id | $call_result
控制 OffShoot 的应用程序状态。
offshoot://open
offshoot://quit
offshoot://restart
offshoot://update
offshoot://activate?key=xxxx-xxxx-xxxx-xxxx
| URL 参数 | 类型 | 描述 |
|---|---|---|
| key | 字符串 | 必填 |
offshoot://deactivate
actions 调用允许您在单个请求中传递多个 API 调用:
offshoot://actions?json=[{"<action>":{"<property>": "<value>"},},{"<action>":{"<property>": "<value>"}}]
| URL 参数 | 类型 | 描述 |
|---|---|---|
| json | 包含 JSON 对象的数组 | 必填 |
| <action> | 字符串 | API 操作 |
| <property> | 字符串 | 操作属性 |
| <value> | 各种 | 属性的值 |
比如,你可以将以下两个操作包含在一个动作链中:
offshoot://deactivate
offshoot://activate?key=xxxx-xxxx-xxxx-xxxx
改写的动作链为:
offshoot://actions?json=[{"deactivate":{}},{"activate":{"key":"xxxx-xxxx-xxxx-xxxx"}}]
{}传递。从sources(来源)和 / 或 destinations(目标) 拖放区域中移除磁盘。现有的传输不受影响。如果未定义type,则源和目标都将被重置。
offshoot://reset?type="sources"
| URL 参数 | 类型 | 描述 |
|---|---|---|
| type | Sting | 可选的 sources 或 destinations |
设置一个单一的源或一组路径,并在定义时应用一个标签。
offshoot://setSource?paths=["/Volumes/UNTITLED"]&label=Clips
| URL 参数 | 类型 | 描述 |
|---|---|---|
| paths | Array | 必需的 |
| label | String | 可选的 |
终端示例:
open 'offshoot://actions?json=[{"setSource":{"paths":["/Volumes/Untitled/The Clips"],"label":"test"}}]'
使用URL编码的json键值对进行调用
open 'offshoot://actions?json=%5B%7B%22setSource%22%3A%7B%22paths%22%3A%5B%22%2FVolumes%2FUntitled%2FThe%20Clips%22%5D%2C%22label%22%3A%22test%22%7D%7D%5D
PowerShell 示例:
带有转义引号的调用
start 'offshoot://actions?json=[{\"setSource\":{\"paths\":[\"G:\The Clips\"],\"label\":\"test\"}}]'
使用URL编码的json键值对进行调用
start 'offshoot://actions?json=[{"setSource":{"paths":["G:\The Clips"],"label":"test"}}]'
编码结果为
start 'offshoot://actions?json=%5B%7B%22setSource%22%3A%7B%22paths%22%3A%5B%22G%3A%5CThe%20Clips%22%5D%2C%22label%22%3A%22test%22%7D%7D%5D'
设置单个目标
offshoot://setDestination?path=/Volumes/BACKUP
| URL 参数 | 类型 | 描述 |
|---|---|---|
| path | 数组 | 必需/URL 编码 |
终端示例:
open 'offshoot://actions?json=[{"setDestination":{"path":"/Volumes/Untitled/The Project"}}]'
使用URL编码的json键值对进行调用
open 'offshoot://actions?json=%5B%7B%22setDestination%22%3A%7B%22path%22%3A%22%2FVolumes%2FUntitled%2FThe%20Project%22%7D%7D%5D'
PowerShell 示例:
带有转义引号的调用
start 'offshoot://actions?json=[{\"setDestination\":{\"path\":\"G:\The Clips\"}}]'
使用URL编码的json键值对进行调用
start 'offshoot://actions?json=[{"setSource":{"paths":["G:\The Clips"],"label":"test"}}]'
编码结果为
start 'offshoot://actions?json=%5B%7B%22setSource%22%3A%7B%22paths%22%3A%5B%22G%3A%5CThe%20Clips%22%5D%2C%22label%22%3A%22test%22%7D%7D%5D'
创建所有新的源和目标组合的传输。与在OffShoot中按下Add Transfers按钮相同。
offshoot://addTransfers
将特定首选项设置为特定值。此处提供了所有键名的完整列表:
/Applications/OffShoot.app/Contents/Resources/SFIDefaults.plist
~/Library/Preferences/nl.syncfactory.Hedge.Mac.plist
offshoot://setPreferences?preferences={"SFIDefaultsAutoSources":"0"}
| URL 参数 | 类型 | 描述 |
|---|---|---|
| preferences | JSON 对象 | 必填 |
SetPreferences 操作仅适用于 macOS。在 Windows 上,您可以在 Windows 注册表的 <current-user>\Software\Hedge 下设置相应的键和值。