<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>[summary for list]</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Two problems with the way GRASS opens help files in OSX:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Init.sh uses a plain 'open' as the default for the browser in Mac OS X.  This will open help files in whatever application a user has their system set to open html files in.  By default this is Safari, but it may not be a browser but a text editor (ie for those web programmers), and for viewing help that's not helpful.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>And, if a user wants a different browser for GRASS (and doesn't want to change their general system default browser), the normal unix executable way is not right, that is setting, say, /Applications/Firefox.app/Contents/MacOS/Firefox.  This opens the application, but if it's already running it opens another instance - not right on OSX.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The way to handle these problems is to add options to the open command:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>open -a /path/to/app/package.app</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>or:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>open -b app.signature</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This causes a problem in the scripts, since $GRASS_HTML_BROWSER is quoted everywhere - it tries to execute "open -a /path/to/app/package.app" as the name of a program, not "open".  So, I tried two ways to handle this.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[/summary]</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV>So far I have (in init.sh):<DIV><BR class="khtml-block-placeholder"></DIV><DIV>- alias method - doesn't work, command not found</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>alias opengrasshelp='open -b com.apple.helpviewer'</DIV><DIV>GRASS_HTML_BROSWER=opengrasshelp</DIV><DIV>export GRASS_HTML_BROWSER</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Help button in GUI startup and help menu in GUI and in command dialogs:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>couldn't execute "opengrasshelp": no such file or directory</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>or if I try to run 'opengrasshelp' from the GRASS prompt:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>bash: opengrasshelp: command not found</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- script method - an extra etc script html_browser_mac.sh opens the help file in the browser set in GRASS_HTML_BROWSER_MACOSX</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This works as a default browser:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>GRASS_HTML_BROWSER="$ETC/html_browser_mac.sh"</DIV><DIV>GRASS_HTML_BROWSER_MACOSX="-b com.apple.helpviewer"</DIV><DIV>export GRASS_HTML_BROWSER_MACOSX</DIV><DIV>export GRASS_HTML_BROWSER</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This also works:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>GRASS_HTML_BROWSER_MACOSX="-b org.mozilla.firefox"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But this opens the default system browser:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>GRASS_HTML_BROWSER_MACOSX="-a /Applications/Firefox.app"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It opens the default browser when used in the Help menu and dialogs, BUT works correctly if typed at the GRASS prompt, like:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>&gt; $GRASS_HTML_BROWSER_MACOSX /path/to/some/hemp/file.html</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I can use the browser signature method, and would prefer that - it's simpler for the user, and I can put tests in init.sh for common browsers so the user just needs to set GRASS_HTML_BROWSER to a name.   But I don't know the signatures for any other browser than Safari and Firefox, so those would have to be filled in.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I could force the signature method as the only method.  Leave browsers that I know as above, but for other browsers the user would have to figure out their signatures.</DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-----</DIV><DIV>William Kyngesburye &lt;<A href="mailto:kyngchaos@kyngchaos.com">kyngchaos@kyngchaos.com</A>&gt;</DIV><DIV><A href="http://www.kyngchaos.com">http://www.kyngchaos.com</A>/</DIV><DIV><BR></DIV><DIV>First Pogril: Why is life like sticking your head in a bucket filled with hyena offal?</DIV><DIV>Second Pogril: I don't know.  Why IS life like sticking your head in a bucket filled with hyena offal?</DIV><DIV>First Pogril: I don't know either.  Wretched, isn't it?</DIV><DIV><BR></DIV><DIV>-HitchHiker's Guide to the Galaxy</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>