DEVONthink Pro OSX Automation Interface Dictionary

The DEVONthink is an amazing knowledge management tool and it becomes even more amazing by taking advantage of the possibility to AppleScript it. The table beneath lists the interface actions and objects that the tool provides to the world in its version 2.9.5 (10/2016). This information can simply be obtained using the AppleScript Editor, via the menu “File”, “Open Dictionary…” and selecting the tool.

Invoking these commands can be achieved like this:

tell application id “DNtp"

   -- Scrap a web page into a PDF document in DEVONthink
   set new_content_object to create PDF document from "http://google.com" name "This is the note title"

   -- Ask DEVONthink to download the web page page source
   set web_site_source to download markup from "http://google.com"

   -- Get URLs of all sub-ages referenced in the above downloded page
   set sub_page_urls to get links of web_site_source base URL "http://google/com"

end tell

A lot of information and examples can be found in the official support forum and a more complex example is available in this very blog.

 
DEVONthink Pro Suite DEVONthink Pro’s AppleScript Interface
 
 
add download (Command) Add a URL to the download manager.
Direct Command Parameter: The URL to add.
      Additional Text Parameter: automatic boolean (optional) Automatic or user (default) download.
      Additional Text Parameter: password text (optional) The password for protected websites.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
      Additional Text Parameter: user text (optional) The user name for protected websites.
Return Type: BOOLEAN
 
add row (Command) Add new row to current sheet.
Direct Command Parameter: the object for the command
      Additional Text Parameter: cells list (optional) Cells of new row.
Return Type: BOOLEAN
 
backup (Command) Backup a DEVONthink Pro database.
      Additional Text Parameter: database database The database to backup.
      Additional Text Parameter: to text The destination directory (outside of the database package) as a POSIX path.
      Additional Text Parameter: including files boolean (optional) Specifies if files should be backed up too.
Return Type: BOOLEAN
 
classify (Command) Get a list of classification proposals.
      Additional Text Parameter: record record The record to classify.
Return Type: LIST
 
compare (Command) Get a list of similar records, either by specifying a record or a content (and database).
      Additional Text Parameter: content text (optional) The content to compare.
      Additional Text Parameter: record record (optional) The record to compare.
      Additional Text Parameter: to database (optional) The database. Uses current database if not specified.
Return Type: LIST
 
compress (Command) Compress a DEVONthink Pro database into a Zip archive.
      Additional Text Parameter: database database The database to compress.
      Additional Text Parameter: to text POSIX path of Zip archive.
Return Type: BOOLEAN
 
consolidate (Command) Move an external/indexed record (and its children) into the database.
      Additional Text Parameter: record record The record to consolidate.
Return Type: BOOLEAN
 
convert (Command) Convert a record to plain or rich text, formatted note or HTML and create a new record afterwards.
      Additional Text Parameter: record record The record to convert.
      Additional Text Parameter: in record (optional) The destination group for the converted record. Parents of the record to convert are used if not specified.
      Additional Text Parameter: to Ctyp (optional) The desired format (default simple).
Return Type: RECORD
 
convert feed to HTML (Command) Convert a RSS, RDF or Atom feed to HTML.
Direct Command Parameter: The source code of the feed.
      Additional Text Parameter: base URL text (optional) The URL of the feed.
Return Type: TEXT
 
create database (Command) Create a new DEVONthink Pro database.
Direct Command Parameter: POSIX file path of database.
Return Type: DATABASE
 
create formatted note from (Command) Create a new formatted note from a web page.
Direct Command Parameter: The URL to download.
      Additional Text Parameter: agent text (optional) The user agent.
      Additional Text Parameter: in record (optional) The destination group for the new record. Uses incoming group or group selector if not specified.
      Additional Text Parameter: name text (optional) The name for the new record.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
      Additional Text Parameter: source text (optional) The HTML source.
Return Type: RECORD
 
create location (Command) Create a hierarchy of groups if necessary.
Direct Command Parameter: The hierarchy as a POSIX path (/ in names has to be replaced with \/, see location property).
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: RECORD
 
create Markdown from (Command) Create a Markdown document from a web resource.
Direct Command Parameter: The URL to download.
      Additional Text Parameter: agent text (optional) The user agent.
      Additional Text Parameter: in record (optional) The destination group for the new record. Uses incoming group or group selector if not specified.
      Additional Text Parameter: name text (optional) The name for the new record.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
Return Type: RECORD
 
create PDF document from (Command) Create a new PDF document with or without pagination from a web resource.
Direct Command Parameter: The URL to download.
      Additional Text Parameter: agent text (optional) The user agent.
      Additional Text Parameter: in record (optional) The destination group for the new record. Uses incoming group or group selector if not specified.
      Additional Text Parameter: name text (optional) The name for the new record.
      Additional Text Parameter: pagination boolean (optional) Paginate PDF document or not.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
      Additional Text Parameter: width integer (optional) The preferred width for the PDF document in pixels.
Return Type: RECORD
 
create record with (Command) Create a new record.
Direct Command Parameter: The properties of the record (‘name’, ‘type’, ‘comment’, ‘aliases’, ‘path’, ‘URL’, ‘creation’, ‘modification’, ‘date’, ‘plain text’, ‘rich text’, ‘source’, ‘data’, ‘content’, ‘columns’, ‘cells’ and ‘tags’ are possible values).
      Additional Text Parameter: in record (optional) The destination group for the new record. Uses incoming group or group selector if not specified.
Return Type: RECORD
 
create thumbnail (Command) Create image/movie thumbnail (and image info/characteristic) for a record.
      Additional Text Parameter: for record The record.
Return Type: BOOLEAN
 
