Jump to content

Skimmer: PDF actions for Skim


Recommended Posts

  • 2 years later...

Hey, I have just discovered your Skimmer workflow and I am really impressed. This is a game changer for my graduate studies.

 

Quick question: is it theoretically possible to modify the script to group all the highlights of the same color/category (e.g. "Reference") together, even if there are other colors/category between them? For me, having the notes in the order they appear in the document is not as important as having them all grouped by categories. 

 

Would really appreciate anyone's input on this! Thx!

Link to comment

Just FYI the original dev has left academia and hasn't been updating the workflow for a couple years.  I've stopped using the scripts here and replaced them with an export script that uses Skim's built-in templating to accomplish much the same thing, in much more parsimonious and less breakable code.

 

 

Link to comment
12 hours ago, dfay said:

Just FYI the original dev has left academia and hasn't been updating the workflow for a couple years.  I've stopped using the scripts here and replaced them with an export script that uses Skim's built-in templating to accomplish much the same thing, in much more parsimonious and less breakable code.

 

 

 

Thanks a lot for your response dfay. I did write the original dev and he suggested asking for help in this forum. 

 

Do you mind sharing your export script and a brief explanation of your academic/Skim workflows?

 

Do you think said Skim's built-in templating would allow me to group all the highlights of the same color together, even if there are other colors/category between them (regardless of their order)? 

 

Thx!

 

 

Link to comment

I built all my tools off an early manifestation of smargh's work and never updated it to Skimmer b/c the system I had was working well enough.  

I don't use the semantic color-coding of notes that's in the Skimmer workflow.

 

The export script is here: 

 

https://gist.github.com/derickfay/e357c148c257618548a41389ef87b7ad

 

It relies on having the top three notes created with smargh's script here:

 

https://gist.github.com/fractaledmind/6068092

which I call from an Alfred workflow using keyword sk3 - the script above will call Alfred if it doesn't find it.


I just export to clipboard and paste into Ulysses.  I don't use the specific page linking functionality though it should be easy enough to turn it back on by editing the script and adding back in the randomize_id function, which you can probably find in smargh's repo above -- I deleted it when I wasn't using it.  

 

Let me take a look at grouping by colour.  Shouldn't be hard.

 

Update:

 

here's a version that will group by colour:

 

https://gist.github.com/derickfay/25b3de3fb18e0d7fa8ca157e3c0bfeb5

Edited by dfay
Link to comment
On 2/9/2019 at 6:00 AM, dfay said:

I built all my tools off an early manifestation of smargh's work and never updated it to Skimmer b/c the system I had was working well enough.  

I don't use the semantic color-coding of notes that's in the Skimmer workflow.

 

The export script is here: 

 

https://gist.github.com/derickfay/e357c148c257618548a41389ef87b7ad

 

It relies on having the top three notes created with smargh's script here:

 

https://gist.github.com/fractaledmind/6068092

which I call from an Alfred workflow using keyword sk3 - the script above will call Alfred if it doesn't find it.


I just export to clipboard and paste into Ulysses.  I don't use the specific page linking functionality though it should be easy enough to turn it back on by editing the script and adding back in the randomize_id function, which you can probably find in smargh's repo above -- I deleted it when I wasn't using it.  

 

Let me take a look at grouping by colour.  Shouldn't be hard.

 

Update:

 

here's a version that will group by colour:

 

https://gist.github.com/derickfay/25b3de3fb18e0d7fa8ca157e3c0bfeb5

 

This is great! I can't thank you enough :D

 

I am starting to wrap my head around AppleScript. Any recommended resources for someone without a CS background? 

 

Thanks again!

Link to comment
  • 4 weeks later...
  • 1 year later...

Thank you for the working script for exporting to markdown, @dfay.

 

I'm wondering how difficult it would be to change this script for my own workflow. My goal is the following: 

  1. Export into separate markdown files for each annotation. Ideally, these would be named automatically, for e.g., using the first 5 words of the contents, and placed in a folder named by the pdf name. 
  2. Include the name of the colour of the highlight from Skim in each file (so it can be used to filter/process them). Edit: ✓ I couldn't figure out how to capture and name colours, but, I've managed the important part of indicating the colour of the highlight. As a plus, it should work with any used colour, not just set values. 
  3. Include the link back to the PDF in each file. I know it was mentioned that this could be done by adding back in that functionality, but I could not figure this out. This one is just a perk though. Edit: ✓

