Tuesday, December 12, 2017

#1 2017-10-02 04:32:33 am

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 43
Website

Help and High Sierra

Hello,

In the previous OS, to display a specific help file from my application, I wrote:

Applescript:

set helpPath to (current application's NSBundle's mainBundle()'s pathForResource_ofType_("Help/pgs/file", "html") as string)
current application's NSWorkspace's sharedWorkspace()'s openFile: helpPath withApplication:("/System/Library/CoreServices/HelpViewer.app")

It doesn't correctly work anymore in High Sierra. sad

If I run the Help Mac and my help file after, it's OK but impossible to directly display my file. Is it a bug of HelpViewer? I don't know...

Please, have you a solution?
Thanks a lot!


iMac 27" 3,4 Ghz - macOS High Sierra
https://www.titanium-software.fr

Offline

 

#2 2017-10-02 05:46:00 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5199

Re: Help and High Sierra

As I read the documentations, your code shouldn't work. For pathForResource:ofType: it says:

The method first looks for a matching resource file in the non-localized resource directory of the specified bundle. If a matching resource file is not found, it then looks in the top level of an available language-specific .lproj folder. [...] It does not recurse through other subfolders at any of these locations.



Try using pathForResource:ofType:inDirectory:.

Applescript:

set helpPath to current application's NSBundle's mainBundle()'s pathForResource"file" ofType:"html" inDirectory:"Help/pgs"


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2017-10-02 07:55:50 am

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 43
Website

Re: Help and High Sierra

Thanks Shane,

Same problem.
HelpViewer is running (seen in the Activity Monitor) but don't display anything.
Before, if I open the Help from the Help menu (showHelp: action in the Interface), the file is open in HelpViewer. hmm

Else... call the showHelp method before?

Applescript:

set myHelp to current application's class "NSApplication"'s sharedApplication()'s showHelp:("")

Is it correct?

Last edited by Titanium (2017-10-31 06:50:12 am)


iMac 27" 3,4 Ghz - macOS High Sierra
https://www.titanium-software.fr

Offline

 

#4 2017-10-02 06:47:07 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5199

Re: Help and High Sierra

I've never used HelpViewer, so I'm afraid I can't offer any other suggestions.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)