To unify the Windows and MacOS platforms, we have implemented the same URL-style command syntax in both versions of eViewer. The syntax is identical, but the calling conventions are slightly different because of the different platforms.
How context help calls work on Windows On Windows, you can call an executable with command line parameters. Multiple calls to the same executable will normally start multiple instances of the program. However, this is prevented by the eViewer application. It always displays just one instance of the viewer for the same help file, even when you make multiple calls to it. How context help calls work on MacOS On MacOS, when an application is opened by another program, it is possible to specify command line parameters as well. But only once. Because of the general single-instance policy on MacOS, a subsequent call to the same executable does not create a new instance. Instead, it brings the running instance into foreground. At this point, the already running application does not receive the (different) command line parameters after the --args command line switch. All is not lost, however, because MacOS also makes it pretty simple to register a custom URL scheme for an app, which can be used both to open your app and pass commands to a running instance. |
The references for topic files in your call URLs are slightly different for standard Help+Manual skins and frameless Premium Pack skins. With the standard skins you need to call both the layout page (index.html) and the topic page (topic.htm or topic_id.html, depending on what you set as your topic extension in your project). Standard skins: ewriter://<path>my_doc.ewriter?loadpage=index.html?topic.htm#anchor_id Premium Pack V3, V4 and V5 skins ewriter://<path>my_doc.ewriter?loadpage=topic_id.html?anchor=anchor_id |
The URL command combines 3 parts: a) the protocol, b) the domain which is our ewriter file and c) the optional command parameters as the URL query part. The URL is preceded by the viewer reference All examples are the argument. They must always be preceded by a reference eViewer app or the eWriter EXE file name if you are using that format on Windows. When using standalone Windows EXE files the file is both the viewer and the target and calls itself. You can use two ? separators in the same URL Note that you use the ? character after the index.html reference as the first separator, even though it also comes after the eWriter Help file name. This is because the URL is actually two combined URLs that are split internally by the viewer.
|
|
|
How to escape your calling URLs with percent encoding
A URL is a single string without spaces. It is made up of a protocol, a domain and trailing query strings. No spaces are allowed in the domain or the query strings. The domain and query strings are separated by a question mark (?). Multiple query strings are separated by an ampersand (&). For detailed information, see the W3C website To serve the URL string correctly, we must at least escape all spaces in the entire URL and the question marks within parameters:
Raw: Escaped: |