UI.openURL( local_path ) doesn't work on Mac OSX

I’d assume so. If you want a specific app you should use Ruby’s own functions to execute the apps with the appropriate argument (provided the app support this).

With UI.openURL, the fact it can open local files is an inadvertent side-effects of how browsers handle these local resources.

Is openURL specifically calling a browser? I thought it told the OS to open the path, and the OS opened a browser if the OS identified it as a web address?

+1 also, for a UI.open or open_file method.

Actually, yea - that’s currently what’s opening under the hood. (which is an implementation detail which lead to opening local files was also possible.)

1 Like

Thanks Christina.
On a side note, so you do not use: unless file_loaded?(__FILE__)
as I saw many times elsewhere. useless ?

I prefer using a variable. It should in theory be faster, it reads better IMO and it uses pure Ruby instead of the stuff in sketchup.rb.

.... a bit offtopic

Yes, I also use a local variable inside my modules.
The array used by the “sketchup.rb” file is shared and file names could clash.
If everyone uses absolute paths in that array, then the string comparison is slow and SketchUp startup times suffer.

Have you measured such impact?

@tt_su, Offtopic, answered here: Speeding Up Extension Loading - #41 by DanRathbun

1 Like