DEVONthink/README.md

73 lines
3 KiB
Markdown
Raw Normal View History

2024-10-26 22:55:25 +02:00
# DEVONthink
2024-10-26 23:40:07 +02:00
Code for various AppleScripts I've written or modified for DEVONthink Pro 3
## 🔗 Bates Source Link - Citation Generator
2024-10-27 01:35:35 +02:00
Creates Markdown-formatted citations from DEVONthink documents, with deeplinks and Bates number support. Perfect for reviewing administrative records in DEVONthink.
2024-10-26 23:40:07 +02:00
2024-10-28 01:53:51 +01:00
https://lone.earth/w/bZchr5AWTZtaWYZYBdMypk
[![Video Title](thumbnail-image.jpg)](https://video-url.com)
<iframe title="DEVONthink Bates deeplink script demo" width="560" height="315" src="https://lone.earth/videos/embed/58f7bc2e-487f-45c0-857a-9564821348f1" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups allow-forms"></iframe>
2024-10-28 01:54:44 +01:00
<div style="position: relative; padding-top: 56.25%;"><iframe title="DEVONthink Bates deeplink script demo" width="100%" height="100%" src="https://lone.earth/videos/embed/58f7bc2e-487f-45c0-857a-9564821348f1?warningTitle=0" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" style="position: absolute; inset: 0px;"></iframe></div>
2024-10-28 01:53:51 +01:00
2024-10-26 23:40:07 +02:00
## Usage
1. Open document in DEVONthink
2. Select text to quote
3. Run script
2024-10-27 01:35:35 +02:00
4. Paste formatted citation into a Markdown editor
## Features
- Copies selected text to clipboard
- Calculates and generates a Bates cite using if filename is compatible (see below), e.g., `FWS 134` (if the selected text is on page 3 of a file that is named, e.g., `FWS_000131.pdf`)
- For non-Bates numbered documents, it generates a standardized cite, e.g., `IPCC Report at 5` (if the selected text is on page 5 of a file that is named `IPCC Report.pdf`)
- Appends Markdown-formatted deeplink to selected text in document to clipboard, using the generated page number (Bates or non-Bates) (see Output Examples below)
## Bates-compatible Filenames
The script will parse several different Bates-numbered filenaming conventions, including, for example:
- `FWS 000533.pdf`
- `FWS-000533.pdf`
- `FWS_000533.pdf`
- `NMFS 002561-002985.pdf`
- `BLM 45.pdf`
- `BLM_45-62.pdf`
Use my `bates` script to quickly rename a batch of PDFs (e.g. a complete administrative record) to be compatible with this script while preserving original names in metadata. [Find it here →](https://sij.ai/sij/pathScripts)
2024-10-26 23:40:07 +02:00
## Output Examples
```
2024-10-27 01:35:35 +02:00
"The environmental impact study shows..." [FWS 4326](x-devonthink-item://...)
2024-10-26 23:40:07 +02:00
"The data indicates..." [Report Title at 5](x-devonthink-item://...)
```
## Installation
2024-10-27 01:35:35 +02:00
1. Open `Applications/Script Editor.app`
2. Paste in the script and save it as `Bates Source Link.scpt`
3. Open DEVONthink
4. Scripts menu → Open Scripts Folder
5. Copy or move script to `Menu` subfolder
2024-10-26 23:40:07 +02:00
2024-10-27 01:35:35 +02:00
## Assign a Keyboard Shortcut (Recommended)
2024-10-26 23:40:07 +02:00
2024-10-27 01:35:35 +02:00
1.  System Settings → Keyboard → Keyboard Shortcuts → App Shortcuts
2. Select `DEVONthink 3.app` and click `+`
3. Enter exact script name as it appears in the `Scripts` menu in DEVONthink, i.e., `Bates Source Link`
4. Assign desired shortcut, such as:
- `⌥ + C` (Option C)
- `⇧ ⌥ + C` (Option Shift C)
2024-10-26 23:40:07 +02:00
## Requirements
- macOS
- Perl (for URL encoding)
2024-10-27 01:35:35 +02:00
- DEVONthink Pro