Skim and color codes of highlights

In my post “Export Skim notes according to their highlight colors” I presented how you can export Skim notes of a specific color using an appropriate AppleScript. The proper functioning of the script is depended on the correct representation of the color that is used in the highlights. In Skim’s wiki you can read that “colors are represented according to the RGBA (Red-Green-Blue-Alpha) model as a list of four integers, each one ranging from 0 to 65535 (= 216 – 1). For example, {65535, 0, 0, 65535} represents the color red”.

Some people have asked me how they can get these numbers for an arbitrary color. The solution to this problem can be given again by AppleScript and the following script:

The outcome of this script is a window in which the color codes of the current PDF page in Skim are shown.

A non programming solution to the same problem is given by the excellent app ScriptDebugger. Specifically, one of its most powerful tools is the “Explorer” with which you can see in real time all the objects of an AppleScriptable application together with their properties and values. In our case, you can see in the following screenshot the color code of the first note.

Leave a Reply