Note: An updated version V5b6 is in post#2
What the script does: take atomic note on cited text (or blank note) and name it with a unique identifier, save all notes taken from a literature/source document into a source-linked group. The scipt can insert different backlinks into the note, and tag the note by multiple matching methods and replicate it to different groups (at creation or later) - all in one go. Finally, the user can re-configure how a note is created anytime without changing the script.
The major changes in this version are all about user-experience:
- All preferences are set in a single dialog box.
- Each database has its own preference of Stack.
- The script is more configurable than the previous versions.
- Changing internal preference in the script is no longer required.
- The script is compatible to the stacks created with V3/V4.
- However, the older version needs to create five cmds, this version needs nine.
This is what the script does when the user selects a piece of text and invokes Stack:
- The text is underlined (or highlighted or do nothing) and a note with cited text (or blank note) is created.
- A date-time id (or a card id) will be put at the front (or back) of the note’s title (auto or by user entry).
- A backlink to source-linked group (always reveal itself in a viewer window), the source (always goto 1st page), the position of which the note is created (goto page or paragraph where the note is created), and a backlink with a search string if there is cited text (with a fixed link-name or a unique link-name from a source’s cmd, such as a cmd that contains the citation of the source). User can choose to include none to all backlinks in a note.
- A source-linked stack is created. All notes from the same source will be in the group.
- The source is linked to the stack and vice versa. 6. The note is linked to the source. 7. The note has a date-time id and a position (page position for pdf-as-source and non-blank paragraph position for rtf-as-source)
Right after a note is created, or if the user invokes the script later (e.g. after finish writing the note or review the note after a while), the script will suggest a list of tags that is from the source of the note - because the note is linked to its source when it is created by Stack
- The script shows a list of suggested tags, based on the tags of the source, DT’s keywords and hash tags, all tags in the current database, a default hierachical date-tag for today (in a tag-hierarchy of year>month>date). Multiple tags selection is allowed by using cmd-click.
- The sixth tagging method is keypharses matching, the user can use a matchsheet that is created by Stack, and enters different matching phrases or words for each tag. For example, a tag of “USA” can be matched to s&p 500 or fortune 100 or donald trump. User invokes the same Stack script to sync the matchsheet with the tags. This feature is not AI, but it bypasses the limitation of exact word-for-word match of DT’s keywords tags. I won’t go through the details unless someone is interested to know how to use it.
If “Create new tags”" is one of the chosen item in the tag list, user will see another dialog box after the other selected tags are assigned to the note:
Date tag created here is also hierachical, with a tag group structure of YYYY>MM>YYYY-MM-DD
After the tagging, the scipt shows a list of groups in which the note can be replicated to:
Groups will be shown in the list when their cmd field “iscontainer” is checked.
Finally, the configuration dialog
The action of Stack script is contextual. If a group is selected, the script assumes that the user wants to change the preference; if a document is selected, the script assumes that user wants to take a note; if a note - that is created by Stack - is selected, the script assumes that user either wants to tag/group the note or want to create another note or a note of note; if a tag is selected, the script assumes that the user wants to sync the matchsheet with the tags (if “match keyphrases” is enabled in the preference).
The requirements to run Stack
- You need to download Dialog Toolkit Plus from the Late Night Software website and save it under “/Library/Script Libraries”.
- The scipt should be placed under DT’s script menu or toolbar folder.
- You need to create nine custom meta data fields.
- The script is faster than previous versions, and particularly on tags suggestion (thanks to @cgrunenberg foundation code in another post) BUT the loading of preference dialog may take up to 10 secs for the first time. For unknown reason, DT is using a lot of time to load the preference dialog than SD or SE (<1 sec). But the user won’t re-configure Stack that often anyway.
The exact name of fields and their datatype are as follows:
-- custom meta data fields to be created property mdStackLink : "stacklink" -- type "URL", used by source document to hold the link to the theSourceStack property mdSourceLink : "sourcelink" -- type "URL", used by notes to hold the link to the source document property mdCardNum : "cardnum" -- data "Integer" key it for compatibility with previous version property mdIsCard : "iscard" -- type boolean, value=1 for a note that is created from a source sdocument property mdHasStack : "hasstack" -- type boolean, value=1 if a document has as stack -- *** new cmd field required compareing to previous stack script property mdDID : "notedateid" -- type identifier , holding the YYYYMMDDHHMM unique note identifier property mdPosition : "noteposition" -- type identifier, holding page or paragraph reference for the note property mdtagIs : "tagis" -- type "multi-line text", match tags to the plain text of source document property mdIsContainer : "iscontainer" -- type boolean, value=1 if a group is to be shown as a note containe -- end of custom meta data fields to be created
The design is frozen. This script is almost perfect for my purpose. But I’ll post bug fixes if I or anyone finds one. Cheers.
StackV5b4.scpt.zip (169.9 KB)
There are also three utility scripts that can be used together with Stack script
A script to choose notes from stack. When the user is in a document and run this script, a popup will be showing all notes/document in its stack.
A script to put other documents into a source-stack. While reviewing other articles, the users may think the article is related to a previously reviewed article, this script will search for the other documents by name and put the currently reviewed article into its stack. Source-stacks for those documents will be created if they don’t exist yet. In a sense, the literature is now linked to each other by having a replicant in each other’s stack - similar to the concept of Hook app.
Atomic notes are snippets that focus on a single idea/concept/argument, etc. But there are times when I want to review all notes that have been taken from one literature. I can go to the stack, sort the notes by their dateid or positionid, and use MergeView Script to create a consolidated MV file, and edit any individual notes right in the MV file. Similarily, I can merge the notes under a tag or tags-combination and take a consolidated review by the script.