You are not logged in.
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.
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 Mojave
https://www.titanium-software.fr
Offline
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/
latenightsw.com
Offline
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.
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 05:50:12 am)
iMac 27" 3,4 Ghz - MacOS Mojave
https://www.titanium-software.fr
Offline
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/
latenightsw.com
Offline