|
|
Script Editor and Assistant |
|
For those interested in scripting, a specialized scripting interface is now included in DEVONthink. With it you can draft a variety of scripts in both AppleScript and JavaScript (JXA). Covering the types of scripts used in-application, you can start creating scripts and open them in an external editor, as needed. The Script Editor window can be opened via Data > New > Script as well as the context menu of the item list and the Action menu. The window is composed quite simply. You have a mandatory Name field. Following that is an optional Info field where you can include a description or instructions, appearing as comments in the script. Next is the Type dropdown where you choose one of the types of scripts found in DEVONthink. The supported types are:
Finally, at the bottom of the window, is the editing pane where you can work on the code. As you work, you can press the Compile button, shown with a small hammer. This lets you check if your code has any syntax issues. And finally, the OK button will generate a script file with the code for you to open in an external editor, etc. Script files are saved as text-based You can read more about the various types of scripts in the Automation chapter. PRO
Script Assistant
If you have set up access to external AI in the Pro and Server editions of DEVONthink, you may be able to use it to write or modify the code. Below are the places you can find the Script Assistant. Bear in mind, the code is a draft and the script may not work correctly in its initial form. However, the AI is aware of several common scripting errors and will attempt to correct them in its output. You can ask it to refine the code. Script Editor: Below the Type dropdown in the Script Editor window is a field where you can enter a prompt to be used for a script. Click the icon to the left of the field and choose an available AI model that supports coding. After you write your prompt, press the ↩ Return key and AI will try and draft a script fulfilling the requirements you've set.
Smart Actions: Another place you can access external AI is when editing a smart item script in a smart action, i.e., Reminders: When setting an reminder alarm on an item, you can add a reminder alarm script. For the alarm, choose |