I’ve been trying to figure out how to add help files to my ASStudio app. I went to the Developer site and was looking through this page http://developer.apple.com/documentation/Carbon/Conceptual/ProvidingUserAssitAppleHelp/index.html#//apple_ref/doc/uid/TP30000903 but I’m not a C programmer. I don’t know how to use the information about registering my help book or even if I really need to. Do I need to add a C file and if so how do I make sure that what I put into it is going to reference the correct file?
Thanks all!
PreTech
You are in luck. Check out our ScriptWire article this week for complete instructions.
Craig,
Thanks for the reply, but I had already tried this. I’ve been over it several times and I must be doing something wrong because I cannot get this to work.
When I created this app I used the plain AppleSript application. This doesn’t have to use a Document based application does it?
I’ve checked my file names, syntax, and such several times. Do the keys need to go in a certain place in the info.plist, such as before or after other elements?
[edit] I added the help folder and files to the Resources folder. Should they have been added elsewhere?
Thanks again.
PreTech
The last time I added help to an app, I had some problems, maybe you can benefit from my troubles!
First off, what (if anything) is your app doing when you select the Help menu item? My first problem was that it wasn’t launching Help Viewer at all. That turned out to be because I had not selected the “Add folder references” checkbox when I added the folder to my project.
The second problem I had, once I found that one, was that it launched Help Viewer but didn’t pull up my index page. That turned out to be because I had “cut and pasted” the tag, and somehow it wound up in another character encoding. I think I cut and pasted from a PDF in Preview.
I found that problem when I ran the HTML files through the validator at W3C (the WWW consortium, the folks that maintain the HTML standard).
Try those two things. Make sure that you have the properly formatted tag in the section of the index page. Make sure that your folder name and help book name are spelled the same, and that both of them are spelled out in the info.plist as in my article.
Also, make sure you haven’t attached any Applescript names or actions to the Help menu item. Once you do, you lose the benefit of the Cocoa actions, and you have to fend for yourself.
Post back and let us know how you’re doing.
Kevin and Craig,
Thanks for your help.
Even though I kept adding the files and thought I was doing everything alright, I had the button checked for “Recursively …” instead of “Add folder references…”. After I discovered that, however, it still wasn’t working as expected. Among other things, I’m not an html coder either. I noticed that the info.plist had xml at the top and so I used Adobe GoLive to produce an xhtml file that I used. I don’t know if both of these made the difference or not, but I finally had success in getting the help page to open. So thank you again!
PreTech
I’ve never tried xhtml pages, but I assume they’d work. The help viewer probably uses a web view, so anything that works in Safari ought to work in Help Viewer.
Glad you found the problem!
Hello.
I have managed to build my helpbook and it opens just fine from my app.
My question is if their is any way to have the helpbook auto resize to fit my book. I can resize the help window once it is open so that all of it’s contents can be viewed but I would rather it be set to the size of my layout by default.
Thx, DXS
I would imagine that the same javascript code that works to resize a browser window would work. I don’t know, though. Here’s a snippet that I use as a bookmarklet that resizes my browser window for me:
resizeTo(screen.availWidth*.85,screen.availHeight);moveTo(0,0)
This snippet resizes the window to 100 percent of the height and 85% of the width of the screen, then repositions the window to the upper left corner (0,0). If you substitute the height and width that you want, it should work. Just wrap it in tags.
Thx!! That worked like a charm. I had my head wrapped around the idea that I would need to find a way in xCode to set the size of the window. It had not occurred to me that it would be as simple as setting the webpage size.
Thx Again, DXS
–exitus acta probat
That’s one of the advantages of Apple using Webkit for the core frameworks. Any control (and an html window is a control) the uses Webkit will have consistent behavior from one instance to the next. The truth is I didn’t know if it would work, but assumed so because I new it would be using the same html engine that Safari uses.