Page 1 of 1
[Solved] I want links to open in a program, not a browser
Posted: Tue Mar 20, 2012 5:33 pm
by patb
In an openoffice document, when I create a hyperlink to a PDF document and control-click on the link, the linked document opens in a browser (Google Chrome as it happens, even though Firefox is my system default browser).
What I want to happen is that the PDF document be opened by my system's default program for opening PDF files (which happens to be evince, others will have acroread). I don't want it opened via any browser.
Is there any way I can change this?
I have looked at
this thread which partly addresses my issue but I am using OOo on Linux (see my signature) so disabling ActiveX Control is not an option. Also, I am writing an openoffice document, not an html page.
Some more background: I am writing a presentation in OOo Impress and want to include a quick way to open and view related documents to which I am including links. Some of those linked documents are PDFs. For links to openoffice documents, they open in the relevant openoffice application, but .pdf files and also .txt files open in Google Chrome which is cumbersome. I cannot understand how or why Chrome is somehow associated with these file types when they are accessed via a link in an office document. I have found the same problem occurs in OOo Writer.
Any comments or suggestions most appreciated. Cheers, Pat.
Re: I want links to open in a program, not a browser
Posted: Tue Mar 20, 2012 10:27 pm
by RGB
I cannot reproduce your problem. On my system, if I click on a link to a pdf file on a Writer document the file is opened on Okular. But I do not have Chrome installed... it is possible the browser did something to your file associations.
Re: I want links to open in a program, not a browser
Posted: Wed Mar 21, 2012 9:06 am
by patb
Thanks for testing, RGB. I had checked that possibility. On my system Evince is the default program associated with PDF files - if I open them from a file manager like Nautilus or Thunar, they open in Evince. But in an openoffice document, if I click on a link to them, they open in Chrome, even if Chrome was not previously running. Thus, this problem seems to be that Openoffice sets its own file associations. What is sending a message to Chrome that it should start up and open the PDF document? I do not know how to configure or disable that file association.
To answer your question though, Chrome preferences tell me that "Google Chrome cannot determine or set the default browser." Firefox tells me that it is already the default browser.
Problem not yet solved. Any suggestions would be welcome. Cheers, Pat.
Re: I want links to open in a program, not a browser
Posted: Wed Mar 21, 2012 9:27 am
by RoryOF
When you insert the Hyperlink, have you selected Document from the four icons on the left? The default is to insert an Internet hyperlink to be opened by a browser, or by the helper application defined within the browser's preferences.
Re: I want links to open in a program, not a browser
Posted: Wed Mar 21, 2012 10:29 am
by patb
Yes thanks Rory. I have selected the "Document" button not "Internet" and then I have navigated to the target document. Cheers, Pat.
Re: I want links to open in a program, not a browser
Posted: Thu Mar 22, 2012 8:32 am
by patb
Well there's always more than one way to skin a cat as they say. I tried experimenting by uninstalling Google Chrome and hey presto, the links to PDFs then opened in... Opera! So I uninstalled that and hey presto, they opened in... SeaMonkey. (I have a lot of browsers for web site testing purposes). So I gave up on that line of enquiry.
But during the install of Chrome, there was reference to a file /usr/bin/x-www-browser which (on my system) is a symlink to /etc/alternatives/x-www-browser which is itself a symlink to /usr/bin/google-chrome. So I redirected the second link to /usr/bin/gnome-open which, for a Gnome desktop environment, is a program which will open any file using whatever is the system default program for that file type. That worked. Now, when I click on the link in an openoffice document, it opens in the system default program. [Edited Mar 24, 2012. Please note that I am not recommending this approach except for those comfortable with playing round with such files. It could lead to unexpected results in other programs. Also, I actually backed up the original link before redirecting it.]
I will mark this thread solved but with some trepidation. I suspect my little hack will fall apart next time I update a browser or something else - my edited link will probably be overwritten as the updated program is installed.
Problem kind of solved. I would still welcome further suggestions or comments on how to configure or disable openoffice's file associations for hyperlinks.
Cheers, Pat.
Re: I want links to open in a program, not a browser
Posted: Thu Mar 22, 2012 11:41 am
by kingfisher
I think that's a mistake. You have interfered with a system setting relating to the use of a web browser.
If you use Insert > Hyperlink, select the third option ('document') in the left panel and then the path to the file. The file will be opened by the default application for the file type. You have probably been using the first option which relates to the internet.
If you use the HYPERLINK function, insert the path to the file, e.g. =HYPERLINK("file:///data/sets/office/work/DataLog.ods";"Datalog")
Re: I want links to open in a program, not a browser
Posted: Thu Mar 22, 2012 1:17 pm
by patb
Thanks for the input, Kingfisher.
kingfisher wrote:I think that's a mistake. You have interfered with a system setting...
I've certainly reconfigured a system setting but given the name of the link "x-www-browser", and given the purpose of the directory "/etc/alternatives/" I suspect it will do no harm to redirect that link to gnome-open. Html files will now (on my system) open in Firefox rather than Chrome, and other file types which would have been directed to Chrome will be opened using my system default application, which is what I want.
kingfisher wrote:If you use Insert > Hyperlink, select the third option ('document') in the left panel and then the path to the file. The file will be opened by the default application for the file type. You have probably been using the first option which relates to the internet.
No, as mentioned above, I have been using the "Document" button. I have also tried five forward slashes in the path instead of three, as discussed in the link referenced above, to no avail.
For me, the question still remains how to configure or disable openoffice's file associations for hyperlinks.
Cheers, Pat.
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Mar 23, 2012 1:02 am
by kingfisher
Sorry, I didn't realise you had selected 'document'. AFAIK, OO gets file associations from the system. I have had no problem. When all else fails, the default solution is to rename your profile folder. You could try that. Make sure there are no OO or 'soffice' processes running beforehand.
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Mar 23, 2012 9:47 am
by patb
Thanks for the suggestions, Kingfisher.
kingfisher wrote:When all else fails, the default solution is to rename your profile folder.
Good suggestion. I tried that but it did not make any difference.
kingfisher wrote:AFAIK, OO gets file associations from the system.
That's what I would have thought too. But the core of the problem seems to be that it doesn't. It seems to use some other way of setting file associations for links, at least on my system.
RGB is running OO on openSUSE and cannot reproduce the problem, you are running it on PCLinuxOS and also cannot reproduce the problem. I am running it on Ubuntu 10.04 and my links to .pdf files open in Chrome.
Can I ask you to please post whether on your system you have any of the following four symlinks and where they point to:
/usr/bin/www-browser
/etc/alternatives/www-browser
/usr/bin/x-www-browser
/etc/alternatives/x-www-browser
I understand the directory /etc/alternatives/ may be peculiar to debian linux. Perhaps other distributions use a different approach.
Thanks in advance. Cheers, Pat.
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Mar 23, 2012 10:34 am
by RoryOF
patb wrote:Can I ask you to please post whether on your system you have any of the following four symlinks and where they point to:
1) /usr/bin/www-browser
2) /etc/alternatives/www-browser
3) /usr/bin/x-www-browser
4) /etc/alternatives/x-www-browser
On Ubuntu 11.04 (natty)
1) does not exist
2) does not exist
3) does not exist
4) links to /usr/bin/epihany-browser
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Mar 23, 2012 12:08 pm
by kingfisher
The directory /etc/alternatives/ is on my system but contains neither of the files/symlinks you mention. There is no file/symlink x-www-browser on my system. The file /usr/bin/www-browser is an executable script, not a symlink.
I don't remember how to set file associations on a Gnome desktop. On KDE there is a configuration tool and the file manager can also be used. I found a tip on
an Arch page. I imagine you have tried the Ubuntu forums.
This and
this are among Ubuntu links which turned up in a search.
I think you are on the wrong track. I searched in the program folder and found 5 files containing the word 'browser':
file:///opt/openoffice.org3/share/extensions/dict-en/en_GB.dic
file:///opt/openoffice.org3/share/extensions/dict-en/en_CA.dic
file:///opt/openoffice.org3/share/extensions/dict-en/th_en_US_v2.idx
file:///opt/openoffice.org3/share/extensions/dict-en/en_US.dic
file:///opt/openoffice.org3/share/extensions/dict-en/th_en_US_v2.dat
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Mar 23, 2012 6:03 pm
by acknak
I think you need to use the desktop settings application to change the config, but if you want to poke around in the files, you might try:
~/.config
~/.local/share
it might be easier to start out by creating a new user and trying your links while logged in as that user, with a fresh set of desktop and OOo settings. If it works there, then you know that it's something in your usual session environment that's causing the problem.
I keep a separate login just for that purpose. I regularly wipe it clean and start over, just so I know it has fresh settings that should not be causing any surprises.
Re: [Solved] I want links to open in a program, not a browse
Posted: Sat Mar 24, 2012 6:24 pm
by patb
Thanks Rory, Kingfisher and Acknak for the responses and tips.
Setting default file associations in a Gnome Desktop is easy using file managers like Nautilus or Thunar. That seems to have no effect on my problem.
acknak wrote:I think you need to use the desktop settings application to change the config, but if you want to poke around in the files, you might try:
~/.config
~/.local/share
Thanks for that suggestion. I didn't find anything interesting.
acknak wrote:it might be easier to start out by creating a new user ...
I did that - wiped the slate clean - and the links to PDFs still opened in Chrome.
kingfisher wrote:I think you are on the wrong track ...
I think you're right. I may somehow be following the wrong line of questioning.
I'm very grateful for all the feedback. For me at least, this is not a big problem. For the moment, I'll stick with "my little hack" as I called it, although I'm not recommending it except for those comfortable with playing around with such files. If I find any problems with my hack, or a more conventional solution to the problem, I'll post here.
Cheers, Pat.
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Feb 08, 2013 8:47 am
by Digger
I have a little more insight into this problem.
I've been having difficulties with this for quite some time now, as seen in:
http://forum.openoffice.org/en/forum/vi ... 11&t=56725
I am now running OO on two different computers. Both systems use Debian Squeeze. Both systems have Firefox as their sole browsers.
On one computer, I use the Debian amd64 repos. On the other, I use the Debian i386 repos. Both machines are using xfce for the desktop environment.
Now, here's the interesting point: The i386 machine displays the same problems that the OP is having (exept it opens the files in Firefox). The amd64 machine does NOT display this problem.
Thoughts?
Re: [Solved] I want links to open in a program, not a browse
Posted: Fri Feb 08, 2013 9:24 am
by Digger
I tried the OP's little hack, except I linked "/etc/alternatives/x-www-browser" to "/usr/bin/exo-open" (since I'm rocking xfce).
It works....for now.
I'm just waiting for something to explode......
Re: [Solved] I want links to open in a program, not a browse
Posted: Sat Feb 09, 2013 7:38 am
by Digger
I made a small tweak to the hack, playing the odds.....
I linked "usr/bin/x-www-browser" to "/usr/bin/exo-open" and I put the "/etc/alternatives/x-www-browser" link back to "/usr/bin/iceweasel" (which is the way it was originally).
The OpenOffice embedded links are still opening in the proper applications, vice the browser.
Thoughts?