Can a Smart Rule highlight text?

It would be very useful if I could set a smart rule to find files containing specific words and highlight those words.

Is this possible?

Umm…

:stuck_out_tongue:

Yes I know it can do that temporarily on the current document

Can a SmartRule create highlights as a permanent annotation Ie so I can have a set of documents with key words permanently highlighted automatically

No. That is not possible.

It shouldn’t be difficult to script, though. I haven’t looked, but I’m guessing highlighting is an action available in DT3’s scripting dictionary/library (Or whatever). Else an app like Skim would certainly be capable of it.

Nope. Highlighting content is not part of the AppleScript dictionary.

1 Like

Nbd. I will point the OP to Skim, then! You could use a Smart Rule to trigger a run of a script that invoked Skim to highlight the text you’re looking for.

Thanks - I do not see “highlight” or “annotate” in the Skim Applescript directory.

But they are present in the Adobe Acrobat Applescript directory so that may be an option - I will look into that.

Look at the Skim wiki - https://sourceforge.net/p/skim-app/wiki/AppleScript/ & the examples there.

I’m not at my computer but it can definitely be done - I have written a script to pull highlight info out of MaxQDA’s closed annotation format by reading the SQLite and then recreating all the annotations in Skim.

1 Like

Interesting - the Wiki does include a “highlight note” command. This is not in the Applescript dictionary however.

Shouldn’t the Applescript dictionary be complete/definitive?

the Wiki does include a “highlight note” command.

What are you referring to?

Shouldn’t the Applescript dictionary be complete/definitive?

Considering it’s generated by human beings, this is not always possible,

highlight note is one of the note types you can create with the make note command, as far as I understand. I see where you read that in the wiki, but I don’t think it’s meant to be a command, but a property of the make note command.

1 Like

So highlighting specific words as permanent annotations is not scriptable in Skim?

So you are referring to Skim’s documentation, I see.
I had no idea what you were referrring to for a second. :slight_smile:

I don’t think I follow, sorry. A Skim highlight note is a highlight by conventional PDF standards, if I recall correctly. I’m not an expert on this stuff, though, so I would look for examiner of this elsewhere on the internet to see exactly how it’s done!

For context, I once used DT and Skim to auto-create flash cards based on highlights I had made in readings. So I know this stuff is possible, I just haven’t worked with it in a while.

Unless Skim changed something, their annotations are stored in the extended attributes of files and can be also saved as a type of sidecar file.

Looks like they still follow that method.

It’s true. There might be a bit of song-and-dance required to save the highlights down to the actual PDF because of this. But, as far as I know, Skim’s scriptability is unparalleled.

That said, PDF Pen might be another app to try, @rkaplan.

Thanks - PDF Pen is only for iOS, not MacOS

Looks like Adobe Acrobat may be the most realistic choice

Not so! https://smilesoftware.com/pdfpen/

It looks like it does support AppleScript, too: https://smilesoftware.com/pdfpen/entry/getting-more-out-of-your-pdfs-with-pdfpen-automation/

I have no experience with either this or Acrobat, though, so whatever works, works!