PDA

View Full Version : How do I create a hyperlink


landon
2007-04-11, 07:20 AM
I cannot find anywhere in the manual or in the UI where I can create a hyperlink in the text of a row.

I'm looking at the Welcome.oo3 that pops up on the first launch of OO3 and it has several hyperlinks in it. One hyperlink is around text to the online user manual at OmniGroup and another hyperlink is around the web image on the bottom right of the Welcome.oo3.

I need to be able to embed both kinds of links but I don't see anything about that. I've searched for "hyperlink" in the OO3 user manual and it comes up dry.

Another oddity is if I export the Welcome page to HTML, the links come out fine in the HTML. But if I drag and drop a link from my Safari into OO3 content, if I'm in OO3 I can click the link and it jumps to the page, but if I export the content, the link is not exported - just plain text.

Anyway, what major inspector or feature am I not seeing that would let me embed a hyperlink in my OO3 page just like the Welcome page has?

DerekM
2007-04-11, 11:00 AM
It sounds like you have the auto attachment from typed URLs option turned off. Go to OmniOutliner -> Preferences -> General tab and check 'Automatically create attachments from typed URLs'. Let me know if that doesn't fix this.

landon
2007-04-13, 09:45 AM
Thanks a lot for the reply. Indeed the create attachments checkbox was unchecked. After I checked it I could drag the link into my content and it exported fine. So, that definitely solved one problem I was having.

I still could not figure out how to get an existing graphic to be hyperlinked. Similar to the welcome page of OO3, I want to click on the graphic and have it jump to a URL...exported as well.

Any further tips on that technique would be very much appreciated.

DerekM
2007-04-13, 01:23 PM
That's not possible unfortunately. The way links are handled handled right now doesn't allow an image to be a hyperlink. I do believe we have plans for this in OO4.

The welcome file simply has the attachment tags turned off so clicking on it brings up the attachment. It doesn't actually have a hyperlink associated with it.

derick
2008-01-08, 10:39 AM
Could I make a request? Please index this under "hyperlink" in the help files. I was struggling this morning trying to get OO to display the straight text of a hyperlink rather than the attachment. Why? Because nowhere in the help files does the term "hyperlink" appear. As a relatively new user who's not already keyed in to OmniOutliner's jargon, I see this -- in word processing terms -- as automatically formatting hyperlinks.

The learning curve for getting this program to format documents is higher than almost anything I can think of in nearly 30 years of using Apple computers & gaps in the help files don't make it any easier.

frankly
2009-07-22, 04:32 PM
Could I make a request? Please index this under "hyperlink" in the help files. I was struggling this morning trying to get OO to display the straight text of a hyperlink rather than the attachment. Why? Because nowhere in the help files does the term "hyperlink" appear. As a relatively new user who's not already keyed in to OmniOutliner's jargon, I see this -- in word processing terms -- as automatically formatting hyperlinks.

The learning curve for getting this program to format documents is higher than almost anything I can think of in nearly 30 years of using Apple computers & gaps in the help files don't make it any easier.

I just wanted to second this.

JimmyMcVideo
2010-04-18, 01:06 PM
Is it possible to highlight a piece of text and make it a hyperlink, like you can do in OSX MAIL?

Your ability to export an HTML unordered list is great but I need to export all the text as hyperlinks. And I'm not sure how to do that.

