I’ve been playing with the UI::HtmlDialog
class to create a simple interface that allows the user to input some information and it works just great on the Mac. Under my plugin directory I have a folder called html
in which I keep two files referenced in my Ruby code. That is, I use the following structure:
SketchUp / Plugins / root_rb
SketchUp / Plugins / plugin_dir / main_rb
SketchUp / Plugins / plugin_dir / html / a.html
SketchUp / Plugins / plugin_dir / html / b.html
However, when testing my extension on Windows (under both SU 2021 and SU 2022), the UI that was present on the Mac doesn’t show up anymore. (I should also mention that this is Windows running on Bootcamp.) All I get is an empty pop-up and when I right-click to view the page source I only see the following:
<html><head></head><body></body></html>
In addition, navigating to the Sources tab under DevTools reveals that both a.html
and b.html
have the following content (please side scroll to see everything):
if (document && document.body && document.body.style) { document.body.style.overflow="hidden"; }
This is clearly not right, even though the absolute paths to the HTML files are consistent with what I have on the filesystem.
On the Ruby side of things I am using the canonical way to load the HTML, i.e.
dialog.set_file(File.join(__dir__, 'html', 'a.html'))
When I try to read the file the file via
File.read(File.join(__dir__, 'html', 'a.html'))
I get the following error in the Ruby console (note that I condensed the absolute path):
Error: #<Errno::ENOENT: No such file or directory @ rb_sysopen - C:/Users/.../html/a.html>
I even tried to run SketchUp as an administrator and that didn’t help either. I am really stuck at this point and have no other ideas.
Any help is greatly appreciated! Thank-you!