The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Links within a document Thread Tools Search this Thread Display Modes
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...

Last edited by Jacob; 2006-05-21 at 09:47 AM..
 
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
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal Document Links celsee OmniOutliner 3 for Mac 2 2013-05-07 06:58 PM
iCloud document file links in OmniFocus notes? LLBean OmniFocus 1 for Mac 0 2012-09-20 02:43 PM
"Unable to lock document. Another application had the OmniFocus document locked." drumshanbo OmniFocus 1 for Mac 7 2008-09-18 09:31 AM
Losing links within document after 4.2.1 upgrade haighp OmniGraffle General 0 2007-09-04 10:05 AM


All times are GMT -8. The time now is 01:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.