create web document from (Command) Create a new record (picture, PDF or web archive) from a web resource.
Direct Command Parameter: The URL to download.
      Additional Text Parameter: agent text (optional) The user agent.
      Additional Text Parameter: in record (optional) The destination group for the new record. Uses incoming group or group selector if not specified.
      Additional Text Parameter: name text (optional) The name for the new record.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
Return Type: RECORD
 
deconsolidate (Command) Move an internal/imported record (and its children) to the enclosing external folder in the filesystem. Creation/Modification dates, Spotlight comments and OpenMeta tags are immediately updated.
      Additional Text Parameter: record record The record to deconsolidate.
Return Type: BOOLEAN
 
delete (Command) Delete all instances of a record from the database or one instance from the specified group.
      Additional Text Parameter: record record The record to delete.
      Additional Text Parameter: in record (optional) The parent group of this instance.
Return Type: BOOLEAN
 
delete row at (Command) Remove row at specified position from current sheet.
Direct Command Parameter: the object for the command
      Additional Text Parameter: position integer Position of row (1-n).
Return Type: BOOLEAN
 
delete thumbnail (Command) Delete existing image/movie/web thumbnail of a record.
      Additional Text Parameter: of record The record.
Return Type: BOOLEAN
 
delete workspace (Command) Delete a workspace.
Direct Command Parameter: The name of the workspace.
Return Type: BOOLEAN
 
display authentication dialog (Command) Display a dialog to enter a username and its password.
Direct Command Parameter: The info for the dialog.
Return Type: RECORD
 
display group selector (Command) Display a dialog to select a (destination) group.
Direct Command Parameter: The title of the dialog.
      Additional Text Parameter: buttons list (optional) The labels for the cancel and select buttons.
      Additional Text Parameter: for database (optional) The database. All open databases are used if not specified.
Return Type: RECORD
 
display name editor (Command) Display a dialog to enter a name.
Direct Command Parameter: The title of the dialog. By default the application name.
      Additional Text Parameter: default answer text (optional) The default editable name.
      Additional Text Parameter: info text (optional) The info for the dialog.
Return Type: TEXT
 
do JavaScript (Command) Applies a string of JavaScript code to a think window.
Direct Command Parameter: The code.
      Additional Text Parameter: in think window The think window/tab that the JavaScript should be applied in.
Return Type: TEXT
 
download markup from (Command) Download an HTML or XML page (including RSS, RDF or Atom feeds).
Direct Command Parameter: The URL of the HTML or XML page to download.
      Additional Text Parameter: agent text (optional) The user agent.
      Additional Text Parameter: encoding text (optional) The encoding of the page (default ISO-Latin-1).
      Additional Text Parameter: password text (optional) The password for protected websites.
      Additional Text Parameter: post record (optional) A dictionary containing key-value pairs for HTTP POST actions.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
      Additional Text Parameter: user text (optional) The user name for protected websites.
Return Type: TEXT
 
download URL (Command) Download a URL.
Direct Command Parameter: The URL to download.
      Additional Text Parameter: agent text (optional) The user agent.
      Additional Text Parameter: password text (optional) The password for protected websites.
      Additional Text Parameter: post record (optional) A dictionary containing key-value pairs for HTTP POST actions.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
      Additional Text Parameter: user text (optional) The user name for protected websites.
Return Type: ANY
 
duplicate (Command) Duplicate a record.
      Additional Text Parameter: record record The record to duplicate.
      Additional Text Parameter: to record The destination group which doesn’t have to be in the same database.
Return Type: RECORD
 
exists record at (Command) Check if at least one record exists at the specified location.
Direct Command Parameter: The location of the record as a POSIX path (/ in names has to be replaced with \/, see location property).
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: BOOLEAN
 
exists record with comment (Command) Check if at least one record with the specified comment exists.
Direct Command Parameter: The comment.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified
Return Type: BOOLEAN
 
exists record with file (Command) Check if at least one record with the specified last path component exists.
Direct Command Parameter: The filename.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified
Return Type: BOOLEAN
 
exists record with path (Command) Check if at least one record with the specified path exists.
Direct Command Parameter: The path.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: BOOLEAN
 
exists record with URL (Command) Check if at least one record with the specified URL exists.
Direct Command Parameter: The URL (or path).
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: BOOLEAN
 
export (Command) Export a record (and its children).
      Additional Text Parameter: record record The record to export.
      Additional Text Parameter: to text The destination directory as a POSIX path. DEVONthink creates the destination if necessary.
Return Type: TEXT
 
export tags of (Command) Export OpenMeta/Mavericks tags of a record.
      Additional Text Parameter: record record The record.
Return Type: BOOLEAN
 
export website (Command) Export a record (and its children) as a website.
      Additional Text Parameter: record record The record to export.
      Additional Text Parameter: to text The destination directory as a POSIX path. DEVONthink creates the destination if necessary.
      Additional Text Parameter: encoding text (optional) The encoding of the exported HTML pages (default ISO-Latin-1).
      Additional Text Parameter: entities boolean (optional) Use HTML entities. Off by default.
      Additional Text Parameter: index pages boolean (optional) Create index pages. Off by default.
      Additional Text Parameter: template text (optional) Name of built-in template or full POSIX path of template. Uses Default template if not specified.
Return Type: TEXT
 
get cached data for URL (Command) Get cached data for URL of a resource which is part of a loaded webpage and its DOM tree, rendered in a think tab/window.
Direct Command Parameter: The URL.
      Additional Text Parameter: from tab (optional) The source think tab. Uses current tab of frontmost think window otherwise.
Return Type: ANY
 
get cell at (Command) Get content of cell at specified position of current sheet.
Direct Command Parameter: the object for the command
      Additional Text Parameter: column integer The column (1-n) of the cell.
      Additional Text Parameter: row integer The row (1-n) of the cell.
Return Type: TEXT
 
