View Full Version : hyperlinks with command line options support
quant
10-30-2007, 07:50 AM
Do UR hyperlinks support command line options?
FoxitReader supports command line arguments so that I can choose at which page it will open the file. This is great for making notes from files:
foxitreader.exe filename.pdf -n pagenumber
I tried to add "-n 8" to hyperlink, so that it reads in UR
File/UR: D:\documents\samplefile.pdf -n 8
but it does not work. It passes probably the whole string as a filename.
Could you please add support for adding parameters to hyperlinks? Should be straightforward :) Thanks a lot!
quant
10-30-2007, 08:09 AM
In case you decide you implement it, please note that for example to view djvu files at certain pane, the format is
windjview.exe filename.djvu#pagenumber
but it should still be straigforward to parse the hyperlink into filename and parameters. Thank you!
kinook
10-30-2007, 08:10 AM
The best thing would be for FoxitReader to do what UR does: support a URL protocol (a URL format for command-line launching, ala ur://C:/Documents%20and%20Settings/user/My%20Documents/My%20Stuff.urd?item=1000). Should be straightforward :^).
Alternatively, create a Windows shortcut with the target + command-line parameters, and hyperlink to the shortcut file in UR.
http://vlaurie.com/computers2/Articles/shortcuts1.htm
http://www.google.com/search?q=how+to+create+windows+shortcut
quant
10-30-2007, 08:46 AM
Originally posted by kinook
The best thing would be for FoxitReader to do what UR does: support a URL protocol (a URL format for command-line launching, ala ur://C:/Documents%20and%20Settings/user/My%20Documents/My%20Stuff.urd?item=1000). Should be straightforward :^).
Alternatively, create a Windows shortcut with the target + command-line parameters, and hyperlink to the shortcut file in UR.
http://vlaurie.com/computers2/Articles/shortcuts1.htm
http://www.google.com/search?q=how+to+create+windows+shortcut
hmmm, neither option seems good. The first one would be nice but not feasible. The second is not efficient cause I'd need to create a link (ie. shortcut) and then link to link just to have simple thing done + my notes would depend on external shortcuts, grrrr.
OK, I change my question if the hyperlink parsing doesn't look good to you. What about giving user option to run any command line? So that the option in hyperlink would read File/URL/CMD
In that case I'd drag/drop file to item note, go to hyperlink option, precede it with "foxitreader.exe" and add "-n pagenumber" at the end, or whatever needed for any other program. How does this sound? Aaaargh, this is not going to work because of relative paths ...
ok, I give up ... have to find some other solution to read/annotate/hyperlink files in efficient way ... doing it in UR at the moment by pasting parts of the screenshorts from files, but if I cannot go directly to the point where the note comes from, it's too time consuming ... http://www.outlinersoftware.com/topics/viewt/540/0/readannotatebookmark
quant
10-30-2007, 10:52 AM
Originally posted by kinook
The best thing would be for FoxitReader to do what UR does: support a URL protocol (a URL format for command-line launching, ala ur://C:/Documents%20and%20Settings/user/My%20Documents/My%20Stuff.urd?item=1000). Should be straightforward :^).
ok, so I registered pdf protocol on my pc and created a wrapper to call whichever application i need with proper parameters. The problem is, that protocols don't use relative paths! Seems that your protocols are not that smart in the end ;-) Could you please add support for relative paths in whatever protocol is used? Simply in the same way as relative paths for files are used, if the path after protocol name starts with \, it's considered relative and the absolute path will be constructed when clicking on the link. Thank you! Should be straightforward ;-)
kinook
10-30-2007, 11:08 AM
Their not "our" protocols. URL protocols (http://msdn2.microsoft.com/en-us/library/aa767914.aspx) are defined and processed by Windows itself (via a call to ShellExecute (http://msdn2.microsoft.com/en-us/library/bb762153.aspx)/ShellExecuteEx (http://msdn2.microsoft.com/en-us/library/bb762154.aspx)).
quant
10-30-2007, 11:28 AM
Originally posted by kinook
Their not "our" protocols. URL protocols (http://msdn2.microsoft.com/en-us/library/aa767914.aspx) are defined and processed by Windows itself (via a call to ShellExecute (http://msdn2.microsoft.com/en-us/library/bb762153.aspx)/ShellExecuteEx (http://msdn2.microsoft.com/en-us/library/bb762154.aspx)).
sure, but it was you who suggested them to use while they are no different from the standard "command line+arguments" in principle ;-)
+ you don't provide support for the relative path of url protocol (at the moment) which makes it not very useful.
It would be nice if dropping an item from another ur file below its directory structure creates relative path (optionally), just like the normal file does ...
still, this whole discussion ... I don't know ... the simplest would be if UR parses the parameters and calls the right application ;-)
quant
10-30-2007, 11:43 AM
+ unlike UR and urd files, there are many applications that deal with pdf file extension. So it might be preferable to use the simple command line + arguments, because user could easily add the parameters at the end of file name according to application he/she is using. And this is also consistent with how UR works at the moment for all file formats when they are dropped in item text.
quant
10-30-2007, 12:07 PM
What about adding another line for arguments in the hyperlink dialog? That would make life easy for you, no need to parse, just call the application if there is a link to file + add (if any) supplied arguments
Name:
File/URL:
Args:
what do you think?
kinook
10-30-2007, 02:51 PM
Hyperlinks are stored in a format defined by the RTF standard, which, like a web URL, is just a URL (there's no provision for multiple values/arguments except via query strings using a URL protocol, as previously shown).
We could investigate converting "relative" URLs linking to other apps (including the path of the .urd file) when launching, but I don't think the format is standardized enough for this to work generically for all applications/URLs.
quant
10-30-2007, 04:13 PM
Originally posted by kinook
Hyperlinks are stored in a format defined by the RTF standard, which, like a web URL, is just a URL (there's no provision for multiple values/arguments except via query strings using a URL protocol, as previously shown).
ok, I see ... I thought you were in charge, but it's M$oft ...
Thanks for taking time to respond. I registered pdf protocol, created a wrapper and it works fine for me. I precede the link with pdf:pagenumber: and get what I want ;-)
But surely, in this way UR can run anything and could encode it inside its own ur protocol. You could create a dialog where user could choose application to run, arguments to supply ... and UR would run that ...
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.