A quite useful feature of Skim is that “you can take “snapshots” of important sections (like the bibliography section) of a PDF document, to keep them on your screen for easy reference. This way you don’t have to leaf back to the section every time you want to see it” (Skim help file).But the snapshot windows are just for viewing the material. For example, you cannot highlight or select text in them. In order to make annotating of these pages easier I wrote an AppleScript, which instantly shows you in the main window, the current page in the snapshot window. When you finish annotating this page you can go back to the previous page by using the cmd + [ shortkey or by triggering the corresponding gesture (I use the "three finger left" gesture for this task).If you use more than one snapshot windows from the same document, after selecting the page that you want to annotate in one of them, you need to click one time all the remaining snapshots windows, before running the AppleScript.
The AppleScript code is the following:
--2011-05-20
--http://organognosi.blogspot.com
set nameSnapshot to ""
tell application "Skim"
set frontNameDocument to name of document 1
set windowsNames to get the name of windows
repeat with x from 1 to count of items of windowsNames
set windowName to item x of windowsNames
if windowName contains frontNameDocument & " —" then
set nameSnapshot to windowName
end if
end repeat
set position to offset of "—" in nameSnapshot
set AppleScript's text item delimiters to ""
set stg_numberPage to characters (position + 7) thru -1 of nameSnapshot as text
set numberPage to stg_numberPage as number
go document 1 to page numberPage of document 1
end tell
Thanks a lot for providing this script. It is a great workaround for the inconvenience in Skim, that you can not select text in the snapshot window.
When dealing with multiple snapshot windows, clicking all windows first is a little bit clunky, but still way better then not being able to switch back and forth. Wonder whether someone could optimize the script.
It works great in combination with “BetterTouchTool”, which lets you assign global and app specific gestures. I have set it to:
Four finger tap: run script
Custom four finger action to switch back: touching the trackpad with your little finger first, then with the ring finger and so forth, which triggers keyboard shortcut CMD + [
Quite funny…