On 20 Nov 2008, at 4:08 PM, Konrad Hofbauer wrote:
> Christiaan Hofman wrote:
>> *tell* document 1 *of* application "Skim"
>> *set* theSel *to* *get* selection
>> *if* theSel *is* *not* {} *then*
>> *set* thePage *to* (*get* item 1 *of* (get pages for theSel))
>> *set* theIndex *to* (get index for theSel)
>> *set* theFont *to* font *of* character theIndex *of* thePage
>> *set* theSize *to* size *of* character theIndex *of* thePage
>> display dialog "Font for selection: " & theFont & space & theSize &
>> "pt"
>> *end* *if*
>> *end* *tell*
>
> This works beautifully, thank you so much! Should go onto the wiki.
> (It's simple to then call the script with Quicksilver, or
> whatever ...)
>
> I see in the AppleScript dictionary, that font, size, and color is all
> that is available, but for example not font shape, right?
The shape is part of the font name (or should be).
>
> What I also find interesting is that it returns (for example)
> "Helvetica" for what is in the PDF really LMSans10-Bold (set in pdftex
> and according to Acrobat). Seems like PDFkit is substituting fonts
> here ...
>
> /Konrad
I think this is rather because PDFKit looses the real font information
when it converts to attributed strings, so you'll always get Helvetica.
Christiaan
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users