From: Jan J. B. <jjb...@gm...> - 2014-12-07 17:13:29
|
On 7 Dec, 2014, at 14:22, Hans LIST <han...@gm...> wrote: > > Hello, > > I'd like to create a simple script to find the text that is copied to the Clipboard in a PDF that is opened in Skim. > > This is my attempt, but it doesn't work: > > tell application "Skim" > set FindText to (the clipboard as text) > > tell document 1 > find text clipboard > end tell > end tell > > Thanks, > > Hans This works in principle: tell application "Skim" set FindText to (the clipboard as text) tell document 1 find text FindText end tell end tell (I verified the syntax by looking at Skim’s AppleScript dictionary). It seems to return the matching characters of the first match in the document. So for instance it returns: characters 172 thru 174 of text of page 1 of document "Gretton1996.pdf” If you want to go to the match you can do tell application "Skim" set FindText to (the clipboard as text) tell document 1 set theFoundText to find text FindText go to theFoundText end tell end tell Cheers, Jan Jakob |