Essentially, I am in this situation because my original workflow relied on a script that did exactly this. It would take a Skim pdf, export all annotations as separate files to DevonThink (but to .rtf, not markdown). I cannot find it anywhere - all links to it are broken (e.g. https://wippp.com/home/writing-workflows-processing-annotations-all-roads-lead-to-skim). My workflow was based around the idea the zettelkasten information management - so preparing little chunks of information that can be further processed and filtered and summarized, etc. 

 

From what I can tell, this could potentially be accomplished in two ways: (1) starting with this script for exporting to markdown, but instead parsing the clipboard to create different files and adding colour information (2) using a Skim export template, which can apparently identify colour (https://sourceforge.net/p/skim-app/feature-requests/1417/) and include a link to specific annotations in the pdf (https://sourceforge.net/p/skim-app/feature-requests/1520/). I found a template that exports to markdown (https://github.com/semicolonsnet/skim-templates), but I'm really new to this and couldn't get it to function. It's not clear to me whether separate files can be created.

 

For those of you who are experts in coding - would you be familiar enough with this to know which approach (applescript or template) I should attempt? And how future-proof would it be? I'm kicking myself for getting used to this workflow. Once it broke, I procrastinated on trying to fix it and now I have a bunch of read pdf's that are just stuck. I'm not sure if I should give up on this entirely and just figure out a new academic workflow.

 

I'm definitely not expecting or asking anyone to do this for me. I'm just hoping that someone might have an opinion on which approach would be more sustainable and a worthwhile use of my time to pursue. Or if there's another simpler approach that would work best. I've also found that it is surprisingly difficult to try to change my method of reading/highlighting, so I'm open to hearing about other people's academic workflows!

 

Thank you for reading!

 

Katie

 

Edit: I forgot to mention that I found a similar script (https://github.com/achamess/skim_to_md_script) but it relies on the user having Papers3.app and I use BibDesk.  

 

Update (2021-01-09): You can add a link back to the specific page in Skim, by adding the following in the appropriate sections of the script: 

set tURL to "<$skimURL?><$skimURL/></$skimURL?>" -- not sure if only the middle tag is necessary but it works like this

set skimURL to format n using template tURL -- convert template text to actual url 

-- Then add " [" & correctedPage & "](" & skimURL & ")" to format as a markdown link under each type of supported highlight

 

Update (2021-03-06 ): You can add the colour of the highlight, by adding the following in the appropriate sections of the script: 

set tColour to "<$color.hexString?><$color.hexString/></$color.hexString?>"

-- then add this to the export part:
set noteString to noteString & "> " & "<mark style=\"background-color: " & noteColour & "\">" & formattedNote & "</mark>" & " (p. [" & correctedPage & "](" & skimURL & "))" & LF & LF

 

Edited by katie
Link to comment

That script was by automation legend Rob Trew - he's still active on the DT forums as houthakker and on GIthub here: https://github.com/RobTrew/tree-tools and/or @complexpoint on Twitter.

 

But I can also take a look in the next few days at what you're trying to do - I also use BibDesk.  BD & Skim & DT allow for more through automation than any other combo. of apps. I can think of, so it's well worth learning AppleScript if you're going to work with that combo.  (In fact I don't use TeX at all but I use BibDesk just because of its scriptability...).

 

 

Edited by dfay
Link to comment

Wow, thank you. I can't believe you found it! I will start looking through Rob Trew's posts on all of those platforms.  

 

Thank you, also, for the advice. I will pursue the AppleScript path. In fact, I think I should regardless of whether I find a working script for this so that I won't be so stuck again in the future if something breaks. I don't use TeX at all, either. I just love how quick, accessible, and open BibDesk is. My goal is to move everything to plain text, stored in my university-provided cloud, and indexed/processed in DT. I couldn't find a suitable alternative for DT; it's just so good at what it does. At least it's easy to keep your files where they are or get them out, if necessary. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...