DEVONthink as a chess notebook with a PGN viewer?

Hi,

I would like to create a digital notebook to help me remember important chess lessons. Those lessons would usually be my text notes accompanied by chess board notation (PGN). Sometimes, they would be just my text notes. Here is an example of chess board notation:


[Event “American Open 1991”]
[Site “?”]
[Date “???.??.??”]
[Round “?”]
[White “Tal Shaked”]
[Black “Silman”]
[Result “0-1”]
[SetUp “1”]
[FEN “2r5/1k2p2p/1ppp1p2/5Pp1/4P1P1/1PK4P/1PP5/R7 b - - 0 34”]
[WhiteElo “”]
[BlackElo “”]
[ECO “”]
[CurrentPosition “8/4k3/1pppPp2/6p1/1P2P1P1/2K3R1/1PP4r/8 w - - 1 42”]

34…h5! { This forces a file open which will be owned by Black’s rook. If your piece(s) are inactive, find a way to get them into the game. However, what if White tries } ( 34…Rh8? { That, as the question mark shows, in an error: } 35.h4 h5 ( 35…gxh4 36.Rh1 { and White’s doing fine. } ) 36.hxg5 fxg5 37.gxh5 Rxh5 38.Rg1 { , =. } ) 35.Rg1 ( 35.Rh1 Rh8 ) ( 35.h4? gxh4 36.gxh5 Rh8 { and Black’s winning. } ) 35…hxg4 36.hxg4 Rh8 37.Rg3 Rh2 { Black intends to improve everything he has: His rook is on the 2nd rank tying does White’s queen to protect his c2-pawn, check! Black’s king will move to the center (a dream is …Kc7, …d5, …Kd6, and …Ke5), check! Once he gets his king to e5 (and perhaps later …Kf4) White’s g4-pawn (or White’s e-pawn) will fall and the game will be over. Simply put, Black placed his king, rook, and pawns on their ideal squares. } 38.Kd3 Kc7 39.Kc3 e5! 40.fxe6 Kd8 41.b4 Ke7 { and Black’s winning since White’s king is busy protecting c2, his rook is protecting g4, and after Black captures on e6 and then moves his king to e5, the e4-pawn will also be in trouble. Black eventually won the game. } 0-1


Annotations are embedded in the PGN here. They will usually come from other people. I might annotations myself. And I will probably write notes for myself outside the PGN.

To use these notes best, they have to be put into a chess viewer that shows the positions of the pieces on a chess board. Chess is, after all, a visual game.

My question is: Can I create a chess notebook in DEVONthink Personal that provides an easy way to view chess positions?

Options:

  1. Copy and paste the PGN into a chess viewer that I have on my computer. Simple, but inefficient. I would much rather have the viewer right next to my notes and not have to copy and paste into a separate program, especially when I am using DEVONthink to Go. (Dragging and dropping the text does not work with my viewer.)

  2. Send the FEN/PGN automatically to my locally installed chess viewer. (My viewer does not have a macOS service or an OS-level share option.)

  3. Embed a viewer in DEVONthink Personal. Caissa.com, for example, provides HTML code that allows their viewer to be embedded in other people’s websites. Maybe I’m missing something obvious, but I don’t see how I can create an HTML file in DEVONthink and then render it in DEVONthink. Is it possible?

#2 would be often be best because my viewer has an engine that I can use to analyze the position and not just view the position after each move. But it would sometimes be more than what I need. #3 would often suffice.

Is #2 possible? How?

Is #3 possible? How?

Are there other options?

The idea of a chess notebook seems so obvious to me that I expected to find commercial products, but I have not found any. Can DEVONthink Personal do what I need? Can DEVONthink to Go do what I need?

Many thanks for any help!

Rick

Does your locally-installed viewer read FEN/PGN data from text files – e.g., is there an “Open” command in the viewer software to open a file located in a folder in the file system?

If so, then you could keep your PGN files in such a folder, index (and edit) it in DEVONthink and access it as I mentioned in the viewer. Files in an indexed folder can be available to both applications.

You would need to become familiar with indexing – check the manual and read Greg_Jones’ postings in the forum giving advice on indexing. Also learn about the Move External / Move into Database commands. None of this is complicated – you just want to be informed about using indexing.

Many thanks for your quick response.

Yes, game files can be opened in the usual way. I see some value in indexing, especially because it makes editing the files very convenient, so I’m starting to do that with my project now. Thanks for the idea.

I would like to go beyond indexing. For example, I have notes on something called the Lucena position. I also have a game file that demonstrates tactics in the Lucena position (and I may add other files relating to the Lucena position later). My main goal here is to combine the two so that my use of them is as efficient as possible. Is there a way to combine my notes with an indexed file or files and not have notes in one location and the game files in another?

One way would be to put the item link in my notes. But I just found that that approach does not work well because it places the text from the indexed file into the pane that my notes were in. What I need it to do is open the indexed file in an external application. I suspect that a different application that supports the use of attachments such as OmniOutliner would work better with this approach. Even Apple’s Notes would seem to combine my notes and a link to a file better.

Or am I missing something? Is there a better way to combine my notes with quick access to one or more game files?

Or to embed a viewer directly in DEVONthink?

Thanks!

Rick

The DEVONthink item link will merely open the document in DEVONthink, as you noticed.

Your notes (I assume they are RTF notes) need to contain links to the file itself in the indexed folder. Such as


file:///Users/Me/Desktop/Lucena.pgn

If you place an URL like that in the RTF file, and if macOS knows that .pgn files open in your emulator, then clicking the link in your DEVONthink note file will open the linked-to document in your emulator.

To put a file URL into your RTF, drag the file from Finder to your note while pressing option+command (⌥⌘) – this will place a file URL into the body of the text.

Note – these URLs will NOT work on DEVONthink to Go because they link to a location on your Mac, not to a location on your iPad. You cannot make a file URL on one machine that will work on another, sorry.

Beautiful. Works great. Thank you.

In case this information helps someone else:

Option #3 in my original post is actually easy to set up and it works well. Just paste the Caissa HTML code into the source of an HTML document in DEVONthink. In settings, enable JavaScript and turn on “Display images when the page opens”.

You might have to delete some unnecessary HTML code.

Then, for each game that you want to view within a DEVONthink document, paste the pgn text into the HTML source code in the right location.

While viewing the source, you can enter comments on the game. When viewing the preview, everything looks and works well.

There are other places to get HTML code for embedded pgn viewers, but their installation is more complex than it is with Caissa.

Rick

I can recommend HIARCS Chess Explorer as an excellent chess database for the Mac.

A screenshot or an example HTML file would be great, thank you!

1 Like