(I'm importing into a CSS program. )

Was there ever an answer to landon's question?

whpalmer4
2010-04-18, 04:01 PM
Yes, if you have your preferences set so that typing a URL does not make it into an attachment ("Automatically create attachment from typed URLs" in the General tab is unchecked), you can select a URL in the text, control-click on it, and choose "Make Link" from the resulting popup menu. You can also edit the link similarly. If you need to make a document that has both styles of URL, you just set the preference back and forth as needed while constructing it.

JimmyMcVideo
2010-04-19, 03:32 PM
Thanks for the info, but this isn't working for me.

It seems you can only create a link from a piece of text that's in URL format. That's frustrating and kind of ridiculous. I mean, when I think of creating a *link*, I think of attaching a URL to a piece of text. Am I missing something?

Look at this page. It's full of links but none of them are in URL format. And that's the case with most link content you find on the Web.

If OSX Mail can do this easily enough, I hope they can implement this function OO.

Sébastien
2010-10-29, 01:12 AM
Yes, if you have your preferences set so that typing a URL does not make it into an attachment ("Automatically create attachment from typed URLs" in the General tab is unchecked), you can select a URL in the text, control-click on it, and choose "Make Link" from the resulting popup menu. You can also edit the link similarly. If you need to make a document that has both styles of URL, you just set the preference back and forth as needed while constructing it.

When I type a URL that does not begin with "http://" (eg. papers://blahblah), it is not recognized as a URL.

However, when I select this kind of URL, I can transform it into a link, using "Make Link". But it forces me to use a mouse to do this.

Any idea to perform this action ? (Using an applescript maybe ? I have checked the applescript dictionary of OO, but i did not found the "link" keyword...)

RobTrew
2010-10-30, 12:17 PM
Any idea to perform this action ? (Using an applescript maybe ? I have checked the applescript dictionary of OO, but i did not found the "link" keyword...)

For fairly deep and intractable architectural reasons Applescript can not really manipulate RTF text. If it were something that I really needed to do, and performance were not an issue, I might explore something like:

Capturing the RTF data from the OO row by placing its text in the clipboard, and extracting the raw rtf data from there.
set dataRTF to the clipboard as «class RTF »
Writing the RTF data out to a file
Converting the RTF file to HTML with a textutil command line
Performing some string operations on the HTML to wrap potential links with <a HREF tags
Converting the HTML back to RTF, again with textutil
Capturing the TextEdit RTF version (now with clickable links) into the clipboard
Replacing the OO row contents with the clipboard contents.


Maybe the OO mouse operation doesn't seem so bad now :-)

--

RobTrew
2010-10-30, 12:36 PM
Or, I might process an .oo3 file directly:

gunzip the XML in the package (if necessary)
process the XML strings (regex ? XSLT transform ?)
rezip the XML (if necessary)

RobTrew
2010-10-31, 08:48 AM
when I select this kind of URL, I can transform it into a link, using "Make Link". But it forces me to use a mouse to do this

Not sure if others are seeing this, but if I make a link in this way, (Ctrl-click, Make Link) it works ...

BUT the link is lost if I save and close the document and then open it again ...

(Under Preferences > General > Attachments I have unchecked automatically create ...)

--

Sébastien
2010-11-01, 07:13 AM
Thank you so much for your answer, I have found a solution with your tips ;)

Crafting a RTF link and capturing it into the clipboard worked very well. I use the following script for this :

#! /bin/bash
echo "{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf32 0
{\fonttbl\f0\fswiss\fcharset0 Optima-Regular;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3 920\tx4480\tx5040\tx5600\tx6160\tx6720\fi560\sl288 \slmult1\sb160\ql\qnatural\pardirnatural
{\field{\*\fldinst{HYPERLINK \"$2\"}}{\fldrslt*
\f0\fs26 \cf0 $1}}}" | pbcopy -Prefer rtf


Let's say this script is named "make-rtf-link", I just call it like this :
make-rtf-link <the link I want to use> <title of the link>*

And then I obtain a RTF link in my clipboard, which can be pasted into OO.

WIN *\o/


"Maybe the OO mouse operation doesn't seem so bad now :-)"
Ha ha ! Well... I just feel really better when I don't have to use a mouse when I work ^^

RobTrew
2010-11-01, 10:07 AM
Good solution.

One could assign a keystroke to an analogous applescript.

A variant which uses HTML (for those of us who are not native RTF speakers):

set {strURL, strTitle} to {"", ""}

set strURL to text returned of (display dialog "Enter a URL:" default answer "http://" with title "Make Link")
set strTitle to text returned of (display dialog "Enter a title for the link:" default answer strURL with title "Make Link")

if (strURL is not "") and (strTitle is not "") then
set strHTML to quoted form of ("<font face=\"helvetica\"><a href=\"" & strURL & "\">" & strTitle & "</a></font>")
do shell script "echo " & strHTML & " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
end if

But, I am still finding that links made this way cease to work after the file has been saved, closed and reopened ...
(tho they work fine when first created)

(I have filed a bug under Help > Send Feedback ... )

--

Sébastien
2010-11-02, 03:11 AM
But, I am still finding that links made this way cease to work after the file has been saved, closed and reopened ...
(tho they work fine when first created)

With my script I have no problem of this kind.

RobTrew
2010-11-02, 03:41 AM
With my script I have no problem of this kind.

Interesting. On my system, all three approaches (Ctrl-click Make Link, your script and mine) all have this problem. (I think they are all doing the same thing).

After reopening the file, Ctrl-click Open URL still works, but mouse-over no longer causes a cursor change, and simple dbl-clicking no longer launches the link