Home Forums DITA and XMetaL Discussion launching shell scripts. Reply To: launching shell scripts.

Derek Read

Reply to: launching shell scripts.

A little bit of research shows that (for a CHM file) your HTML needs to contain something like the following:


Basically, assuming your question was about producing a CHM file, I was pretty much completely wrong in my previous post. Forgive me though, since I was (and still am) making a lot of assumptions here. I've pursued this because the subject seemed interesting. Hopefully this is in fact what you are getting at.

If you are working with DITA, and you are using the DITA OT to generate output, and your output is CHM, then there is a solution. If any of these things are not true then part of the following might still apply but you would need to adapt it to your schema and the tool that generates your output, assuming it produces CHM.

If you aren't producing CHM then I need more detail.

If you are not using DITA or the DITA Open Toolkit to generate output but you are generating CHM then you just need to get whoever built your publishing system to build a similar feature into it so that the right CHM markup is created.

What I have listed above is pretty much the minimum markup required to launch an app from a CHM. I built it using the wizard included in HTML Help Workshop. Once I found that it was using I realized that the DITA OT can generate that and did some further testing. DITA supports an element andchild elements and when you generate output to HTML-based formats it is basically just passed straight through to the HTML unchanged. So, to generate the output above, all you really need to do is put the right values into the DITA so that it produces the andelements that the CHM needs, and that's easy to figure out since the values are identical.

See attached DITA topic file. It contains an example of the DITA markup required and an explanation of how to generate a CHM file that will use them to create a button that will launch notepad.exe as a test.

The file example_chm.gif is a screenshot of the resulting CHM file open in hh.exe (the HTML Help Viewer) with the button circled in red.

One thing you might need to worry about is the case where Windows can't find your executable using the values listed in its system variables. In that case you might need to provide a full path. Because notepad.exe is usually in the Windows %system% folder Windows can find it if you just specify “notepad.exe” here. This is probably true for anything else that ships with a standard Windows install.