|
| 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) |
0 commit comments