get concordance of (Command) Get list of words of a record.
      Additional Text Parameter: record record The record.
      Additional Text Parameter: sorted by WSrt (optional) Sorting of words (default is weight).
Return Type: LIST
 
get database with id (Command) Get database with the specified id.
Direct Command Parameter: The scripting identifier.
Return Type: DATABASE
 
get database with uuid (Command) Get database with the specified uuid.
Direct Command Parameter: The unique identifier.
Return Type: DATABASE
 
get embedded images of (Command) Get the URLs of all embedded images of an HTML page.
Direct Command Parameter: The source code of the HTML page.
      Additional Text Parameter: base URL text (optional) The URL of the HTML page containing the images.
      Additional Text Parameter: type text (optional) The desired type of the images (e.g. JPG, GIF, PNG, …).
Return Type: LIST
 
get embedded objects of (Command) Get the URLs of all embedded objects of an HTML page.
Direct Command Parameter: The source code of the HTML page.
      Additional Text Parameter: base URL text (optional) The URL of the HTML page containing the embedded objects
      Additional Text Parameter: type text (optional) The desired type of the objects (e.g. MOV).
Return Type: LIST
 
get embedded sheets and scripts of (Command) Get the URLs of all embedded style sheets and scripts of an HTML page.
Direct Command Parameter: The source code of the HTML page.
      Additional Text Parameter: base URL text (optional) The URL of the HTML page containing the style sheets and scripts.
      Additional Text Parameter: type text (optional) The desired type of the links (e.g. CSS).
Return Type: LIST
 
get frames of (Command) Get the URLs of all frames of an HTML page.
Direct Command Parameter: The source code of the HTML page.
      Additional Text Parameter: base URL text (optional) The URL of the HTML page containing the frames.
Return Type: LIST
 
get items of feed (Command) Get the items of a RSS, RDF or Atom feed. Dictionaries contain title (text), link (text), date (text), calendarDate (date), description (text), content (text), author (text), html (item converted to HTML), tags (list) and enclosures (list)
Direct Command Parameter: The source code of the feed.
      Additional Text Parameter: base URL text (optional) The URL of the feed.
Return Type: LIST
 
get links of (Command) Get the URLs of all links of an HTML page.
Direct Command Parameter: The source code of the HTML page.
      Additional Text Parameter: base URL text (optional) The URL of the HTML page containing the links.
      Additional Text Parameter: containing text (optional) The case sensitive string matched against the description of links.
      Additional Text Parameter: type text (optional) The desired type of the links (e.g. HTML, PHP, JPG, …).
Return Type: LIST
 
get record at (Command) Search for record at the specified location.
Direct Command Parameter: The location of the record as a POSIX path (/ in names has to be replaced with \/, see location property).
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: RECORD
 
get record with id (Command) Get record with the specified id.
Direct Command Parameter: The scripting identifier.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: RECORD
 
get record with uuid (Command) Get record with the specified uuid.
Direct Command Parameter: The unique identifier.
      Additional Text Parameter: in database (optional) The database. Uses all databases if not specified.
Return Type: RECORD
 
get rich text of (Command) Get the rich text of an HTML page.
Direct Command Parameter: The source code of the HTML page.
      Additional Text Parameter: base URL text (optional) The URL of the HTML page
Return Type: TEXT.CTXT
 
get text of (Command) Get the text of an HTML page.
Direct Command Parameter: The source code of the HTML page.
Return Type: TEXT
 
get title of (Command) Get the title of an HTML page.
Direct Command Parameter: The source code of the HTML page.
Return Type: TEXT
 
hide progress indicator (Command) Hide a visible progress indicator.
Return Type: BOOLEAN
 
import (Command) Import a file or folder (including its subfolders).
Direct Command Parameter: The POSIX path of the file or folder.
      Additional Text Parameter: from text (optional) The name of the source application.
      Additional Text Parameter: name text (optional) The name for the imported record.
      Additional Text Parameter: placeholders record (optional) Optional placeholders as key-value-pairs for text, RTF/RTFD & HTML/XML templates and filenames. Note: The standard placeholders of .dtTemplate packages are also supported if this parameter is specified.
      Additional Text Parameter: to record (optional) The destination group. Uses incoming group or group selector if not specified.
      Additional Text Parameter: type Ityp (optional) File type to import.
Return Type: RECORD
 
import template (Command) Import a template. Note: Template scripts are not supported.
Direct Command Parameter: The POSIX path of the template.
      Additional Text Parameter: to record (optional) The destination group. Uses incoming group or group selector if not specified.
Return Type: RECORD
 
indicate (Command) Indicate (‘index’) a file or folder (including its subfolders). If no type is specified or the type is ‘all’, then links to unknown file types are created too.
Direct Command Parameter: The POSIX path of the file or folder.
      Additional Text Parameter: to record (optional) The destination group. Uses incoming group or group selector if not specified.
      Additional Text Parameter: type Ityp (optional) File type to index.
Return Type: RECORD
 
load workspace (Command) Load a workspace.
Direct Command Parameter: The name of the workspace.
Return Type: BOOLEAN
 
log message (Command) Log info for a file or action to the Log panel of DEVONthink Pro.
Direct Command Parameter: The message.
      Additional Text Parameter: info text (optional) Additional information.
Return Type: BOOLEAN
 
lookup records with comment (Command) Lookup records with specified comment.
Direct Command Parameter: The comment.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified
Return Type: LIST
 
lookup records with file (Command) Lookup records whose last path component is the specified file.
Direct Command Parameter: The filename.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified
Return Type: LIST
 
lookup records with path (Command) Lookup records with specified path.
Direct Command Parameter: The path.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: LIST
 
lookup records with tags (Command) Lookup records with all or any of the specified tags.
Direct Command Parameter: The tags.
      Additional Text Parameter: any boolean (optional) Lookup any or all (default) tags.
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: LIST
 
