Re: Help Viewer frustration
Re: Help Viewer frustration
- Subject: Re: Help Viewer frustration
- From: Ali Ozer <email@hidden>
- Date: Fri, 11 May 2001 14:31:36 -0700
I think the reason why just supplying "Help Viewer" does not work is
because Help Viewer is not in the standard path.
The full path case can be made to work by supplying the actual full-path
to Help Viewer, which should include the .app extension:
[[NSWorkspace sharedWorkspace] openFile:path
withApplication:@"/System/Library/CoreServices/Help Viewer.app"];
Note though that you should really get the path from the Foundation API.
Do something like:
NSArray *array = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSSystemDomainMask, YES);
if (array && [array count] > 0) {
path = [[array objectAtIndex:0]
stringByAppendingPathComponent:@"Library/Help Viewer.app"];
} else {
// fall back on some hardwired path...
}
This makes it a little more dynamic. BTW, there is also a way to
specify the default help book in the Info.plist, did you try that?
Ali
On Friday, May 11, 2001, at 02:10 PM, Jessica Kahn wrote:
Hi Matt,
I don't know why what you're trying to do is broken, but you can do the
following instead:
Call AHGotoPage (in the Help.framework, which is part of Carbon, but is
callable from Cocoa because it's just a C API), supplying a full file:
URL to the index.html file as the path parameter. This call should take
care of launching Help Viewer and opening your file.
--Jess
On Thursday, May 10, 2001, at 05:01 PM, Matt Ridley wrote:
Hi folks,
I'm trying to use Help Viewer to open the HTML help file which is
inside my app's bundle. This code should work, but instead it always
opens the file with the default ".html" application.
NSString *path = [[NSBundle mainBundle] pathForResource:@"index"
ofType:@"html"];
if (path)
[[NSWorkspace sharedWorkspace] openFile:path
withApplication:@"Help Viewer"];
It just won't use Help Viewer. I've tried specifying the full path to
Help Viewer in the withApplication argument:
/System/Library/CoreServices/Help Viewer
but it just will not use Help Viewer. In fact, when I specify the full
path, my app's window appears to deactivate, but my app stays
frontmost, and nothing else is launched (not even the default ".html"
application).
Can anyone help me with this?
Best,
-Matt
--
Matt Ridley
<http://www.mattridley.com/>
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev