Can anyone show me some sample code to implement and use Apple Help.
My existing apps use HelpLogic and UniHelp both of which now seem dead. All the DECLARES needed to implement Apple Help are Greek to me and in any case the only sample I can find applies to Carbon not Cocoa.
I don’t have Xcode installed … if you are not programming commercially and keeping it simple you don’t really need it. Unfortunately there doesn’t seem to be a plug-in replacement for UniHelp.
All three of those solutions are for creating full websites. Answers is more specifically targeted at creating help / FAQ style documents. Keep in mind that you will have to run the output of any of these four products through Apple Help Indexer or use AppWrapper’s tools to make the Apple Help Book.
My problem is not authoring the help, I can manage that ok. It’s the code I need in my Xojo program to trigger the display.
I don’t think I will too much of a problem installing it in the app bundle, it’s what code do I need when the user clicks Help.
Oh there’s code for it right inside the AppWrapper Help.
#if TargetCocoa then
declare function NSClassFromString lib "Foundation" ( className as CFstringRef ) as Ptr
declare function sharedApplication lib "AppKit" selector "sharedApplication" ( classRef as Ptr ) as Ptr
declare sub showMyHelp lib "AppKit" selector "showHelp:" ( appRef as Ptr, sender as Ptr )
showMyHelp( sharedApplication( NSClassFromString( "NSApplication" ) ), nil )
#endif
This code comes from an external source, I copied and pasted it here for your convenience. I take no responsibility for this code, and you should probably double check it to make sure it doesn’t do anything likerm rf /
You can thank @Sam Rowlands
(you probably should too, AppWrapper is amazing)
App Wrapper will auto-run the indexer tool when your publish the Help Book in App Wrapper. We use App Wrapper to wrap App Wrapper, so the App Wrapper help is added with App Wrapper.