Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch Apple Help via Exec()?



The exec() method shoul work reliably now, thanks to the new -b option.

To respond to an earlier post, please don't call Cocoa-Java's NSApplication.showHelp from AWT/Swing.  That method needs to be called from the main AppKit thread or you run the risk of deadlocking.  This is explained in the HelpHook sample's comments.

----------------------------------------------

Matt Drance

DTS Engineer

Java - Dashboard - Address Book

email@hidden



On May 24, 2005, at 6:47 PM, Scott Kovatch wrote:


On May 24, 2005, at 2:21 PM, Greg Guerin wrote:


Scott Kovatch <email@hidden> wrote:



open -b com.apple.helpviewer /Applications/iCal.app/Contents/
Resources/English.lproj/iCal\ Help/iCalHelp.html



I would stick with this version.  The argument to -b is a bundle
identifier, so if Help Viewer ever moves your code will continue to
work.



I see no mention of -b in 'man open' on 10.3 or earlier.  Is it
undocumented, or is it only in 10.4?


Apparently it is new in 10.4....

     open [-b bundle_identifier] file ...

....

     -b bundle_indentifier
         specifies the bundle identifier for the application to use when open-
         ing the file

I've been using Tiger long enough that Panther is becoming a distant memory.  :-)


If -b is 10.4-only, then it might be safer to use the "help:" URL scheme,
or the ".help" file suffix.

Or better yet, make the whole thing a pattern-based property:
  app.help = open!$

Then break it apart at the !'s, substitute $ with the URL of interest, and
exec() the resulting String[].  A nice side effect is that you can change
the property's value on Windows, and the code remains the same.


Sure looks like it would work.  If supporting Panther or other platforms is important, this may be your best bet.

Scott

------------------
Scott Kovatch
Apple Computer
Java Runtime Classes
Cleveland Hts, OH

I am Scott Kovatch, and I approved this message.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Launch Apple Help via Exec()? (From: Greg Guerin <email@hidden>)
 >Re: Launch Apple Help via Exec()? (From: Scott Kovatch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.