The selection is not a simple object, so it cannot have properties  
(this really is a weakness of AppleScript, one of many). To get the  
text for a selection you use the special command "get text for" rather  
than the "get" command.

Christiaan

On 4 Dec 2008, at 1:11 PM, Jan Erik Moström wrote:

> I'm trying to create an applescript that will take the current
> selection in skim and add it to some other app. My problem is that I
> can't figure out how to get the text:
>
> I've tried this
>
> on run
>       tell application "Skim"
>               tell document 1
>                       set d_url to path
>                       set d_page to index of current page as text
>                       set d_selection to selection
>                       set d_txt to item 1 of d_selection
>                       get the text of d_txt
>               end tell
>       end tell
> end run
>
> which gives an error message. Then I tried "get d_txt as text" => an
> another error, "get class of d_txt" gives the same error.
> Unfortunately I haven't been able to find an example of how to do
> this.
>
> Can anyone help me with this?
>
> -- 
> Jan Erik Moström, [EMAIL PROTECTED]


-------------------------------------------------------------------------
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

Reply via email to