lookup records with URL (Command) Lookup records with specified URL.
Direct Command Parameter: The URL (or path).
      Additional Text Parameter: in database (optional) The database. Uses current database if not specified.
Return Type: LIST
 
merge (Command) Merge either a list of records as an RTF(D)/a PDF document or merge a list of not indexed groups/tags.
      Additional Text Parameter: records list The records to merge.
      Additional Text Parameter: in record (optional) The destination group for the merged record. The root of the database is used if not specified.
Return Type: RECORD
 
move (Command) Move all instances of a record to a different group. Specify the “from” group to to move a single instance to a different group.
      Additional Text Parameter: record record The record to move.
      Additional Text Parameter: to record The destination group which doesn’t have to be in the same database.
      Additional Text Parameter: from record (optional) The source group. Only applicable if record and destination group are in the same database
Return Type: RECORD
 
open database (Command) Open an existing DEVONthink Pro database. To close a database, use the standard “close” command.
Direct Command Parameter: POSIX file path of database.
Return Type: DATABASE
 
open tab for (Command) Open a new tab for the specified URL or record in a think window.
      Additional Text Parameter: in think window (optional) The optional think window that should open a new tab.
      Additional Text Parameter: record record (optional) The record to open.
      Additional Text Parameter: referrer text (optional) The HTTP referrer.
      Additional Text Parameter: URL text (optional) The URL to open.
Return Type: TAB
 
open window for (Command) Open a (new) viewer or document window for the specified record (use the ‘close’ command to close a window). Only recommended for viewer windows, use ‘open tab for’ for document windows.
      Additional Text Parameter: record record The record to open.
Return Type: THINK WINDOW
 
optimize (Command) Backup & optimize a DEVONthink Pro database.
      Additional Text Parameter: database database The database to optimize.
Return Type: BOOLEAN
 
paste clipboard (Command) Create a new record with the contents of the clipboard.
      Additional Text Parameter: to record (optional) The destination group for the new record. Uses incoming group or group selector if not specified.
Return Type: RECORD
 
refresh (Command) Refresh a record. Currently only supported by feeds.
      Additional Text Parameter: record record The record to refresh.
Return Type: BOOLEAN
 
replicate (Command) Replicate a record.
      Additional Text Parameter: record record The record to replicate.
      Additional Text Parameter: to record The destination group which must be in the same database.
Return Type: RECORD
 
save workspace (Command) Save a workspace.
Direct Command Parameter: The name of the workspace.
Return Type: BOOLEAN
 
search (Command) Search records by string, label, state/flag, locking and/or age.
Direct Command Parameter: The search string.
      Additional Text Parameter: age real (optional) Maximal age of records in seconds.
      Additional Text Parameter: comparison Lkcp (optional) The comparison to use (default no case).
      Additional Text Parameter: in record (optional) The group to search in. Searches in current database if not specified.
      Additional Text Parameter: label integer (optional) Index of label (0-7) of records.
      Additional Text Parameter: locking boolean (optional) The locking of the records.
      Additional Text Parameter: state boolean (optional) The state/flag of the records.
      Additional Text Parameter: unread boolean (optional) The unread flag of the records.
      Additional Text Parameter: within Lkwh (optional) The attribute(s) to search within (default all).
Return Type: LIST
 
set cell at (Command) Set cell at specified position of current sheet.
Direct Command Parameter: the object for the command
      Additional Text Parameter: column integer The column (1-n) of the cell.
      Additional Text Parameter: row integer The row (1-n) of the cell.
      Additional Text Parameter: to text The content of the cell.
Return Type: BOOLEAN
 
show progress indicator (Command) Show a progress indicator or update an already visible indicator. You have to ensure that the indicator is hidden again via ‘hide progress indicator’ when the script ends or if an error occurs.
Direct Command Parameter: The title of the progress.
      Additional Text Parameter: cancel button boolean (optional) Display a button to cancel the process.
      Additional Text Parameter: steps integer (optional) The number of steps of the progress or a negative value for an indeterminate number.
Return Type: BOOLEAN
 
start downloads (Command) Start queue of download manager.
Return Type: BOOLEAN
 
step progress indicator (Command) Go to next step of a progress.
Direct Command Parameter: The info for the current step.
Return Type: BOOLEAN
 
stop downloads (Command) Stop queue of download manager.
Return Type: BOOLEAN
 
synchronize (Command) Synchronize a record (and its children) by adding new external items, indexing updated external items and removing missing items. Not supported by triggered scripts.
      Additional Text Parameter: record record The record to synchronize.
Return Type: BOOLEAN
 
update thumbnail (Command) Update existing image/movie thumbnail (and image info/characteristic) of a record.
      Additional Text Parameter: of record The record.
Return Type: BOOLEAN
 
verify (Command) Verify a DEVONthink Pro database. Returns total number of errors and missing files.
      Additional Text Parameter: database database The database to verify.
Return Type: INTEGER
 
application (applications) (Object) DEVONthink Pro’s top level scripting object.
Inherits from Object: application
Contains Object: database
Contains Object: document window
Contains Object: search window
Contains Object: think window
Contains Object: viewer window
Has Property: cancelled progress boolean Specifies if a process with a visible progress indicator should be cancelled.
Has Property: content record record The record of the visible document in the frontmost think window.
Has Property: current database database The currently used database.
Has Property: current group record The (selected) group of the frontmost window of the current database. Returns root of current database if no current group exists.
Has Property: inbox database The global inbox.
Has Property: incoming group record The default group for new notes. Either global inbox or incoming group of current database.
Has Property: last downloaded URL text The actual URL of the last download.
Has Property: preferred import destination record The default destination for data from external sources. Either global inbox, incoming group of current database or selected group. See Preferences > Import > Destination.
Has Property: selection list The selected records of the frontmost viewer or search window or the record of the frontmost document window.
Has Property: workspaces list The names of all available workspaces.
 
