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


#1

Hello,

openUrl() shows a local path on Windows Explorer
UI.openURL(“C:/Users/SUalive4u/SketchUp/anim SUalive/saw_CE/”)

but the following doesn’t work on Mac OSX
UI.openURL("/Users/iMac56-J/")

How making it at work?

Regards


#2

I think that is because on Mac OS that is not a correctly formed URL. You need to prepend it with “file://”


#3

For cross-platform compatibility your can pre-pend to the passed file path:
SO… MAC’s
path = "Users/iMac56-J/"
OR… PC’s
path = "C:/Users/SUalive4u/SketchUp/anim SUalive/saw_CE/"
BECOMES
UI.openURL("file:///#{path}")


#4

Hello,

Weakness of our Ms culture where file protocol can be omitted!

Thanks for your answers.
Both work but TIG’s syntax does not go through our “code compiler”. I added the third forward slash as it is said aiming local url.

have a good weekend