# Automation

**URL:** https://discourse.devontechnologies.com/c/devonthink/scripting/18.md

[Latest](https://discourse.devontechnologies.com/latest.md) · [Categories](https://discourse.devontechnologies.com/categories.md) · [Tags](https://discourse.devontechnologies.com/tags.md)

---

## [About the Automation category](https://discourse.devontechnologies.com/t/about-the-automation-category/25)

<div class="topic-metadata">

**Author:** [@system](https://discourse.devontechnologies.com/u/system)\
**Replies:** 1\
**Last updated:** [April 7, 2019, 10:03pm UTC](https://discourse.devontechnologies.com/t/about-the-automation-category/25 "2019-04-07T22:03:18Z")

</div>

Learn how to automate DEVONthink Pro

---

## [Any plans on adding creation and manipulation of (smart)rules via mcp/automation?](https://discourse.devontechnologies.com/t/any-plans-on-adding-creation-and-manipulation-of-smart-rules-via-mcp-automation/87722)

<div class="topic-metadata">

**Author:** [@Pfitz](https://discourse.devontechnologies.com/u/Pfitz)\
**Replies:** 1\
**Last updated:** [September 28, 2026, 11:53am UTC](https://discourse.devontechnologies.com/t/any-plans-on-adding-creation-and-manipulation-of-smart-rules-via-mcp-automation/87722 "2026-09-28T11:53:07Z")

</div>

I really would enjoy creating smart rules via nutural language via the mcp or chat. I know that this would be a niche request but I ask anyway. Thank you for the good work!

---

## [Feature Request: Automating PDF internal page links](https://discourse.devontechnologies.com/t/feature-request-automating-pdf-internal-page-links/87237)

<div class="topic-metadata">

**Author:** [@stratadata](https://discourse.devontechnologies.com/u/stratadata)\
**Replies:** 8\
**Last updated:** [September 25, 2026, 5:22am UTC](https://discourse.devontechnologies.com/t/feature-request-automating-pdf-internal-page-links/87237 "2026-09-25T05:22:04Z")

</div>

I’ve been quiet here but busy in real life, which I guess is a good thing (if only it paid better!). I’ve started a new business where I review the books and records of a strata scheme (think condo association), collate…

---

## [Lost in translation](https://discourse.devontechnologies.com/t/lost-in-translation/87623)

<div class="topic-metadata">

**Author:** [@DTPer](https://discourse.devontechnologies.com/u/DTPer)\
**Replies:** 7\
**Last updated:** [September 22, 2026, 6:50pm UTC](https://discourse.devontechnologies.com/t/lost-in-translation/87623 "2026-09-22T18:50:27Z")

</div>

I work, write and gather information in DEVONthink in four languages. That’s simply how my work is, and that’s fine – but text search is a mess. I end up running four separate searches, one after another. I might forget …

---

## [Bulk File Rename](https://discourse.devontechnologies.com/t/bulk-file-rename/24077)

<div class="topic-metadata">

**Author:** [@JEBR](https://discourse.devontechnologies.com/u/JEBR)\
**Replies:** 12\
**Last updated:** [September 15, 2026, 7:25pm UTC](https://discourse.devontechnologies.com/t/bulk-file-rename/24077 "2026-09-15T19:25:10Z")

</div>

Hello I would like to rename all files in a database with a prefix of “YYYYMMDD” to a prefix of “YYYY-MM-DD”. Any help would be much appreciated. –Jonahtan

---

## [Smart rule always gets error](https://discourse.devontechnologies.com/t/smart-rule-always-gets-error/87565)

<div class="topic-metadata">

**Author:** [@Silverstone](https://discourse.devontechnologies.com/u/Silverstone)\
**Replies:** 7\
**Last updated:** [September 3, 2026, 4:33pm UTC](https://discourse.devontechnologies.com/t/smart-rule-always-gets-error/87565 "2026-09-03T16:33:33Z")

</div>

I mean Smart rule “Track opened documents with Trickster” The script is simple: on performSmartRule(theRecords) tell application id "DNtp" set dtBundleID to "com.devon-technologies.think" -- DEVONthink 4+ if (vers…

---

## [Smart Rule to move file On Import not working](https://discourse.devontechnologies.com/t/smart-rule-to-move-file-on-import-not-working/87533)

<div class="topic-metadata">

**Author:** [@wannabedevonian](https://discourse.devontechnologies.com/u/wannabedevonian)\
**Replies:** 2\
**Last updated:** [August 28, 2026, 7:01am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-move-file-on-import-not-working/87533 "2026-08-28T07:01:55Z")

</div>

I created a SmartRule to look for the import of a document, a PDF+Text, into the inbox. Where it contains certain text and arrives in the inbox today, the item is moved to another group. The mechanism by which the item …

---

## [How to extract a string from a PDF + Text](https://discourse.devontechnologies.com/t/how-to-extract-a-string-from-a-pdf-text/87506)

<div class="topic-metadata">

**Author:** [@wannabedevonian](https://discourse.devontechnologies.com/u/wannabedevonian)\
**Replies:** 4\
**Last updated:** [August 22, 2026, 9:05am UTC](https://discourse.devontechnologies.com/t/how-to-extract-a-string-from-a-pdf-text/87506 "2026-08-22T09:05:42Z")

</div>

I am attempting to extract a four-digit numerical string from a number of PDFs that have been OCR’d. I want to place an extracted numerical string into a metadata field for the item in DEVONthink Pro. The string is cons…

---

## [Batch rename to initial lower case](https://discourse.devontechnologies.com/t/batch-rename-to-initial-lower-case/87490)

<div class="topic-metadata">

**Author:** [@brookter](https://discourse.devontechnologies.com/u/brookter)\
**Replies:** 9\
**Last updated:** [August 17, 2026, 4:37pm UTC](https://discourse.devontechnologies.com/t/batch-rename-to-initial-lower-case/87490 "2026-08-17T16:37:24Z")

</div>

Hi, I’d like to rename all my tags to purely lowercase, and I’ve been trying to use Batch Renaming to do it. The following regex works in BBEdit: Input: Translate Search: ^(\[A-Z\])(.\*) Replace: \\l\\1\\2 Output: translate…

---

## [Programmatic file versioning](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457)

<div class="topic-metadata">

**Author:** [@b3d0u1n](https://discourse.devontechnologies.com/u/b3d0u1n)\
**Replies:** 8\
**Last updated:** [August 14, 2026, 6:04pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457 "2026-08-14T18:04:10Z")

</div>

Is it possible to create a versioned file programmatically ? I would like to be able to set up some automatic rules/batch processes to create versions for certain files on a scheduled basis.

---

## [Insurmountable barrier between AppleScript (talking to DT) and a Swift-UI?](https://discourse.devontechnologies.com/t/insurmountable-barrier-between-applescript-talking-to-dt-and-a-swift-ui/87454)

<div class="topic-metadata">

**Author:** [@enchiriadis1](https://discourse.devontechnologies.com/u/enchiriadis1)\
**Replies:** 21\
**Last updated:** [August 13, 2026, 11:25am UTC](https://discourse.devontechnologies.com/t/insurmountable-barrier-between-applescript-talking-to-dt-and-a-swift-ui/87454 "2026-08-13T11:25:50Z")

</div>

Hi all, short question: I have an AppleScript collecting Documents inside of DEVONthink (Veriosn 4) via the selection-object. Furtheron those collected Docs will be archived in a ZIP-Archiv, packed into a (in DT) pre-…

---

## [doJavaScript on a Markdown preview?](https://discourse.devontechnologies.com/t/dojavascript-on-a-markdown-preview/87443)

<div class="topic-metadata">

**Author:** [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Replies:** 5\
**Last updated:** [August 10, 2026, 3:49pm UTC](https://discourse.devontechnologies.com/t/dojavascript-on-a-markdown-preview/87443 "2026-08-10T15:49:24Z")

</div>

It’s it possible to have doJavaScript inject code in a MD preview? I’m not referring to a script element in the MD here.

---

## [Smart rule that will capture a varying name in position on an email and applying it as a name to the document](https://discourse.devontechnologies.com/t/smart-rule-that-will-capture-a-varying-name-in-position-on-an-email-and-applying-it-as-a-name-to-the-document/87418)

<div class="topic-metadata">

**Author:** [@microcloth](https://discourse.devontechnologies.com/u/microcloth)\
**Replies:** 9\
**Last updated:** [August 9, 2026, 1:12pm UTC](https://discourse.devontechnologies.com/t/smart-rule-that-will-capture-a-varying-name-in-position-on-an-email-and-applying-it-as-a-name-to-the-document/87418 "2026-08-09T13:12:00Z")

</div>

Is there a smart rule that will capture positional text in an email and change the documents name to reflect the text. In the photo below of a devotional email, the word Formed (below the date) changes each day into a …

---

## [Smart Rule for converting bookmarks for PDF for authenticated web sites](https://discourse.devontechnologies.com/t/smart-rule-for-converting-bookmarks-for-pdf-for-authenticated-web-sites/87360)

<div class="topic-metadata">

**Author:** [@pbernery](https://discourse.devontechnologies.com/u/pbernery)\
**Replies:** 3\
**Last updated:** [July 22, 2026, 12:13pm UTC](https://discourse.devontechnologies.com/t/smart-rule-for-converting-bookmarks-for-pdf-for-authenticated-web-sites/87360 "2026-07-22T12:13:30Z")

</div>

I am trying to build a Smart Rule to convert bookmarks I added to DT to PDF. These are bookmarks to authenticated web sites, for which I did authenticate in DEVONthink. When I click the link, I see the content in the DT…

---

## [Set custom metadata on import](https://discourse.devontechnologies.com/t/set-custom-metadata-on-import/87334)

<div class="topic-metadata">

**Author:** [@halloleo](https://discourse.devontechnologies.com/u/halloleo)\
**Replies:** 3\
**Last updated:** [July 17, 2026, 1:04pm UTC](https://discourse.devontechnologies.com/t/set-custom-metadata-on-import/87334 "2026-07-17T13:04:33Z")

</div>

I have the Custom Metadata field PubDate: How can I populate it on document import into DEVONthink? Is there a settable named xattr field of the documnet file which on import is converted to a named metadata field? …

---

## [How to 'enclose' tags when importing a PDF](https://discourse.devontechnologies.com/t/how-to-enclose-tags-when-importing-a-pdf/87320)

<div class="topic-metadata">

**Author:** [@halloleo](https://discourse.devontechnologies.com/u/halloleo)\
**Replies:** 10\
**Last updated:** [July 17, 2026, 12:51pm UTC](https://discourse.devontechnologies.com/t/how-to-enclose-tags-when-importing-a-pdf/87320 "2026-07-17T12:51:22Z")

</div>

I want to automate the ingestion of a bunch of PDFs where I do have the PDFs themselves as files in a folder and in one accompanying CSV file some metadata to each PDF: URL, keywords, and a published date. I want to imp…

---

## [Importing images and sizing them](https://discourse.devontechnologies.com/t/importing-images-and-sizing-them/87330)

<div class="topic-metadata">

**Author:** [@Nig](https://discourse.devontechnologies.com/u/Nig)\
**Replies:** 2\
**Last updated:** [July 16, 2026, 4:33pm UTC](https://discourse.devontechnologies.com/t/importing-images-and-sizing-them/87330 "2026-07-16T16:33:35Z")

</div>

When I import images they are always zoomed in to fit the width which is not helpful as they become too large to see properly. How do I set things so that they are zoomed to fit? I fiddled with smart groups but couldn’t …

---

## [In the "import path" AppleScript command, what "from" is used for?](https://discourse.devontechnologies.com/t/in-the-import-path-applescript-command-what-from-is-used-for/87323)

<div class="topic-metadata">

**Author:** [@pbernery](https://discourse.devontechnologies.com/u/pbernery)\
**Replies:** 3\
**Last updated:** [July 16, 2026, 6:02am UTC](https://discourse.devontechnologies.com/t/in-the-import-path-applescript-command-what-from-is-used-for/87323 "2026-07-16T06:02:49Z")

</div>

In the documentation, "from is described as “The name of the source application.”. If set, what DT will do with this information?

---

## [A (much) faster version of Scripts \> Export \> Listing](https://discourse.devontechnologies.com/t/a-much-faster-version-of-scripts-export-listing/87229)

<div class="topic-metadata">

**Author:** [@pfarrelle](https://discourse.devontechnologies.com/u/pfarrelle)\
**Replies:** 9\
**Last updated:** [July 1, 2026, 1:27pm UTC](https://discourse.devontechnologies.com/t/a-much-faster-version-of-scripts-export-listing/87229 "2026-07-01T13:27:33Z")

</div>

I have been absorbing lots of information from this forum over the years and I am very grateful for the time and passion shown by all the contributors. Before today, most, if not all of my posts have been in search of an…

---

## [Automating Highlight Extraction from Multiple Documents in DEVONthink Pro](https://discourse.devontechnologies.com/t/automating-highlight-extraction-from-multiple-documents-in-devonthink-pro/82319)

<div class="topic-metadata">

**Author:** [@DTPer](https://discourse.devontechnologies.com/u/DTPer)\
**Replies:** 7\
**Last updated:** [June 23, 2026, 11:06pm UTC](https://discourse.devontechnologies.com/t/automating-highlight-extraction-from-multiple-documents-in-devonthink-pro/82319 "2026-06-23T23:06:16Z")

</div>

Hello everyone, I’m looking for a way to automate the extraction of highlights from multiple documents in DEVONthink Pro and consolidate them into a single document. Ideally, the resulting document should include the ti…

---

## [How do I get the containing group of a record via AppleScript?](https://discourse.devontechnologies.com/t/how-do-i-get-the-containing-group-of-a-record-via-applescript/87219)

<div class="topic-metadata">

**Author:** [@ustad](https://discourse.devontechnologies.com/u/ustad)\
**Replies:** 3\
**Last updated:** [June 23, 2026, 2:56pm UTC](https://discourse.devontechnologies.com/t/how-do-i-get-the-containing-group-of-a-record-via-applescript/87219 "2026-06-23T14:56:46Z")

</div>

I’m working on a larger script to move a selected record (group or document) to a particular location in a database, and I need help with what seems like it should be a simple AppleScript idiom. I’ve had success with thi…

---

## [Saving RFCs to DEVONthink via AppleScript](https://discourse.devontechnologies.com/t/saving-rfcs-to-devonthink-via-applescript/86235)

<div class="topic-metadata">

**Author:** [@meta](https://discourse.devontechnologies.com/u/meta)\
**Replies:** 8\
**Last updated:** [June 7, 2026, 10:01pm UTC](https://discourse.devontechnologies.com/t/saving-rfcs-to-devonthink-via-applescript/86235 "2026-06-07T22:01:03Z")

</div>

Since I work from RFCs a lot, I decided it would be a good idea to start downloading them locally to make them easier to refer to, search, annotate, and so on. I’ve put together a quick AppleScript so that if I’m browsin…

---

## [Vague question about syncing automation](https://discourse.devontechnologies.com/t/vague-question-about-syncing-automation/87092)

<div class="topic-metadata">

**Author:** [@jem](https://discourse.devontechnologies.com/u/jem)\
**Replies:** 7\
**Last updated:** [June 5, 2026, 5:31pm UTC](https://discourse.devontechnologies.com/t/vague-question-about-syncing-automation/87092 "2026-06-05T17:31:37Z")

</div>

This is a vague question about how to keep the automation “stuff” of various units in sync. I’ve used DT in a very basic way, I got a few simple applescripts for creating notes, but that’s about it. However, I would lik…

---

## [Automating RSS Refresh](https://discourse.devontechnologies.com/t/automating-rss-refresh/87045)

<div class="topic-metadata">

**Author:** [@vanderwal](https://discourse.devontechnologies.com/u/vanderwal)\
**Replies:** 9\
**Last updated:** [June 1, 2026, 5:23pm UTC](https://discourse.devontechnologies.com/t/automating-rss-refresh/87045 "2026-06-01T17:23:03Z")

</div>

With the addition of an MCP I’m able to automate capturing a list of what I’ve added to DEVONthink the prior day and output it to a markdown note with links to the original source and the PDF in DEVONthink. I also have l…

---

## [AppleScript to Extract Domain for Custom Metadata in DEVONthink 4](https://discourse.devontechnologies.com/t/applescript-to-extract-domain-for-custom-metadata-in-devonthink-4/87032)

<div class="topic-metadata">

**Author:** [@Bahadir](https://discourse.devontechnologies.com/u/Bahadir)\
**Replies:** 3\
**Last updated:** [May 29, 2026, 7:58am UTC](https://discourse.devontechnologies.com/t/applescript-to-extract-domain-for-custom-metadata-in-devonthink-4/87032 "2026-05-29T07:58:52Z")

</div>

Hello there, I’m currently trying out DEVONthink 4 and I’m looking for an AppleScript that can remove the http/https/www parts and subdomains from a URL, then save just the domain as custom metadata when I add a new boo…

---

## [Accessing the right-clicked record vs. the selection in a context menu script](https://discourse.devontechnologies.com/t/accessing-the-right-clicked-record-vs-the-selection-in-a-context-menu-script/86916)

<div class="topic-metadata">

**Author:** [@joelmeyerhamme](https://discourse.devontechnologies.com/u/joelmeyerhamme)\
**Replies:** 4\
**Last updated:** [May 14, 2026, 1:12pm UTC](https://discourse.devontechnologies.com/t/accessing-the-right-clicked-record-vs-the-selection-in-a-context-menu-script/86916 "2026-05-14T13:12:56Z")

</div>

I have a JXA script installed in the Contextual Menu folder that operates on all currently selected records. This works well in the common case, but there’s an edge case I’d like to handle correctly: If a user has sever…

---

## [How to Extend Browser Filing Script - with - close each window processed?](https://discourse.devontechnologies.com/t/how-to-extend-browser-filing-script-with-close-each-window-processed/86915)

<div class="topic-metadata">

**Author:** [@ipanini](https://discourse.devontechnologies.com/u/ipanini)\
**Replies:** 7\
**Last updated:** [May 14, 2026, 11:51am UTC](https://discourse.devontechnologies.com/t/how-to-extend-browser-filing-script-with-close-each-window-processed/86915 "2026-05-14T11:51:19Z")

</div>

Hi, First of all thanks for posting these nice Browser Filing Scripts. I’ve started with “File Safari Tabs Extended”. FYI, I’m currently using an Alfred workflow with the Veritrope scripts to save browser tabs. But I…

---

## [Video Playback and Annotations](https://discourse.devontechnologies.com/t/video-playback-and-annotations/62271)

<div class="topic-metadata">

**Author:** [@ChristinWhite](https://discourse.devontechnologies.com/u/ChristinWhite)\
**Replies:** 28\
**Last updated:** [May 10, 2026, 9:36am UTC](https://discourse.devontechnologies.com/t/video-playback-and-annotations/62271 "2026-05-10T09:36:32Z")

</div>

I’m moving away from using Eagle for video notes because there’s no linking nor an easy way to export the notes after you generate them and I stumbled on DEVONthink’s Insert Back Link in the Annotations and that it even …

---

## [Find a reference](https://discourse.devontechnologies.com/t/find-a-reference/86887)

<div class="topic-metadata">

**Author:** [@kewms](https://discourse.devontechnologies.com/u/kewms)\
**Replies:** 3\
**Last updated:** [May 10, 2026, 7:19am UTC](https://discourse.devontechnologies.com/t/find-a-reference/86887 "2026-05-10T07:19:04Z")

</div>

So I’m reading along in a technical paper, and I come to a reference like: N. Modolo, et al., IEEE EDL, 42, 5 (2021). I’d like for my electronic minion to go out, find that paper, and put a link to it in a database gro…

---

## [Rename bunch of files using external script](https://discourse.devontechnologies.com/t/rename-bunch-of-files-using-external-script/86821)

<div class="topic-metadata">

**Author:** [@sashk](https://discourse.devontechnologies.com/u/sashk)\
**Replies:** 10\
**Last updated:** [April 28, 2026, 10:27pm UTC](https://discourse.devontechnologies.com/t/rename-bunch-of-files-using-external-script/86821 "2026-04-28T22:27:31Z")

</div>

My DEVONthink db started by importing bunch of files from dirs. They weren’t properly sorted. Recently I developed a script, which can rename file based on it content (LLM+bunch of other stuff to make it right). is there…

[Next page](https://discourse.devontechnologies.com/c/devonthink/scripting/18.md?page=1)
