Registering Apple Helpbook - macos

I am trying to make help pages for my application. I have written the pages as described in the Apple Help Programming Guide. I've made a folder myapp.help containing the pages, a plist file, indexing etc. and added it to my app bundle. I've also added the CFBundleHelpBookFolder and CFBundleHelpBookName to the app bundle plist.
When I try to register it with AHRegisterHelpBookWithURL() - it fails with error -50 (Error in user parameter list).
I don't want to set up the help bundle with Xcode because I'm already using Makefiles, thanks.

The problem was that the bundle could not be found by MacOS. I had made a link to the executable inside the bundle; the link was in a directory in my path; I typed the name of link into a terminal to run the program - it seemed a fairly neat way to do things.
I didn't realise that CFBundleGetMainBundle() would only work if you started the program from Finder or by entering the path to the executable.

Related

NativeScript app gives "warning: Stale file [....appname-Prefix.pch.gch] is located outside of the allowed root paths"

If i run the tns run ios command for the app I'm developing my console outputs the following:
warning: Stale file '{pathToFile}/appname-Prefix.pch.gch' is located outside of the allowed root paths
Since I was wondering whether this was bad I turned to Google for answers. I could only find this:
The warning is from Xcode
It's about precompiled headers (I guess for Objective-C)
... that are probably misplaced.
And of course a question on Stackoverflow, but not in relation to NativeScript.
I tried to remove the platform (tns platform remove ios) and re-adding it. This didn't solve it.
Does anyone know how this file got located outside the allowed root path?
Can/should I fix this? I really like to understand the technology I'm working with.
Btw: The tns build doesn't give any such warnings.

How to create an app bundle with an exe and a directory hierarchy?

I am struggling to create macOS application bundle that follows this hierarchy.
I am currently on XCode 10.1 and I also have XCode 9.0.
However, I just cant find a way to get the folder hierarchy as mentioned in the above link.
Specifically, I want to have the localization .lproj directories in Contents/Resources and app exe in Contents/MacOS.
I do File-->New-->Project but I just cant seem to find an option which will produce this hierarchy.
Am I
missing something obvious here ?
using a wrong version of XCode ?
TIA

AppleScript in Xcode11 and Catalina

I am trying to make my ObjC application scriptable. I included .sdef file into my project, created appropriate classes, very simple, just one command. Anyway, Apple Script Editor can't read my dictionary
I checked evrything twice, tested similar srciptable project from Ray Wenderlich tutorial, the result is the same. Are there any changes in Catalina or sandboxing or anything else?
Thank you.

Is it a sandbox issue? how to fix it? (I am implementing a plugin of apple mail)

Maybe this tutorial is out of date( it was written in 2009),but I cannot find a better one. While following it step by step, I was stuck at Loading a Plugin section. Apple mail failed to load the plugin.
here is a screenshot of Console's information.
Has anybody else tried to follow this tutorial on OS X 10.9 recently?
////////////////////update/////////////////////////
It seems "~/Library/Mail/Bundles/MyPlugin.mailbundle/Contents/Frameworks/Python.framework/Versions/2.7/python" needs code signing.
Yes, this is a sandbox problem: Python Mail plug-ins (and I think all plug-ins) cannot read files outside of their container (the Plugin.mailbundle directory).
If you followed the instructions on the tutorial page you mention, you are probably building an alias build of the plug-in (using python setup.py py2app -A), which means that the plug-in will try and access files from the original source location, which is almost always outside of the sandbox (in your case, it's /Users/greedyint/Desktop).
Try running without -A to make a full build.

Is OS X Installer package postflight localization supported?

I've created an OS X installer package that includes localized resources (License.html, Readme.html, etc.) In particular, it includes a localized postflight script, since some of the post-install actions differ from language to language; opening a per-language file after the install completes, for example. The package is created as part of an automated build, not through Package Maker.
Originally I used the 'full' locale name as the localized Resource folder name; for example, English.lproj. Everything worked fine. Recently, I switched to the ISO name, i.e. en.lproj, since I discovered that was what Package Maker was using, and this question indicates that form is preferred. Everything worked exactly the same, except that the postflight script is no longer executed.
I did some more testing, and noticed that, even when it works (using the full language name as the name of the folder), it logs this message to the console:
Localized installer script postflight found in the <name> package. Using compatibility mode.
I can find barely any mention of Installer localization in Apple's developer docs, much less anything specific about scripts. Does anyone have experience with this? Is it a bug for it not to work with en.lproj, or was it a bug for it to have worked before?
Things that I don't understand:
If you're not creating these packages with PackageMaker, what are you creating them with?
Why would a postflight script ever need to be localized when conditional logic would almost surely suffice?
It turns out that, no, this is not supported anymore.

Resources