child (children) (Object) A child record of a group.
Inherits from Object: record
 
content (contents) (Object) A content record of a database.
Inherits from Object: record
 
database (databases) (Object) A DEVONthink Pro database (supports the standard ‘close’ command).
Inherits from Object: item
Contains Object: content
Contains Object: parent
Contains Object: record
Contains Object: tag group
Has Property: comment text The comment of the database.
Has Property: current group record The (selected) group of the frontmost window. Returns root if no current group exists.
Has Property: id integer The scripting identifier of a database.
Has Property: incoming group record The default group for new notes. Might be identical to root.
Has Property: name text The name of the database.
Has Property: path text The POSIX path of the database.
Has Property: read only boolean Specifies if a database is read-only and can’t be modified.
Has Property: root record The top level group of the database.
Has Property: sync group record The group for synchronizing.
Has Property: tags group record The group for tags.
Has Property: trash group record The trash’s group.
Has Property: uuid text The unique and persistent identifier of a database for external referencing.
 
document window (document windows) (Object) A DEVONthink Pro document window.
Inherits from Object: think window
Has Property: record record The record of the document.
 
parent (parents) (Object) A parent group of a record.
Inherits from Object: record
 
record (records) (Object) A DEVONthink Pro database record.
Inherits from Object: item
Contains Object: child
Contains Object: parent
Has Property: addition date date Date when the record was added to the database.
Has Property: aliases text Wiki aliases (separated by commas or semicolons) of a record.
Has Property: attached script text POSIX path of script attached to a record.
Has Property: cells list The cells of a sheet.
Has Property: character count integer The character count of a record.
Has Property: columns list The column names of a sheet.
Has Property: comment text The comment of a record.
Has Property: creation date date The creation date of a record.
Has Property: data any The file data of a record. Currently only supported by PDF documents, images, rich texts and web archives.
Has Property: database database The database of the record.
Has Property: date date The (creation/modification) date of a record.
Has Property: dimensions list The width and height of an image or PDF document in pixels.
Has Property: dpi integer The resultion of an image in dpi.
Has Property: duplicates list The duplicates of a record (only other instances, not including the record).
Has Property: exclude from classification boolean Exclude group or record from classifying.
Has Property: exclude from search boolean Exclude group or record from searching.
Has Property: exclude from see also boolean Exclude record from see also.
Has Property: exclude from tagging boolean Exclude group from tagging.
Has Property: filename text The proposed file name for a record.
Has Property: height integer The height of an image or PDF document in pixels.
Has Property: id integer The scripting identifier of a record. Optimizing or closing a database might modify this identifier.
Has Property: image any The image or PDF document of a record.
Has Property: indexed boolean Indexed or imported record.
Has Property: interval real Refresh interval of a feed. Currently overriden by preferences.
Has Property: kind text The human readable kind of a record. WARNING: Don’t use this to check the type of a record, otherwise your script might fail depending on the version and the localization.
Has Property: label integer Index of label (0-7) of a record.
Has Property: location text The location in the database as a POSIX path (/ in names is replaced with \/).
Has Property: locking boolean The locking of a record.
Has Property: meta data record The metadata of a record as a dictionary containing key-value pairs. Possible keys are currently kMDItemTitle, kMDItemHeadline, kMDItemSubject, kMDItemDescription, kMDItemCopyright, kMDItemComment, kMDItemURL, kMDItemKeywords, kMDItemCreator, kMDItemProdu
Has Property: MIME type text The (proposed) MIME type of a record.
Has Property: modification date date The modification date of a record.
Has Property: name text The name of a record.
Has Property: number of duplicates integer The number of duplicates of a record.
Has Property: number of replicants integer The number of replicants of a record.
Has Property: opening date date Date when a content was opened the last time or when a feed was refreshed the last time.
Has Property: page count integer The page count of a record. Currently only supported by PDF documents.
Has Property: path text The POSIX file path of a record.
Has Property: plain text text The plain text of a record.
Has Property: reference URL text The URL (x-devonthink-item://…) to reference/link back to a record. Append ?page= to specify the zero-based index of a page of a PDF document, ?time= to specify the time of a movie or ?search= to specify a string to search.
Has Property: rich text text.ctxt The rich text of a record (see text suite).
Has Property: score real The score of the last comparison, classification or search (value between 0.0 and 1.0) or undefined otherwise.
Has Property: size integer The size of a record in bytes.
Has Property: source text The HTML/XML source of a record if available or the record converted to HTML if possible.
Has Property: state boolean The state/flag of a record.
Has Property: state visibility boolean Obsolete.
Has Property: tag type Ttyp The tag type of a record.
Has Property: tags list The tags of a record.
Has Property: thumbnail any The thumbnail of a record.
Has Property: type Dtyp The type of a record.
Has Property: unread boolean The unread flag of a record.
Has Property: URL text The URL of a record.
Has Property: uuid text The unique and persistent identifier of a record.
Has Property: width integer The width of an image or PDF document in pixels.
Has Property: word count integer The word count of a record.
 
search window (search windows) (Object) A DEVONthink Pro search window.
Inherits from Object: think window
Has Property: results list The search results.
Has Property: selection list The selected results.
 
selected text (selected texts) (Object) Represents a text selection.
Inherits from Object: text.ctxt
 
tab (tabs) (Object) A tab of a think window (supports standard ‘save’, ‘print’ and ‘close’ commands).
Inherits from Object: item
Has Property: content record record The record of the visible document.
Has Property: current page integer Zero-based index of current PDF page.
Has Property: database database The database of the tab.
Has Property: id integer The unique identifier of the tab.
Has Property: loading boolean Specifies if the current web page is still loading.
Has Property: number of columns integer Number of columns of the current sheet.
Has Property: number of rows integer Number of rows of the current sheet.
Has Property: paginated PDF any A printed PDF with pagination of the visible document.
Has Property: PDF any A PDF without pagination of the visible document retaining the screen layout.
Has Property: selected column integer Index (1-n) of selected column of the current sheet.
Has Property: selected columns list Indices (1-n) of selected columns of the current sheet.
Has Property: selected row integer Index (1-n) of selected row of the current sheet.
Has Property: selected rows list Indices (1-n) of selected rows of the current sheet.
Has Property: selected text selected text The text container for the selection of the tab.
Has Property: source text The HTML source of the current web page.
Has Property: text text.ctxt The text container of the tab.
Has Property: think window think window The think window of the tab.
Has Property: URL text The URL of the current web page.
Has Property: web archive any Web archive of the current web page.
 
tag group (tag groups) (Object) A tag of a database.
Inherits from Object: record
 
think window (think windows) (Object) A DEVONthink Pro document, viewer or search window (supports standard ‘save’, ‘print’ and ‘close’ commands).
Inherits from Object: window
Contains Object: tab
Has Property: content record record The record of the visible document.
Has Property: current page integer Zero-based index of current PDF page.
Has Property: current tab tab The selected tab of the think window.
Has Property: database database The database of the window.
Has Property: loading boolean Specifies if the current web page is still loading.
Has Property: number of columns integer Number of columns of the current sheet.
Has Property: number of rows integer Number of rows of the current sheet.
Has Property: paginated PDF any A printed PDF with pagination of the visible document.
Has Property: PDF any A PDF without pagination of the visible document retaining the screen layout.
Has Property: selected column integer Index (1-n) of selected column of the current sheet.
Has Property: selected columns list Indices (1-n) of selected columns of the current sheet.
Has Property: selected row integer Index (1-n) of selected row of the current sheet.
Has Property: selected rows list Indices (1-n) of selected rows of the current sheet.
Has Property: selected text selected text The text container for the selection of the window.
Has Property: source text The HTML source of the current web page.
Has Property: text text.ctxt The text container of the window.
Has Property: URL text The URL of the current web page.
Has Property: web archive any Web archive of the current web page.
 
viewer window (viewer windows) (Object) A DEVONthink Pro viewer window.
Inherits from Object: think window
Has Property: root record The top level group of the viewer.
Has Property: selection list The selected records.
Enumeration: Lkwh
            Value: all all Search term in text contents, all attributes and metadata.
            Value: comments lkw5 Search term in comments.
            Value: meta data mtdt Search term in metadata.
            Value: text contents lkw1 Search term in text contents.
            Value: titles lkw2 Search term in titles.
            Value: URLs lkw3 Search term in URLs.
Enumeration: Ityp
            Value: all all All files
            Value: chat ipt3 iChat logs
            Value: image imaA Images
            Value: location DTlo Internet locations
            Value: markup itp2 Markup files
            Value: pdf and postscript itp7 PDF & PostScript documents
            Value: quicktime ipt5 Quicktime movies & sounds
            Value: rich ctp2 Rich text documents
            Value: script ipt4 AppleScripts
            Value: sheet tabl Sheets (TSV, CSV, BiBTeX, …)
            Value: simple ctp1 Simple text files
Enumeration: WSrt
            Value: frequency freq Sorted by frequency
            Value: weight wght Sorted by weight
Enumeration: Lkcp
            Value: fuzzy fuzz Fuzzy search.
            Value: no case noca Case insensitive search.
            Value: no umlauts noum Diacritics insensitive search.
Enumeration: Ttyp
            Value: group tag gtag A “group” tag located outside of the tags group.
            Value: no tag ntag No tag (not a group or excluded from tagging).
            Value: ordinary tag otag An “ordinary” tag located inside of the tags group.
Enumeration: Ctyp
            Value: html html HTML document
            Value: note note Formatted Note
            Value: rich ctp2 Rich text
            Value: simple ctp1 Simple text
Enumeration: Dtyp
            Value: bookmark DTnx A Internet or filesystem location
            Value: feed feed RSS, RDF or Atom feed
            Value: formatted note DTft Formatted Note
            Value: group DTgr Group
            Value: html html HTML document
            Value: markdown mkdn Markdown document
            Value: PDF document pdf PDF document
            Value: picture pict Picture
            Value: plist plis Property list
            Value: quicktime quti QuickTime movie or sound
            Value: rtf rtf RTF document
            Value: rtfd rtfd RTFD document
            Value: script scpt Script
            Value: sheet tabl Sheet
            Value: smart group DTsg Smart group
            Value: txt txt Text document
            Value: unknown **** An unknown file type
            Value: webarchive wbar Web Archive
            Value: xml xml XML document
 
Type Definitions Records used in scripting DEVONthink Pro
 
 
print settings (Object)  
Has Property: copies integer the number of copies of a document to be printed
Has Property: collating boolean Should printed copies be collated?
Has Property: starting page integer the first page of the document to be printed
Has Property: ending page integer the last page of the document to be printed
Has Property: pages across integer number of logical pages laid across a physical page
Has Property: pages down integer number of logical pages laid out down a physical page
Has Property: requested print time date the time at which the desktop printer should print the document
Has Property: error handling enum how errors are handled
Has Property: fax number text for fax number
Has Property: target printer text for target printer
Enumeration: enum
            Value: standard lwst Standard PostScript error handling
            Value: detailed lwdt print a detailed report of PostScript errors
 
Type Names Other classes and commands
 
 
Standard Suite Common classes and commands for most applications.
 
 
close (Command) Close an object.
Direct Command Parameter: the object for the command
      Additional Text Parameter: saving savo (optional) Specifies whether changes should be saved before closing.
      Additional Text Parameter: saving in alias (optional) The file in which to save the object.
 
count (Command) Return the number of elements of a particular class within an object.
Direct Command Parameter: the object for the command
      Additional Text Parameter: each type (optional) The class of objects to be counted.
Return Type: INTEGER
 
delete (Command) Delete an object.
Direct Command Parameter: the object for the command
 
duplicate (Command) Copy object(s) and put the copies at a new location.
Direct Command Parameter: the object for the command
      Additional Text Parameter: to location specifier (optional) The location for the new object(s).
      Additional Text Parameter: with properties record (optional) Properties to be set in the new duplicated object(s).
 
exists (Command) Verify if an object exists.
Direct Command Parameter: the object for the command
Return Type: BOOLEAN
 
get (Command) Get the data for an object.
Direct Command Parameter: the object for the command
Return Type: ANY
 
make (Command) Make a new object.
      Additional Text Parameter: new type The class of the new object.
      Additional Text Parameter: at location specifier (optional) The location at which to insert the object.
      Additional Text Parameter: with data any (optional) The initial data for the object.
      Additional Text Parameter: with properties record (optional) The initial values for properties of the object.
Return Type: SPECIFIER
 
move (Command) Move object(s) to a new location.
Direct Command Parameter: the object for the command
      Additional Text Parameter: to location specifier The new location for the object(s).
 
open (Command) Open an object.
Direct Command Parameter: The file(s) to be opened.
Return Type: DOCUMENT
 
print (Command) Print an object.
Direct Command Parameter: The file(s) or document(s) to be printed.
      Additional Text Parameter: print dialog boolean (optional) Should the application show the Print dialog?
      Additional Text Parameter: with properties print settings (optional) the print settings
 
quit (Command) Quit an application.
      Additional Text Parameter: saving savo (optional) Specifies whether changes should be saved before quitting.
 
save (Command) Save an object.
Direct Command Parameter: the object for the command
      Additional Text Parameter: as text (optional) The file type in which to save the data.
      Additional Text Parameter: in alias (optional) The file in which to save the object.
 
set (Command) Set an object’s data.
Direct Command Parameter: the object for the command
      Additional Text Parameter: to any The new value.
 
application (applications) (Object) An application’s top level scripting object.
Inherits from Object: item
Contains Object: document
Contains Object: window
Has Property: frontmost boolean Is this the frontmost (active) application?
Has Property: name text The name of the application.
Has Property: version text The version of the application.
 
color (colors) (Object) A color.
Inherits from Object: item
 
document (documents) (Object) A document.
Inherits from Object: item
Has Property: modified boolean Has the document been modified since the last save?
Has Property: name text The document’s name.
Has Property: path text The document’s path.
 
item (items) (Object) A scriptable object.
Has Property: class type The class of the object.
Has Property: properties record All of the object’s properties.
 
window (windows) (Object) A window.
Inherits from Object: item
Has Property: bounds rectangle The bounding rectangle of the window.
Has Property: closeable boolean Whether the window has a close box.
Has Property: document document The document whose contents are being displayed in the window.
Has Property: floating boolean Whether the window floats.
Has Property: id integer The unique identifier of the window.
Has Property: index integer The index of the window, ordered front to back.
Has Property: miniaturizable boolean Whether the window can be miniaturized.
Has Property: miniaturized boolean Whether the window is currently miniaturized.
Has Property: modal boolean Whether the window is the application’s current modal window.
Has Property: name text The full title of the window.
Has Property: resizable boolean Whether the window can be resized.
Has Property: titled boolean Whether the window has a title bar.
Has Property: visible boolean Whether the window is currently visible.
Has Property: zoomable boolean Whether the window can be zoomed.
Has Property: zoomed boolean Whether the window is currently zoomed.
Enumeration: savo
            Value: ask ask Ask the user whether or not to save the file.
            Value: no no Do not save the file.
            Value: yes yes Save the file.
 
Text Suite A set of basic classes for text processing.
 
 
attachment (attachments) (Object) Represents an inline text attachment. This class is used mainly for make commands.
Inherits from Object: text.ctxt
Has Property: file name text The path to the file for the attachment
 
attribute run (attribute runs) (Object) This subdivides the text into chunks that all have the same attributes.
Inherits from Object: item
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: color color The color of the first character.
Has Property: font text The name of the font of the first character.
Has Property: size integer The size in points of the first character.
 
character (characters) (Object) This subdivides the text into characters.
Inherits from Object: item
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: color color The color of the first character.
Has Property: font text The name of the font of the first character.
Has Property: size integer The size in points of the first character.
 
paragraph (paragraphs) (Object) This subdivides the text into paragraphs.
Inherits from Object: item
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: color color The color of the first character.
Has Property: font text The name of the font of the first character.
Has Property: size integer The size in points of the first character.
 
text (texts) (Object) Rich (styled) text
Inherits from Object: item
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: color color The color of the first character.
Has Property: font text The name of the font of the first character.
Has Property: size integer The size in points of the first character.
 
word (words) (Object) This subdivides the text into words.
Inherits from Object: item
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: color color The color of the first character.
Has Property: font text The name of the font of the first character.
Has Property: size integer The size in points of the first character.
 
Extended Text Suite Extended functionality for text.
 
 
bold (Command) Bold some text
Direct Command Parameter: the object for the command
 
italicize (Command) Italicize some text
Direct Command Parameter: the object for the command
 
plain (Command) Make some text plain
Direct Command Parameter: the object for the command
 
reformat (Command) Reformat some text. Similar to WordService’s Reformat service.
Direct Command Parameter: the object for the command
 
scroll to visible (Command) Scroll to and animate some text. Requires Mac OS X 10.6.
Direct Command Parameter: the object for the command
 
strike (Command) Strike some text
Direct Command Parameter: the object for the command
 
unbold (Command) Unbold some text
Direct Command Parameter: the object for the command
 
underline (Command) Underline some text
Direct Command Parameter: the object for the command
 
unitalicize (Command) Unitalicize some text
Direct Command Parameter: the object for the command
 
unstrike (Command) Unstrike some text
Direct Command Parameter: the object for the command
 
ununderline (Command) Ununderline some text
Direct Command Parameter: the object for the command
Has Property: file name text The path to the file for the attachment
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: alignment DAta Alignment of the text.
Has Property: background color The background color of the first character.
Has Property: baseline offset real Number of pixels shifted above or below the normal baseline.
Has Property: color color The foreground color of the first character.
Has Property: first line head indent real Paragraph first line head indent of the text (always 0 or positive)
Has Property: font text The name of the font of the first character.
Has Property: head indent real Paragraph head indent of the text (always 0 or positive).
Has Property: line spacing real Line spacing of the text.
Has Property: maximum line height real Maximum line height of the text.
Has Property: minimum line height real Minimum line height of the text.
Has Property: paragraph spacing real Paragraph spacing of the text.
Has Property: size integer The size in points of the first character.
Has Property: superscript integer The superscript level of the text.
Has Property: tail indent real Paragraph tail indent of the text. If positive, it’s the absolute line width. If 0 or negative, it’s added to the line width.
Has Property: text text The actual text content.
Has Property: underlined boolean Is the first character underlined?
Has Property: URL text Link of the text.
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: alignment DAta Alignment of the text.
Has Property: background color The background color of the first character.
Has Property: baseline offset real Number of pixels shifted above or below the normal baseline.
Has Property: color color The foreground color of the first character.
Has Property: first line head indent real Paragraph first line head indent of the text (always 0 or positive)
Has Property: font text The name of the font of the first character.
Has Property: head indent real Paragraph head indent of the text (always 0 or positive).
Has Property: line spacing real Line spacing of the text.
Has Property: maximum line height real Maximum line height of the text.
Has Property: minimum line height real Minimum line height of the text.
Has Property: paragraph spacing real Paragraph spacing of the text.
Has Property: size integer The size in points of the first character.
Has Property: superscript integer The superscript level of the text.
Has Property: tail indent real Paragraph tail indent of the text. If positive, it’s the absolute line width. If 0 or negative, it’s added to the line width.
Has Property: text text The actual text content.
Has Property: underlined boolean Is the first character underlined?
Has Property: URL text Link of the text.
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: alignment DAta Alignment of the text.
Has Property: background color The background color of the first character.
Has Property: baseline offset real Number of pixels shifted above or below the normal baseline.
Has Property: color color The foreground color of the first character.
Has Property: first line head indent real Paragraph first line head indent of the text (always 0 or positive)
Has Property: font text The name of the font of the first character.
Has Property: head indent real Paragraph head indent of the text (always 0 or positive).
Has Property: line spacing real Line spacing of the text.
Has Property: maximum line height real Maximum line height of the text.
Has Property: minimum line height real Minimum line height of the text.
Has Property: paragraph spacing real Paragraph spacing of the text.
Has Property: size integer The size in points of the first character.
Has Property: superscript integer The superscript level of the text.
Has Property: tail indent real Paragraph tail indent of the text. If positive, it’s the absolute line width. If 0 or negative, it’s added to the line width.
Has Property: text text The actual text content.
Has Property: underlined boolean Is the first character underlined?
Has Property: URL text Link of the text.
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: alignment DAta Alignment of the text.
Has Property: background color The background color of the first character.
Has Property: baseline offset real Number of pixels shifted above or below the normal baseline.
Has Property: color color The foreground color of the first character.
Has Property: first line head indent real Paragraph first line head indent of the text (always 0 or positive)
Has Property: font text The name of the font of the first character.
Has Property: head indent real Paragraph head indent of the text (always 0 or positive).
Has Property: line spacing real Line spacing of the text.
Has Property: maximum line height real Maximum line height of the text.
Has Property: minimum line height real Minimum line height of the text.
Has Property: paragraph spacing real Paragraph spacing of the text.
Has Property: size integer The size in points of the first character.
Has Property: superscript integer The superscript level of the text.
Has Property: tail indent real Paragraph tail indent of the text. If positive, it’s the absolute line width. If 0 or negative, it’s added to the line width.
Has Property: text text The actual text content.
Has Property: underlined boolean Is the first character underlined?
Has Property: URL text Link of the text.
Contains Object: attachment
Contains Object: attribute run
Contains Object: character
Contains Object: paragraph
Contains Object: word
Has Property: alignment DAta Alignment of the text.
Has Property: background color The background color of the first character.
Has Property: baseline offset real Number of pixels shifted above or below the normal baseline.
Has Property: color color The foreground color of the first character.
Has Property: first line head indent real Paragraph first line head indent of the text (always 0 or positive)
Has Property: font text The name of the font of the first character.
Has Property: head indent real Paragraph head indent of the text (always 0 or positive).
Has Property: line spacing real Line spacing of the text.
Has Property: maximum line height real Maximum line height of the text.
Has Property: minimum line height real Minimum line height of the text.
Has Property: paragraph spacing real Paragraph spacing of the text.
Has Property: size integer The size in points of the first character.
Has Property: superscript integer The superscript level of the text.
Has Property: tail indent real Paragraph tail indent of the text. If positive, it’s the absolute line width. If 0 or negative, it’s added to the line width.
Has Property: text text The actual text content.
Has Property: underlined boolean Is the first character underlined?
Has Property: URL text Link of the text.
Enumeration: DAta
            Value: center DAa1  
            Value: justified DAa3  
            Value: left DAa0  
            Value: natural DAa4  
            Value: right DAa2  

Leave a Reply

Your email address will not be published. Required fields are marked *