On Jun 18, 2010, at 11:11 AM, Christiaan Hofman wrote:

> I don't know py-appscript, but you can get the text for the selection easily 
> using the applescript "get text for" command, I think that becomes 
> get_text_for in py_appscript.

This gets back to my original observation of "defects" in PDFKit

I'll say I'm not very confident about what I'm doing here, but if I say:

> tell application "Skim"
>   get text for selection of note 1 of document 1
> end tell


I get the error: "Skim got an error: selection of note 1 of document 1 doesn’t 
understand the get text for message."

This makes sense because (in my case) selection is a list of 15 character 
ranges.

If I say:

> get text for item 1 of selection of note 1 of document 1


I get back the word "dle2". "dle2" isn't found in the text of my selection.

If I do this for each item individually, all 15 return "dle2".

If I say:

> set theSel to selection of note 1 of document 1
> repeat with i in theSel
>   get text for i
> end repeat

I get the error: "Skim got an error: Invalid range."

py-appscript also produces an error on the character range. I'm not able to 
decipher the details, but looking at what it produces for a range suggests it's 
returning two character references instead of a numeric like "1102:1147". This 
is why I converted the returned reference to a string and did some regex 
fiddling to get valid reference in my script.

But as I said, I could be missing something really simple here.

Thanks, Charles




------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to