Stack V5: a rather configurable script for taking snippet-notes while reviewing literature

Note: An updated version V5b6 is in post#2

This is the fifth iterations of Stack scipt ( from V1 to v4 ) that I use for taking multiple atomic notes while reviewing academic literature.I hope that it might be useful to some forum members.

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:

  1. The text is underlined (or highlighted or do nothing) and a note with cited text (or blank note) is created.
  2. 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).
  3. 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.
  4. A source-linked stack is created. All notes from the same source will be in the group.
  5. 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

  1. 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.
  2. 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

Note:
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

  1. You need to download Dialog Toolkit Plus from the Late Night Software website and save it under “/Library/Script Libraries”.
  2. The scipt should be placed under DT’s script menu or toolbar folder.
  3. You need to create nine custom meta data fields.
  4. 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 script

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.

7 Likes

An updated version V5b6

StackV5b6.scpt.zip (200.7 KB)

  • The tag selector of Stack script is now showing the command section that is the same as Tagger V5 except that the option of “tags match to see-also” in preference is only available in Tagger. The reason is that the tag selector in Stack is first shown when a note is created, there won’t be enough content to find any meaningful see-also documents.

  • With the command section in tag selector, the users can now perform the tasks of creating new tags and new date tags, filtering the tags list, and replicating the note to other groups again and again until all related tasks are finished.

  • The StackV5b6 is sharing the “StackAndTagger.plist” file. Users who have been testing Stack V5b5 will have to setup the preference of their Stack again but there is no impact to all of the notes and source stacks that were created previously.

Thank you very much for your wonderful script! Can you use it to add not only text from pdf, but also a picture that is present in the text.

If u are referring to image with a link back to the pdf, I think it is going to be tricky, if not impossible, to achieve. For rtf, I think u can just take a screen snapshot and paste the image to the note after the note is created.

I use the script to create markdown note, and use this script to capture the image with a image link to an image asset group in DT. The script is clumsy, but it works:

Another script to work with Stacker

You can link the picture to the note indirectly by following these two steps:
(1) Capture the picture (shift-command-4) and paste it into the note (for rtf), or use the script I mentioned previously to capture the image and paste the picture’s link into the note (for markdown).
(2) Use the MQL script to select some text nearby the picture, and paste the text link as a bookmark under the picture/picture link.

Clicking on the bookmark link will bring you to the location of the picture in the source.

Thank you, for the useful tools.