Closed jmoukel closed 7 years ago
Hi @jmoukel,
To programmatically open a help page, first add an anchor identifier to the page's front matter. For example test-help.md
:
---
title: Test Help
anchor: test-help
---
This is some test help.
Next, in your Interface Builder file, add a Help Button (an NSButton with Style 'help') and connect its action to a method like the following which will open the 'test-help' anchor:
- (IBAction)showAnchorHelp:(id)sender {
NSString *locBookName = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleHelpBookName"];
[[NSHelpManager sharedHelpManager] openHelpAnchor:@"test-help" inBook:locBookName];
}
That should be it. Let me know if you run into a problem.
Hi guys,
How can I set an anchor in a page so I can open the Help Book programmatically (using [[NSHelpManager sharedHelpManager] openHelpAnchor:inBook:]) in that specific anchor?