I am trying to create a tool which will open a .html file, however I need help with the piece of code which will open said .html file. I have this code below...
help_file = Sketchup.find_support_files("html", "Plugins")
if help_file
# Print out the help_file full path
UI.messagebox(help_file)
# Open the help_file in a web browser
UI.openURL("file://" + help_file)
else
UI.messagebox("Failure")
end
The output from this piece of code is shown in the screenshot below.
https://i.stack.imgur.com/ixLIT.png
That is what I had expected. No .html opened in Chrome either because there's two .html files. So now I take a step further and try to specify which .html file I would like opened. I would like to open the 'basic.html' (it's a blank .html file so far) and I change my code accordingly (the first line to be specific).
help_file = Sketchup.find_support_files("basic.html", "Plugins")
if help_file
# Print out the help_file full path
UI.messagebox(help_file)
# Open the help_file in a web browser
UI.openURL("file://" + help_file)
else
UI.messagebox("Failure")
end
Unfortunately, I didn't get the output I had hoped for. This is what I ended up with.
https://i.stack.imgur.com/4xyQT.png
the basic.html didn't open in Chrome either, which was a bummer.
Below is what my files in the Plugins folder looks like, incase you wanted to see that.
https://i.stack.imgur.com/OW7xM.png
What is the problem I am facing?