• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help Viewer frustration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Help Viewer frustration
      • From: Matt Ridley <email@hidden>
References: 
 >Re: Help Viewer frustration (From: Jessica Kahn <email@hidden>)

  • Prev by Date: Re: Help Viewer frustration
  • Next by Date: Re: Help Viewer frustration
  • Previous by thread: Re: Help Viewer frustration
  • Next by thread: Re: Help Viewer frustration
  • Index(es):
    • Date
    • Thread