Home

Appendix

Application Icon   Scripts

DEVONthink is well known for its automation capabilities and to that end comes with many built-in scripts. Below is a list of the DEVONthink supplied scripts available to you.

Script menu

This is a list of the pre-installed scripts in DEVONthink's Scripts menu, presented as they appear in the submenus there:

PRO

Chat:

  • Icon
    Create Image Prompt: Generate an Image Diffusion prompt from the key point or selected text in a document.
  • Icon
    Correct Spelling: Correct spelling in a document based on the context of the words.
  • Icon
    Insert Response: Insert an AI response to a question you ask.
  • Icon
    Transform Text: Generate changes to selected text based on your instructions. Some formats, e.g, rich text, support replacing the text.
  • Icon
    Translate Text: Translate selected text to the language in which DEVONthink is running. This does not correct spelling errors.

Comments:

  • Icon
    Append Selected Text: Adds the selected text to the comments of the current document.
  • Icon
    Assemble: Collects the comments of the selected documents and creates a new document listing them.
  • Icon
    Convert to Tags: Converts the tag contained in the comments field to real tags if the comments field of the selected document contains tags separated by commas.
  • Icon
    Speak: Speaks the comments of the selected documents.

Data:

  • Icon
    Move Duplicates to Trash: Moves all duplicates of the selected document to the trash.
  • Icon
    Find & Remove Similar Contents: Finds and removes similar documents.
  • Icon
    Group With Duplicates: Creates a group with duplicates of the selected documents.
  • Icon
    Group With Replicants: Creates a group with replicants of the selected documents.
  • Icon
    Verify & Optimize Databases: Runs a verification on all open databases and optimizes them if they verify successfully. Errors are alerted and logged to Window > Log.
  • Icon
    Check file integrity of databases: Runs a checksum comparison on all items in open databases to check for any discrepancies in the current and stored values. Errors are alerted and logged to Window > Log.

Download:

  • Icon
    Linked Images of Page: Adds linked images of a displayed web page to the database.
  • Icon
    Open Linked Images in Tabs: 
  • Icon
    Images of Page: Adds the images of a displayed web page to the database.
  • Icon
    Links of Page: Adds links contained on a displayed web page to the database.
  • Icon
    Download as…: Converts bookmarks to one of these formats: Formatted Notes, HTML Pages, PDF Documents (One Page or Paginated), and Web Archives. There are also versions for creating clutter-free documents as formatted notes, web archives, and PDF documents (One Page and Paginated).

Edit:

  • Icon
    Count Characters: Counts the characters in the current selection.
  • Icon
    Count Words: Counts the words in the current selection.
  • Icon
    Replace text in documents: Enter text to find and replace in plain and rich text documents.

Execute:

  • Icon
    AppleScript: Executes an AppleScript script.
  • Icon
    Perl: Executes a Perl script.
  • Icon
    Shell: Executes a shell script.

Export:

  • Icon
    Listing: Saves a UTF-8 text file containing a text listing of the names of all contents/groups of the current database.
  • Icon
    Daily Backup Archive: Creates a compressed backup (.Zip) of each open databases. All backups are stored in ~/Backup and their filename includes a datestamp for easy tracking and identification. These can be useful for copying to external media or uploading to a cloud service as a secondary backup strategy. Note: When using this script with an encrypted database, the database will be compressed in an unencrypted state.

Feeds:

  • Icon
    Nature -- Hubble News: Downloads the latest Hubble news.
  • Icon
    iTMS -- Added Albums: Downloads covers of albums recently added to the iTunes Music Store.

Format:

  • Icon
    Body Normal: Formats selected text as "Body Normal".
  • Icon
    Body Small: Formats selected text as "Body Small".
  • Icon
    Header Capitalized: Formats selected text as "Header Capitalized".
  • Icon
    Header Main: Formats selected text as "Header Main".
  • Icon
    Header Secondary: Formats selected text as "Header Secondary".
  • Icon
    Remove Attachments: Removes attachments from RTFD files.
  • Icon
    Remove Links: Removes linked text from the contents of a selected rich text document.
  • Icon
    Source: Formats selected text as "Source".
  • Icon
    Reset Spacing: Resets the line and paragraph spacing of selected rich text.

Images:

  • Icon
    Copy Info to Comment: Copies basic image info to the comment field.
  • Icon
    Flip Horizontal / Vertical: Flips the image horizontally/vertically.
  • Icon
    Rotate Left / Right: Rotates the image left/right.
  • Icon
    Landscape to Portrait: Rotates only landscape images to portrait.
  • Icon
    Portrait to Landscape: Rotates only portrait images to landscape.
  • Icon
    Scale to 1024 pixels: Scales the image to 1,024 pixels.
  • Icon
    Scale to 200%: Scales the image to 200 percent.
  • Icon
    Scale to 50%: Scales the image to 50 percent.

Import:

  • Icon
    Man Page: Imports a UNIX manual page as a plain text document.
  • Icon
    Perldoc: Imports the documentation of Perl pages, modules, functions, or programs.

Reminders:

  • Icon
    Add as Event to Calendar: Adds a new event to Calendar linking back to the selected item in DEVONthink.
  • Icon
    Add as To Do to OmniFocus: Adds the selected item as a to-do item to OmniFocus.
  • Icon
    Add as To Do to Reminders: Adds the selected item as a to-do item to Reminders.
  • Icon
    Add as To Do to Things: Adds the selected item as a to-do item to Things.

Note: These are scripts for integrating with external applications. For scripting internal reminder scripts, see the Reminder Scripts section of the chapter about automation.

Rename:

  • Icon
    Append Selected Text: Appends the selected text to the title of the currently selected item.
  • Icon
    Change Case: Change the case of selected text to titlecase.
  • Icon
    Replace Text: Replaces a text passage in the titles of selected documents.
  • Icon
    To Webpage Title: Sets the titles of the selected documents to the names of the web pages pointed to by their URL fields.
  • Icon
    To Subject: Sets the titles of the selected documents to the subject lines of the email messages if the selected documents are email messages.

Sheets:

  • Icon
    Add Multiple Records: Adds up to 999 empty records to a sheet.
  • Icon
    Column Sum & Mean Value: Calculates the sum and average of a table column.
  • Icon
    Row Sum & Mean Value: Calculates the sum and average of a table row.
  • Icon
    Check sums in last column: Checks the sums in the last column on validity.

Tabs:

  • Icon
    Open Bing: Open a new tab for the Bing search engine.
  • Icon
    Open Google: Open a new tab for the Google search engine.
  • Icon
    Open Location: Open a new tab for a location you specify.

Note: The last script does no URL validation, though DEVONthink's dictionary makes it possible to script this too.

Thumbnails:

  • Icon
    Flip Horizontal / Vertical: Flips the thumbnails of selected documents horizontally or vertically.
  • Icon
    Rotate Left / Right: Rotates the thumbnails of selected documents left or right.
  • Icon
    Landscape to Portrait: Rotates landscape thumbnails to portrait.
  • Icon
    Portrait to Landscape: Rotates portrait thumbnails to landscape.

Note: While these scripts work with all image formats including PDF, they should not be used for PDF documents. They will only work on the first page of the PDF and destroy all embedded metadata.

Smart Item Scripts

These are scripts available to smart items, i.e., smart rules and batch processing. They are divided by the two available actions: Apply Script and Script with Input/Output.

Apply Script:

  • Icon
    Add Favicons: Attempts to apply the favicon for a web-based document, e.g., a bookmark.
  • Icon
    Add Web Page Image: Attempts to apply a web page's image as the document's thumbnail.
  • Icon
    Close All Databases: Closes all open databases except the Global Inbox.
  • Icon
    Close All Documents: Closes all document windows.
  • Icon
    File Items Using @Destination in Name: If a filename is suffixed with @ followed by a group name, it will be used to file the document into a matching group. For example, a document named Marriott stay@Expenses would be filed in an "Expenses" group. If a group isn't found, it will be created in the Inbox of the parent database.
  • Icon
    Reminders - Next Week: Set a reminder for a week from the current time and date.
  • Icon
    Reminders - Remove: Remove an applied reminder from the matched item(s).
  • Icon
    Reminders - Tomorrow: Set a reminder for the same time tomorrow.
  • Icon
    Tags - Add Most Important Words: Adds the top five words from the concordance of the document. Assessed by weight.
PRO
  • Icon
    Assign Document Date & Amount: Adds a detected date and amount to the document as custom metadata.
  • Icon
    Downloads - Add Embedded Images: Add embedded images in a web-based file to the Download Manager. Used with HTML-based files, e.g., web archives, etc.
  • Icon
    Downloads - Add Linked Images: Add linked images to the Download Manager. Used with HTML-based files, e.g., web archives, etc.
  • Icon
    Downloads - Add Podcasts: Add detected podcast links to the Download Manager. Used with podcast RSS feeds containing download links.
  • Icon
    Download Bibliographic Metadata: Attempts to retrieve the digital object identifier (DOI) of the document and set the title and metadata.

Script with Input/Output:

  • Icon
    Annotation - Append Text: Gets text from a Set Script Input action and either creates an annotation file with the text or appends it to an existing one.
  • Icon
    Annotation - Get Text: Gets the text from an existing annotation file, if one exists.
  • Icon
    Checksum: Returns the content hash for the record.
  • Icon
    Coordinates: Returns the latitude and longitude from the geolocation data on the item.
  • Icon
    Daily Quote: Gets a random daily quote from an English and a German site.
  • Icon
    Image Size: Returns the width and height of an image.
  • Icon
    Latest News: Returns a random headline from the New York Times or Tagesschau.
  • Icon
    Name - First Number: Returns the first number in a record's name.
  • Icon
    Name - Last Number: Returns the last number in a record's name.
  • Icon
    Text - Lowercase/Uppercase: Returns the text of a Set Script Input placeholder to lower or uppercase.
  • Icon
    Text - Random String: Returns a 16 character string of random letters and numbers.
  • Icon
    Web Page - Description: Returns the description from the metadata of a web page, if available.
  • Icon
    Web Page - Keywords: Returns the keywords from the metadata of a web page, if available.

You can read more about how to use these scripts in the Smart Rules and Batch Processing section of this manual.