Hi,

I’m new to Skim and I play around trying to add highlights (note type = 
highlight note) with AppleScript.

I got a position and page from a Kindle export of the highlights made there 
(position = a location comprises around 125 characters, spacing included, or 23 
words). The kindle export looks like:

<div class="noteHeading">
    Highlight(<span class="highlight_yellow">yellow</span>) - page 10 · 
Position 124
</div>
<div class="noteText">
    Überseeische Siedlungskolonisation.
</div>

So first thing I tried:

set theText to "Überseeische Siedlungskolonisation."
set kindleLocation to 124
set startOfLocation to (kindleLocation * 125)
set endOfLocation to startOfLocation + (length of theText)
set aSelection to {a reference to characters startOfLocation thru endOfLocation 
of text of document 1}
set theSel to find text theText from aSelection

worked sometimes. But the position value I got from the Kindle seems to be 
calculated in a way I can’t predict. So I tried the page value.

set aSelection to {a reference to text of page kindlePage of document 1}

now aSeletion contains "every text of page 8 of document 1“. The result of the 
find returns "characters 34 thru 47 of text of page 9 of document 
„mydemopdf“"???

Why does the find return something located out of the selection? Any idea how 
to use the values of the kindle export in Skim?

Thanks a lot,

Detlef




_______________________________________________
Skim-app-users mailing list
Skim-app-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to