Discussion:
[Skim-app-users] AppleScript: ``Go to named note''?
Andreas Koch
2016-03-14 18:43:15 UTC
Permalink
Hello all,

is it possible to use Skim's AppleScript interface to display the document
location showing a named Note?

Example:

- I have underlined the text `A6 STORAGE'. It now shows up in the Notes list
and I can jump directly to that text location by clicking the `A6 STORAGE'
item in the list.

- Can I use AppleScript to automate this, also by referencing the Note name?
Something similar to

tell document "specification-5822.pdf" of application "Skim"
to go to note "A6 STORAGE"

I understand that for this to work, the Note name would need to be unique, but
that is the case in my usage scenario.

Grateful for any hints,
Andreas
Christiaan Hofman
2016-03-14 19:49:08 UTC
Permalink
Post by Andreas Koch
Hello all,
is it possible to use Skim's AppleScript interface to display the document
location showing a named Note?
- I have underlined the text `A6 STORAGE'. It now shows up in the Notes list
and I can jump directly to that text location by clicking the `A6 STORAGE'
item in the list.
- Can I use AppleScript to automate this, also by referencing the Note name?
Something similar to
tell document "specification-5822.pdf" of application "Skim"
to go to note "A6 STORAGE"
I understand that for this to work, the Note name would need to be unique, but
that is the case in my usage scenario.
Grateful for any hints,
Andreas
You can use AppleScript filter clauses like “whose” and “where”. In this case, “notes where its text is 
”. Somehow “notes whose text is 
”, which should be equivalent, does not work for this particular property, because AppleScript is far too strict and confused (as usual). Note that this gives a list, so you should get the first item. You can also use “first note
” or something like that, but that fails when the note does not exists.

Christiaan

Loading...