├── Extract highlights to note with Skim and DT.scpt ├── Extract highlights to note with Skim.scpt ├── LICENSE ├── README.md └── Template deck for highlights extracted from PDFs.apkg /Extract highlights to note with Skim and DT.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanjamurphy/Create-flashcards-in-Anki-from-PDFs-using-Skim-and-DEVONthink-/c13c3b067a3330911700d441abb84111ae2bc35e/Extract highlights to note with Skim and DT.scpt -------------------------------------------------------------------------------- /Extract highlights to note with Skim.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanjamurphy/Create-flashcards-in-Anki-from-PDFs-using-Skim-and-DEVONthink-/c13c3b067a3330911700d441abb84111ae2bc35e/Extract highlights to note with Skim.scpt -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ryanjamurphy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create flashcards from PDF highlights using Skim (and DEVONthink) 2 | 3 | I created this script to help automate the creation of flash cards while I was studying for my PhD comprehensive exams. I'm happy to report that something must have worked, as I passed in May 2019. 4 | 5 | Two versions of the core script are included here. Both do the same basic thing: 6 | - Take a PDF 7 | - Scan the PDF for highlights 8 | - For each highlight found, import the highlight, its paragraph, and some metadata into an Anki flash card. 9 | 10 | The basic version simply uses PDFs found on your file system. The second version uses DEVONthink (described below) to provide a link directly to the page of the relevant PDF—useful when you're extracting highlights from a long article or even a textbook! 11 | 12 | ## Applications used 13 | 14 | The script uses three applications on macOS: 15 | 16 | - [Anki](https://apps.ankiweb.net) 17 | - Anki is a robust flashcard app. It allows you to create flash cards with any kind of content on them, and you can customize card and deck metadata and style to your tastes. 18 | - [Skim](https://skim-app.sourceforge.io) 19 | - Skim is a free, powerful PDF tool for macOS. It lets you do a lot more with your PDF files than conventional PDF apps. In this use case, it provides a scriptable interface for us to extract highlights and paragraphs from target PDFs in order to create flash cards. 20 | - [DEVONthink](https://devontechnologies.com) 21 | - DEVONthink is a database software that makes managing a lot of files, notes, annotations, and more easy. In this use case, I used DEVONthink to create links on each flash card I created directly to the page of the relevant PDF. 22 | 23 | ## How to use this script 24 | 25 | ### Install the apps 26 | First, install Anki and Skim—and DEVONthink if you want to use that version of the script. 27 | 28 | ### Download the scripts and template deck 29 | Download the files in this directory by clicking the green `Clone or download` button above, and then selecting `Download ZIP`. 30 | 31 | ### Install the Anki note type and card templates 32 | Open Anki. Click `File → Import`, and select `Template deck for highlights extracted from PDFs.apkg`. This will import a deck with one sample card to your Deck list. In addition, it will import the Note Type compatible with the extracted highlights and a styled flashcard that features the relevant components for each card. 33 | 34 | ### Run the script on a PDF with highlighted text 35 | Watch the magic happen. (If Anki isn't already open when you run the script, you may get a "Anki is not open"-type error, requiring you to run the script again.) 36 | 37 | Anki will prompt you with some settings on import. A few notes: 38 | - Make sure that the Type is `Article Highlights review` 39 | - You can import the highlights into the same deck or create a new deck. I recommend creating a new deck for each reading, just for organization's sake. 40 | - Make sure that the field separator is the "pipe" (`|`). 41 | - Field **1** should be mapped to **Paragraph**. 42 | - Field **2** should be mapped to **Highlight**. 43 | - Field **3** should be mapped to **Document info**. 44 | - Field **4** should be mapped to **File path**. 45 | 46 | You can close the PDF in Skim after it the import is completed. No need to save the file. 47 | 48 | ### Study up! 49 | That's it. Good luck and/or have fun! 50 | 51 | ## Misgivings 52 | ### Why didn't you use clozes? 53 | When I created this script, I was new to Anki. If you're not new, you'll know that Anki has a built-in Cloze functionality. I didn't realize this when I created this script, and I used `` HTML to indicate extracted highlights instead. I regret the error, as the Cloze feature works better than my brute-force approach. Maybe I'll fix this in the future—or let me know if you get to it first! 54 | 55 | ### Isn't automatic flashcard creation a poor approach to studying? 56 | It's true. The best way to learn using flash cards probably involves the following steps: 57 | 1. Carefully read the text. 58 | 2. Select the important concepts in the text. 59 | 3. Identify a variety of questions and answers about those concepts. 60 | 4. Write up each of those questions and answers. 61 | 62 | That's right—the approach above doesn't even necessarily involve flash cards. Deep reading and self-directed inquiry about whatever you're learning is really what's important. Flash cards simply help reinforce your memory on whatever concepts you represent in them. 63 | 64 | As my studies progressed I found myself manually creating flash cards more often than I automatically generated them using this tool. Still, there's something nice about making something useful from all those highlights. If you're new to flash cards, this might be a nice way to generate a bunch from something you've read. As you study the auto-generated cards, I advise you to re-create them, maybe creating multiple for each card. This way you get the best of both worlds. 65 | -------------------------------------------------------------------------------- /Template deck for highlights extracted from PDFs.apkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanjamurphy/Create-flashcards-in-Anki-from-PDFs-using-Skim-and-DEVONthink-/c13c3b067a3330911700d441abb84111ae2bc35e/Template deck for highlights extracted from PDFs.apkg --------------------------------------------------------------------------------