I’m learning the ropes and hoping that the forum can provide some guidance on correcting an action that consistently causes TB to crash, even though the action only operates on a few notes in a small test file.
Context:
I’m trying to automate getting my book ratings / reviews on Goodreads as book notes in TB. For older reviews, the process was as easy as exporting a CSV file from the Goodreads website, tweaking the file and dropping it into TB. That works without issue. This is not something I’d want to do often going forward though and would prefer to automate it going forward.
The test:
Using Devonthink (DT) I’m able to follow an RSS feed that updates whenever I complete a book rating on the Goodreads website. Items in the feed naturally drop off after some time on DT depending on your settings so I’ve used a smart rule to copy these files (HTML documents) to a more permanent DT group. I then set TB to watch the DT group. This works fine. The container is called GoodreadsReviews.
In TB, I’ve set up a prototype (pBook) and user attributes and some code that is able to read the content of text of the watched files and populate the user attributes.
As the watched files come into TB as read only notes, I’m looking to duplicate the notes into a new container for book reviews. For this, I’ve created a container, Books, set with the OnAdd $Prototype=“pBook”. The OnAdd works.
In the Books container, I’ve then set up an agent within the Books container to call the notes in the GoodreadsReviews container. The AgentQuery inside(“/GoodreadsReviews”) works for this.
Everything works up to this point.
The problem
The agent action for the agent is as follows:
duplicate(original);
$Container(GoodreadsReviews) = “/Books”;
This successfully makes a copy of the notes in the GoodreadsReview container and applies the prototype etc. The problem is that it continues to do so, over and over, until I delete the GoodreadsReview container. Not ideal!!
Ask:
Does anyone have suggestions on:
How do I stop the continues creation of duplicate files; or
A complete different approach to achieving the goal.
Just to point out, and this may be something that I’m doing wrong, the container named GoodreadsReview is the container that is autogenerated when setting TB to watch the DT group. I think the auto generated name is Devonthink. I then simply renamed that container to GoodreadsReview.
Another thing to consider is maybe there is one or more notes in the Goodreads feed that have a character (e.g., some unicode character) that Tinderbox can’t process. I’ve run into this type of issue before.
Not frowned upon (there’s no department of inquisition for Tinderbox), but not recommended. In any software that uses a background process to copy data from point A to point B, it’s best usually not to modify the content of B. Copy from B to C, for sure. This breaks the chain of autoupdate (which is what you probably want) and preserves the copy for local use.
I agree with this and this is really why I’m trying to go through the hoops of creating duplicates that can then be edited without editing the notes being pulled in from DT. The edits I’m applying are only being made to the duplicated notes created for the purpose of editing (I think, given my basic knowledge).
The only change that I do make to the watched folder is to change the container that TB makes when setting up the watched group from DEVONthink (the generated name) to GoodreadsReviews. I suspect that this will be a necessary evil though as each container created when setting TB to watch a DT group is given DEVONthink as a default name. I imagine that having this name duplicated would cause even more problems. Now ideas come up as we type though, so thanks for the prompt - perhaps it is possible to have the action query refer to the container ID rather than its name.
I’m not sure whether this will resolve the perpetual duplication issue but it’s worth a try.
Have you thought of a Display Expression? So, rather than change the actual container title (it’s $Name), you could use a Display Expression to display a label of ‘GoodreadsReviews’, whilst letting the app string with the $Name of DEVONthink.
I’d do it like this, after making the watched maintainer:
In you new watched DEVONthink folder set MyString to ‘‘GoodreadsReviews’’
Set the containers Display Expression to be `$MyString’
I don’t realy use this feature some am not sure of the deeper aspects of this. But, using a Display Expression seems to be a workaround for having a displayed for the container the makes sense to the human user and without having to change its actual $Name title.
Thanks again. The Display Expression is quite nifty, at least for distinguishing between different watched folders. I suspect that the agent query (or at least the inside(…) function) still requires the actual $Name.
This one maybe still needs some mulling over.
I ask not to argue the point but simply as the above hopefully explain how the feature works—if not, I’m all ears! Point being, if not already expert in the feature, what do you need to know?