This is an "answer you own question" contribution.
I have been struggling for a day trying to get anchor to work in NSHelpManager
system on 10.15, in order to be able to open a given help page with the openHelpAnchor:inBook:
method.
Apple documentation for help system is old and have not been updated for a while.
The hiutil
man page give a hint, stating :
Spotlight help indices are required in macOS Mojave or later.
But using any of the two formats available did not work by itself.
So I had to reverse engineer by browsing the help ressources of Xcode itself to find the solution.
The trick is to generate two index files, one for each format, into the .lproj
folder :
hiutil -I corespotlight -Cf help.cshelpindex -a -s fr -l fr .
hiutil -I lsm -Cf help.helpindex -a -s fr -l fr .
Then, and this is the undocumented key, one needs to add an entry into the help info.plist
:
<key>HPDBookCSIndexPath</key>
<string>help.cshelpindex</string>
along with the traditional documented HPDBookIndexPath
entry.
Et voilà.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With