Skip to content

Commit 8fdf203

Browse files
zhensherlockcodex
andcommitted
feat(DEVONthink): add DEVONthink URL scheme support
Co-Authored-By: Codex <267193182+codex@users.noreply.github.com>
1 parent d5c1488 commit 8fdf203

28 files changed

Lines changed: 1135 additions & 0 deletions

.changeset/mighty-stars-watch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'protocol-launcher': minor
3+
---
4+
5+
feat(DEVONthink): add DEVONthink URL scheme support

apps/docs/.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default defineConfig({
4848
'en/apps/cursor.md': 'apps/cursor.md',
4949
'en/apps/2do.md': 'apps/2do.md',
5050
'en/apps/day-one.md': 'apps/day-one.md',
51+
'en/apps/devonthink.md': 'apps/devonthink.md',
5152
'en/apps/dict-cc.md': 'apps/dict-cc.md',
5253
'en/apps/drafts.md': 'apps/drafts.md',
5354
'en/apps/editorial.md': 'apps/editorial.md',
@@ -207,6 +208,7 @@ export default defineConfig({
207208
{ text: 'Cursor', link: '/apps/cursor' },
208209
{ text: '2Do', link: '/apps/2do' },
209210
{ text: 'Day One', link: '/apps/day-one' },
211+
{ text: 'DEVONthink', link: '/apps/devonthink' },
210212
{ text: 'dict.cc', link: '/apps/dict-cc' },
211213
{ text: 'Drafts', link: '/apps/drafts' },
212214
{ text: 'Editorial', link: '/apps/editorial' },
@@ -372,6 +374,7 @@ export default defineConfig({
372374
{ text: 'Cursor', link: '/apps/cursor' },
373375
{ text: '2Do', link: '/apps/2do' },
374376
{ text: 'Day One', link: '/apps/day-one' },
377+
{ text: 'DEVONthink', link: '/apps/devonthink' },
375378
{ text: 'dict.cc', link: '/apps/dict-cc' },
376379
{ text: 'Drafts', link: '/apps/drafts' },
377380
{ text: 'Editorial', link: '/apps/editorial' },
@@ -502,6 +505,7 @@ export default defineConfig({
502505
{ text: 'Cursor', link: '/zh/apps/cursor' },
503506
{ text: '2Do', link: '/zh/apps/2do' },
504507
{ text: 'Day One', link: '/zh/apps/day-one' },
508+
{ text: 'DEVONthink', link: '/zh/apps/devonthink' },
505509
{ text: 'dict.cc', link: '/zh/apps/dict-cc' },
506510
{ text: 'Drafts', link: '/zh/apps/drafts' },
507511
{ text: 'Editorial', link: '/zh/apps/editorial' },
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const searchParams = {
2+
query: 'invoice',
3+
}

apps/docs/en/apps/devonthink.md

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
---
2+
layout: doc
3+
---
4+
5+
<script setup lang="ts">
6+
import { ref, computed } from 'vue';
7+
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue';
8+
import { clip, note, search } from 'protocol-launcher/devonthink';
9+
import { SelectInstallationMethod } from '../../.vitepress/components';
10+
import { searchParams } from '../../.vitepress/constants/devonthink';
11+
12+
const currentMethod = ref('On-Demand');
13+
const importPath = computed(() => currentMethod.value === 'On-Demand' ? 'protocol-launcher/devonthink' : 'protocol-launcher');
14+
</script>
15+
16+
# DEVONthink
17+
18+
[DEVONthink](https://www.devontechnologies.com/apps/devonthink) is a document and information manager for macOS. **Protocol Launcher** generates both DEVONthink URL commands (`x-devonthink://`) and DEVONthink item links (`x-devonthink-item://`) from the official DEVONthink Help references.
19+
20+
## Usage
21+
22+
There are two ways to use this library:
23+
24+
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
25+
- Full Import from the root package is convenient but includes all app modules.
26+
27+
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
28+
29+
<SelectInstallationMethod v-model="currentMethod" />
30+
31+
## URL Commands
32+
33+
DEVONthink URL commands use the `x-devonthink://<command>` scheme. They are commands, not x-callback-url links.
34+
35+
### Create Formatted Note
36+
37+
```ts-vue [{{currentMethod}}]
38+
import { {{ currentMethod === 'On-Demand' ? 'createFormattedNote' : 'devonthink' }} } from '{{ importPath }}'
39+
40+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createFormattedNote({
41+
title: 'New Note',
42+
source: '<p>Hello</p>',
43+
})
44+
```
45+
46+
### Create HTML
47+
48+
```ts-vue [{{currentMethod}}]
49+
import { {{ currentMethod === 'On-Demand' ? 'createHTML' : 'devonthink' }} } from '{{ importPath }}'
50+
51+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createHTML({
52+
title: 'Page',
53+
source: '<h1>Hello</h1>',
54+
})
55+
```
56+
57+
### Create Markdown
58+
59+
```ts-vue [{{currentMethod}}]
60+
import { {{ currentMethod === 'On-Demand' ? 'createMarkdown' : 'devonthink' }} } from '{{ importPath }}'
61+
62+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createMarkdown({
63+
title: 'Readme',
64+
text: '# Hello',
65+
})
66+
```
67+
68+
### Create PDF
69+
70+
```ts-vue [{{currentMethod}}]
71+
import { {{ currentMethod === 'On-Demand' ? 'createPDF' : 'devonthink' }} } from '{{ importPath }}'
72+
73+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createPDF({
74+
location: 'https://www.devontechnologies.com',
75+
width: 800,
76+
paginated: 1,
77+
})
78+
```
79+
80+
### Create RTF
81+
82+
```ts-vue [{{currentMethod}}]
83+
import { {{ currentMethod === 'On-Demand' ? 'createRTF' : 'devonthink' }} } from '{{ importPath }}'
84+
85+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createRTF({
86+
title: 'New bookmark',
87+
location: 'http://www.devontechnologies.com',
88+
noselector: 1,
89+
})
90+
91+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createRTF({
92+
title: 'Selection',
93+
selection: 'Selected text',
94+
})
95+
```
96+
97+
### Create Web Archive
98+
99+
```ts-vue [{{currentMethod}}]
100+
import { {{ currentMethod === 'On-Demand' ? 'createWebArchive' : 'devonthink' }} } from '{{ importPath }}'
101+
102+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createWebArchive({
103+
title: 'DEVONtechnologies',
104+
location: 'https://www.devontechnologies.com',
105+
})
106+
```
107+
108+
### Create Bookmark
109+
110+
```ts-vue [{{currentMethod}}]
111+
import { {{ currentMethod === 'On-Demand' ? 'createBookmark' : 'devonthink' }} } from '{{ importPath }}'
112+
113+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createBookmark({
114+
title: 'DEVONtechnologies',
115+
location: 'https://www.devontechnologies.com',
116+
})
117+
```
118+
119+
### Create Group
120+
121+
```ts-vue [{{currentMethod}}]
122+
import { {{ currentMethod === 'On-Demand' ? 'createGroup' : 'devonthink' }} } from '{{ importPath }}'
123+
124+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createGroup({
125+
title: 'Inbox',
126+
destination: 'F8E2A5A6-0000-0000-0000-000000000000',
127+
})
128+
```
129+
130+
### Create Text
131+
132+
```ts-vue [{{currentMethod}}]
133+
import { {{ currentMethod === 'On-Demand' ? 'createText' : 'devonthink' }} } from '{{ importPath }}'
134+
135+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}createText({
136+
title: 'Plain Note',
137+
text: 'Hello World',
138+
})
139+
```
140+
141+
### Clip
142+
143+
Open the Clip to DEVONthink panel.
144+
145+
```ts-vue [{{currentMethod}}]
146+
import { {{ currentMethod === 'On-Demand' ? 'clip' : 'devonthink' }} } from '{{ importPath }}'
147+
148+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}clip()
149+
```
150+
151+
<div class="flex justify-center">
152+
<VPLink :href="clip()" target="_self">
153+
Open Clip to DEVONthink
154+
</VPLink>
155+
</div>
156+
157+
### Note
158+
159+
Open the Take Note panel.
160+
161+
```ts-vue [{{currentMethod}}]
162+
import { {{ currentMethod === 'On-Demand' ? 'note' : 'devonthink' }} } from '{{ importPath }}'
163+
164+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}note()
165+
```
166+
167+
<div class="flex justify-center">
168+
<VPLink :href="note()" target="_self">
169+
Open Take Note
170+
</VPLink>
171+
</div>
172+
173+
### Search
174+
175+
Initiate a search in open DEVONthink databases.
176+
177+
```ts-vue [{{currentMethod}}]
178+
import { {{ currentMethod === 'On-Demand' ? 'search' : 'devonthink' }} } from '{{ importPath }}'
179+
180+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}search({
181+
query: 'invoice',
182+
})
183+
```
184+
185+
<div class="flex justify-center">
186+
<VPLink :href="search(searchParams)" target="_self">
187+
Search in DEVONthink
188+
</VPLink>
189+
</div>
190+
191+
## Item Links
192+
193+
DEVONthink item links use the `x-devonthink-item://<uuid>` scheme. They point to existing DEVONthink databases, groups, documents, or specific locations inside supported documents.
194+
195+
### Item Link
196+
197+
```ts-vue [{{currentMethod}}]
198+
import { {{ currentMethod === 'On-Demand' ? 'itemLink' : 'devonthink' }} } from '{{ importPath }}'
199+
200+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}itemLink({
201+
uuid: '929D101B-35AC-474C-801C-D8818C48DB80',
202+
reveal: 1,
203+
})
204+
205+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}itemLink({
206+
uuid: 'PDF-ID',
207+
page: 5,
208+
})
209+
210+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}itemLink({
211+
uuid: 'TEXT-FILE-ID',
212+
search: 'iPad Pro',
213+
})
214+
215+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}itemLink({
216+
uuid: 'MOVIE-ID',
217+
time: 43.5,
218+
})
219+
220+
const url = {{currentMethod === 'On-Demand' ? '' : 'devonthink.'}}itemLink({
221+
uuid: '929D101B-35AC-474C-801C-D8818C48DB80',
222+
line: 125,
223+
})
224+
```
225+
226+
## Official References
227+
228+
- [DEVONthink URL Commands](https://download.devontechnologies.com/download/devonthink/3.8.2/DEVONthink.help/Contents/Resources/pgs/automation-urlcommands.html)
229+
- [DEVONthink Item Links](https://download.devontechnologies.com/download/devonthink/3.8.2/DEVONthink.help/Contents/Resources/pgs/automation-itemlinks.html)

apps/docs/en/guide/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ For detailed usage instructions for each application, please refer to their resp
147147
- [Cursor](../apps/cursor.md)
148148
- [2Do](../apps/2do.md)
149149
- [Day One](../apps/day-one.md)
150+
- [DEVONthink](../apps/devonthink.md)
150151
- [dict.cc](../apps/dict-cc.md)
151152
- [Drafts](../apps/drafts.md)
152153
- [Editorial](../apps/editorial.md)

apps/docs/en/guide/what-is-it.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Currently, we support the following applications:
5050
- [Cursor](../apps/cursor.md)
5151
- [2Do](../apps/2do.md)
5252
- [Day One](../apps/day-one.md)
53+
- [DEVONthink](../apps/devonthink.md)
5354
- [dict.cc](../apps/dict-cc.md)
5455
- [Drafts](../apps/drafts.md)
5556
- [Editorial](../apps/editorial.md)

0 commit comments

Comments
 (0)