I’m exploring what’s possible with Shortcuts and DTTG. Building on BLUEFROG’s idea of creating bookmarks with item links, I came up with the following shortcut. It’s pretty tailored to @jprint714’s brief and relies on labels. But the general idea has wider application, and the shortcut could easily be changed to work with different criteria like tags or ratings.
Create and update multiple “reading lists” in DEVONthink To Go, in the form of groups of x-devonthink-item://-bookmarks.
The shortcut assumes one group (the RLdir variable) housing your different lists. It runs on a group selected in the item list—assumed to be the top-level group of a project/area—and creates or updates the group 📖 <Name of selected group> in your RLdir.
The shortcut presents a list of labels to choose from. It then searches the selected group for files with those labels and creates a bookmark in 📖 … for each search result. Duplicates are avoided by checking first if the bookmark already exists.
Bookmarks get the name [Label] <ItemName> for sorting and clarity.
(I couldn’t find a way to pass item labels to the bookmarks. According to the manual you can retrieve and set labels with URL commands, but I’m not sure it would work with the rest of the shortcut.)
At the end the shortcut tells you how many bookmarks are in 📖 …, how many were created, and optionally opens the group.
Preparations:
Create a group to store you different reading lists.
Copy its item link and have it ready for setup.
Have a list of your label names ready.
(During setup the shortcut will ask you to enter them in the “Key” fields of a dictionary.)
How to run
Go to DTTG’s item list
Tap the ‘Organize’ toolbar icon (three dots in a circle)
Select a group
Run the shortcut (from the share sheet, from a Spotlight search, or directly from the Shortcuts app)
Thank you so much for this, @troejgaard – and please excuse my late reply. I saw your first post, but overlooked your second, more comprehensive one.
To back up for a minute, because this might’ve gotten lost in back and forth re: the shortcut…
I’m interested in setting up a dynamic reading list that groups select files by my projects (contain in my parent Groups), organized by priority (i.e., 1 - URGENT ; 2 - HIGH ; 3 - MEDIUM , etc.), and able to synced between DTP and DTTG – that’s the crucial part.
For my workflow, I curate / organize most of my files in DTP, but annotate most of them in DTTG. Forgive me if I’m being redundant, but I just want to be clear about this before troubling you or anyone else further, in case your suggested set-up wouldn’t be an appropriate solution.
In rereading your “Project ReadList” Shortcut I’m trying to imagine how I would set up the groups you’re suggesting for this process. For my DTP, I have a nest of groups that go something like…
DATABASE
[ Project names ]
I. ARTICLES
– A - Raw
or
DATABASE
[ Project names ]
II. DOCUMENTS
– A - Raw
So, under your configuration, would you suggest I create a Smart Group for these various [ Projects ] > I. ARTICLES > - A - Raw Groups? Or create standalone groups, and replicate the appropriate folders / files to them?
To answer your previous question re: my Shortcut problems, the shortcut just hasn’t been moving items into the Urgent folder. I’m sure there’s something I’m doing. But, as you’ve observed, I’ve been using DTP’s Labels to quickly triage documents that I clip (i.e., RED = 1 - URGENT ; ORANGE = 2 - HIGH ; YELLOW = 3 - MEDIUM , etc.).
I’m not tethered to this process; it’s just what I set up as a quick and easy way to clip and ID documents – and the color coding helps me identify high-priority reading. But if it’s not possible to use Labels in Shortcut, I’m happy to consider another route (though I’d love to keep the label colors, if possible).
I’m open to suggestions for making this a better, easier and more efficient work process. Based on what I’ve described, what do you think might work best?
Thanks again! Really appreciate all of your generous help…
All good! The shortcut I shared above wasn’t even directly adressed to you. I was just exploring possibilities based on this thread and wanted to share in case it was useful for others. It wasn’t obvious to me, for example, that you can use a Repeat with each item loop on a list of search results.
That doesn’t answer any of the questions I asked, and offers no clues to why you can’t get BLUEFROG’s shortcut to work. You’re just restating that it doesn’t work. (Also, the shortcut isn’t supposed to move anything—it creates a bookmark to the item in the “Urgent” group.)
My shortcut is not really “dynamic”, since you have to manually run it on a selected group. And it only works on iOS—though the results do sync back to DEVONthink on the desktop. So I don’t know where you get the idea of a smart group (or replicants).
The idea of my shortcut is that you select the top level group of a single project (already existing) and run the shortcut. The shortcut then searches the project for files with the label(s) you select. For each result, it creates a local bookmark to the file, placed in a seperate group which functions as a “Reading list” for the project. That group is a child of the group set as the variable RLdir (short for “Reading list directory”. I would just name the group “Reading Lists”). This is the only group you need to create for the shortcut. It would make sense to place it in your Global Inbox.
The point of using bookmarks is that they work across databases. Replicants don’t.
However, with your further descriptions, I’m not sure a shortcut on iOS is the right approach. So yes, let’s back up a bit…
In that case it should very much be possbile to set up something on your mac that syncs to DTTG.
If you like labels, you can set up a smart rule with the trigger On Labelling. The smart rule can run a script that creates local bookmarks to the items, grouped by project in a “Reading Lists” group. These will all sync to DTTG. It’s the same basic idea as my earlier shortcut, but on mac this can all run automatically. (Plus more options and better control).
The issue is determining the project name of an item. My approach would be to parse it from the location property, which returns something that looks like a traditional file path (i.e. /Path/to/Parent/). For that to work, all top-level project groups must be at the same level in the group hierarchy. For example:
on performSmartRule(theRecords)
tell application id "DNtp"
set theDatabase to inbox -- For collections per database, move inside repeat loop and use "database of theRecord"
set RLdir to "/Reading Lists/" -- Only used as building block, so includes trailing dash
repeat with theRecord in theRecords
-- Get/create reading list:
set itemPath to location of theRecord --> /Path/to/Parent/
set AppleScript's text item delimiters to "/"
set theProject to text item 3 of itemPath -- Adjust this based on your group hierarchy. ("text item 1" is empty)
set listName to "📖 " & theProject
set theReadingList to create location (RLdir & listName) in theDatabase
-- Item properties:
set {itemName, itemLink, itemLabel} to {name without extension, reference URL, label} of theRecord
-- Create bookmark / Update label:
set theBookmark to get record at (RLdir & listName & "/" & itemName) in theDatabase
if theBookmark is missing value then
create record with {type:bookmark, name:itemName, URL:itemLink, label:itemLabel} in theReadingList
else if (label of theBookmark) ≠ itemLabel then
set label of theBookmark to itemLabel
end if
end repeat
end tell
end performSmartRule
The bookmarks inherit the label of the file they refer to – and if you change the label, the label of the bookmark is updated as well.
In DTTG you can sort the item list by label.
All of the dynamic stuff only works on your mac, of course.
Extending this, you could add another smart rule that triggers After Synchronization, looks through the bookmarks in your “Reading Lists” group, and checks if their label match the label of the item they link to. And if they don’t, updates the label of the linked item accordingly.
This way you can reprioritize reading lists in DTTG by changing labels on the bookmarks and have it sync back to the mac.
(Setting labels through a script does not trigger the On Labelling smart rule event, so it doesn’t trigger the first smart rule.)
-- Set search location of smart rule to your "Reading Lists" group
-- Trigger: After Synchronization
on performSmartRule(theBookmarks)
tell application id "DNtp"
repeat with theBookmark in theBookmarks
set {itemLink, bookmarkLabel} to {URL, label} of theBookmark
set theRecord to get record with uuid itemLink
if (label of theRecord) ≠ bookmarkLabel then
set (label of theRecord) to bookmarkLabel
end if
end repeat
end tell
end performSmartRule
Sorry for my delayed reply, @troejgaard ! I need to review the old posts, and your recent replies, to jog my memory and understand everything properly.
I confess, while I’ve been a longtime DTP user, I haven’t used bookmarks very often. But after reviewing your latest posts, I think I better understand your approach – and how you’re using bookmarks as discrete reference files for reading list files I’ve labeled urgent. Seems like a smart workaround solution!
Before jumping into your approach (which looks great!) and troubling you with more questions, let me back up and clarify aspects of my set-up – and what I’m seeking. You explain that for in order for your approach to work…
Good news – as @BLUEFROG can attest, I’ve got perfect organizational parity with all of my to-level groups! It basically looks like this (though with slightly different Group names)…
After rereading my original post, I realize I should’ve clarified where I’d like the Reading List to live, which would also affect how I’d like it how I’d to function (if possible). I did mention how…
So, it would be ideal to have the Reading List live in the Globals section (in lieu of using DTP’s Reading List). Would that be possible? It would be easier to have them centrally located there, instead of navigating through: Database(s)>Group(s)>Sub-Group(s), etc.
Again, I’d been imagining this Reading List by project, and then priority, e.g…
GLOBAL INBOX
├── Reading List [Groups])
│ ├── Project 1
│ │ ├── Urgent
│ │ ├── High
│ │ ├── Medium
│ ├── Project 2
│ │ ├── Urgent
│ │ ├── High
│ │ ├── Medium
Like I said, I was imagining I could toggle on/off project-Groups in the reading list (in the way that one is able to select/deselect Favorites in DTP), depending on work priorities. (FWIW, these project-Groups could extend beyond those in my “Active Projects” database; sometime I’ll need to read project-Groups located in other databases).
Perhaps it would be easy to do this toggle on/off project-Groups in the reading list through using the Flag feature.
What do you think about this approach? Would it work with your suggested approach? Again, I wanted to first circle back about this before proceeding further.
Had another thought that might make this process easier… If using Flag(s) for toggling on/off project-Groups in the Reading List (in the way that one is able to select/deselect Favorites in DTP), I could simple have two Group (Priority Reading, Non-Priority Reading) – and could manually move project-Groups between them as my work priorities shift. For example, using this kind of structure…
GLOBAL INBOX
├── Reading List
│ ├── Priority Reading
| │ ├── Project 1
| │ │ ├── Urgent
| │ │ ├── High
| │ │ ├── Medium
│ ├── Non-Priority Reading
| │ ├── Project 2
| │ │ ├── Urgent
| │ │ ├── High
| │ │ ├── Medium
Would that be better / easier? Happy to consider other ideas / suggestions… Thanks so much!
I don’t use bookmarks that much, but they can be handy. They don’t have to point to web locations – they can use any valid URI, including x-devonthink-item:// links.[1]
No. You can’t add anything to the Global section of DTTG’s home screen. You can only reorder existing items and toggle the various predefined smart groups.
You can, however, add any group (or file) to the Favorites smart group. The idea was to add the “Reading Lists” group to your Favorites.
For even quicker access, you can use Shortcuts to open DTTG
in a particular group. (That kind of shortcut is much simpler than the ones earlier in the thread). Then you can access the “Reading Lists” group with a single tap from the home screen. You could also use the group with this shortcut:
Yes. I wasn’t sure if you understood that DTTG’s item list can be filtered. (And view options are rembered per group, which is neat). Flag the priority projects in the “Reading Lists” group and filter on flagged status, would be my suggestion.
Or perhaps add specific 📖 Project X groups to favorites.
Do you really need further sub-groups for “Urgent” etc. in each reading list? Isn’t it enough to sort by label?
I guess it would be possible to script such priority sub-groups too, but that seems a little more complicated. At that point I wonder why you don’t use a task manager instead. Many of them make it easy to add links, and DT item links work across platforms.
Depending on how many databases we’re talking about, you could simply create a smart rule for each database.
If you want a single smart rule targeting all databases, you should limit the matches some other way. I think a tag could work. I.e.:
Give project groups a tag like type-project
Enable “Inherit Tags of Groups” in the database properties. Now all project documents have that tag.
In the smart rule, add the criteria Tag is: type-project
But I don’t know if “Inherit Tags of Groups” conflicts with your existing use of tags.
PS: The file tree formatting works best with monospaced fonts. Mark those sections as code blocks, you can use the shortcut Cmd-E in the composition field.
If you haven’t used them like that, try it out. Copy the item link of a document, Data > New > Bookmark, paste the item link in the URL field. ↩︎
Thank you so much again for all of your helpful ideas, @troejgaard – really appreciate it. (And I’m sorry, again, for my late reply…)
I’ve been rereading your suggested approach, and I think I understand many parts of what you’re suggesting – e.g., using Shortcuts to open DTTG
in a particular group, some of your sorting suggestions (I think your suggested approach there makes sense), etc. – but don’t quite follow your idea for using Favorites.
I understand how Favorites are used to group priority Groups (project folders) in DTP and in DTTG. But I don’t understand what you’re suggesting for using them as a way to sync Favorites / priority Groups, since Favorites still don’t sync between DTP and in DTTG. Can you explain your thinking there? Thanks!
I think I’d need to first understand that approach and then, if it seems like the right fit, I’d be glad to explore your Smart Rule approach for targeting all databases, as you suggested.
BTW, I was thinking such a rule could be used with applying a Flag to a Group (maybe – just seems like an easy approach, especially since I rarely use flags). Happy to consider any other approach you might recommend.
Anyway, just let me know whenever you can and we’ll take it from there, sound good? And I promised to respond much more quickly! Thanks again…
Just wondering if there’s any update on the ability to sync Favorites or Smart Groups between DTP and DTTG? (This was raised in a discussing last January, so I think enough time has passed to inquire politely!)
@BLUEFROG - If there’s nothing on the horizon, would you suggest another syncing approach between the two platforms? Thank you!
Thanks! Just looked at the social medial profile (via the link). So far, I didn’t see anything that related to syncable smart groups. Did I overlook something? Or is there about to be breaking news? Just seeking a solution to the reading list problem that I’ve outlined here. Thanks!
I never suggested that. Please read it in context. It was purely about navigation and quick access.
You asked if it is possible to add a group to the home/database screen in DTTG.
The answer is no.
The next best thing is to add it to your Favorites. Or open it directly with a shortcut.
The smart rule doesn’t target groups, it targets documents. So that seems like a bad idea – especially if you would use flagging to filter the different reading lists in DTTG’a item list.
I did test a script that determines the top-level group in a project based on a custom metadata field (“Project”, yes/no, simple boolean), so it might be enough to limit the smart rule scope to labelled documents.
If you have trouble understanding or envisioning how this is supposed to work, I suggest you try implementing it. There is a limit to what we can understand by thinking and talking, reading and writing… Action provides direct feedback through experience which is often crucial to understanding and learning.
How do you think I come up with this stuff? I try things out and experiment. I might start with an idea, but then I test it and adjust based on what I experience.