Links within a document
Something like OmniGraffle's "Jump Elsewhere" functionality would be really great.
After a day spent learning Applescript, I've come up with a pair of scripts that will (I hope) be good enough for what I need -- one for copying the id of the target row into the note field of the source row, and one to read the note field of the source row, hoist the target's parent, and select the target. Still, there ought to be a more elegant way... |
Agreed! I could find so many uses for that...
|
I absolutely agree. I've hunted through the docs trying to find this a few times now...
|
Well, I'm posting what I've come up with: maybe someone can offer improvements. It allows for linking both within and between outlines.
I wrote two scripts, named them "COPY ID" and "GOTO", and added them as buttons to the toolbar. The first one copies the document's path and the selected row's id into the clipboard, with a vertical stroke between them. So something like this ends up in the clipboard: /Users/Me/Documents/Philosophy/ARISTOTLE PASSAGES.oo3|ez4aMqLfsa3 I run the first script on the row I want to link TO. Then I go into the note field of the row I want to link FROM, and paste. The other script is for following the link. It parses the string in the note field of the selected row, putting the path name into one variable and the row id into another. (It has to change every forward slash into a colon in the path name, cos that's how Applescript understands paths.) Then it tells OO to open the file with the specified path, hoist the parent of the row with the specified id, and select the row. The system seems to be working so far. The disadvantages I've noticed are that you have to devote your note fields to the links, you can only have one link per row (on the FROM side), and the links will break if you move your files. FIRST SCRIPT: tell front document of application "OmniOutliner Professional" if item 1 of selected rows exists then set origin to item 1 of selected rows set noteText to (path of document of origin) & "|" & (id of origin) set the clipboard to noteText end if end tell SECOND SCRIPT tell front document of application "OmniOutliner Professional" if item 1 of selected rows exists then set NoteLink to note of item 1 of selected rows set NoteLetters to text items of NoteLink set PathScanned to false set TargetDoc to "" set targetrow to "" repeat with ReadChar in NoteLetters if ReadChar as string is "|" then set PathScanned to true else if PathScanned is false then if ReadChar as string is "/" then set TargetDoc to TargetDoc & ":" else set TargetDoc to TargetDoc & ReadChar end if else set targetrow to targetrow & ReadChar end if end if end repeat end if open TargetDoc if row id targetrow exists then hoist parent of row id targetrow select row id targetrow end if end tell |
All times are GMT -8. The time now is 10:45 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.