Quote:
If I can create a shell script to start the program, can I (theoretically) set a variable to accomplish what I want for that session, assuming that I can discover the form/string that appears in the PDF link field?
|
I doubt it... at least, not in the way
I think you are looking at it.
I don't use Zotero, but based on the page you linked to, Zotero provides a plugin for Firefox. That means the "C:\data\file.pdf" path you are getting is likely embedded as part of a hyperlink. In other words, the page presents you with a link to click on that directs you to the desired PDF.
EDIT:
Your message said that you access it through the GUI used to create the database. I didn't see that on the brief scan of the web site that I made. As an alternative, you might try accessing it with their plugin through Firefox if option #4 seems promising to you.
/EDIT
Assuming that is true, I think you have four options:
1. Modify the plugin itself to convert the path for your particular workstation/computer. This isn't likely because I didn't see any indication that the plugin is open source.
2. Modify the web page that presents the link. I don't know if the web page is available to you or not. I don't know if it's a Zotero-supplied page or an internal web page developed by someone at your company/university/group. If it's a Zotero-supplied page, you probably can't change it here either. If it's an internally-developed web page, you can contact your internal IT staff to see if it's possible for them to do something like I mentioned earlier: change the page to identify what OS/browser you are using and adjust the link path accordingly.
3. Set up a proxy on the linux box. Essentially what happens is, you connect to the local linux box and make a request, the local linux box forwards your request to the server you would normally use, the linux box gets the HTML response, modifies the HTML code whenever it sees the "C:\data\" pattern in a link, and then presents it to your copy of Firefox. This is a very involved process. I would not recommend it except as a last resort--especially for something like this.
4. Search for and/or write a Firefox extension that will modify the links for you. I have seen Firefox plugins that alter the HTML code presented to the user. I do not remember one specifically matching your needs, but there may be one available. There may also be a way to do the substitution through Firefox preferences directly. You'll likely have to do some serious searching.
Lastly, if you haven't already done so, I would suggest posting a message in the
Zotero Forums. They would probably be more helpful in pointing you toward what you need.
EDIT2:
I did a little digging and found
this page on StackOverflow. It points out that the
Greasemonkey addon for Firefox can do HTML manipulation using Javascript. Furthermore, there is a collection of pre-written scripts available at
Userscripts. It may be worth a look to see if there are any scripts that might be close enough to what you want so that you can modify it easily.
EDIT3:
Last edit... I did a quick search for "modify link target" at userscripts, and found
this entry that looks spot-on for the kind of thing you need.