Hey, all. In the documentation for UI.savepanel, the following appears:
Bug Fixed in SketchUp 2014: Wildcards were not working properly from SU7 to SU2013. Semicolon-separated lists of wildcards did not populate the file type dropdown. The filter string would be shown in the file name field with ‘*’ characters converted to ‘_’ characters.
I’m noticing this exact issue happening when I call UI.savepanel in SketchUp 2015 on 64-bit Windows.
For clarity, here is the function call:
UI.savepanel("Set File Location", "C:\\", "*.flv;*.mp4;*.mpeg4")
As the fix report states, the wildcards are not appearing in the file type dropdown, but showing in the filename location with underscore characters replacing the asterisks.
I’m calling this function within a UI::WebDialog constructor.
Also, I’m not sure if this is the right place to report bugs - if not, feel free to point me in the right direction and I’d be happy to post this issue there.
Thanks.
Edit
Also, for some reason it seems like UI.savepanel does not fully escape the backslashes within the returned filepath.
I just learned that it’s actually valid in Ruby to perform the following:
variable = "C:\some\path\to\dir"
as opposed to
variable = "C:\\some\\path\\to\\dir"
Despite the validity, this isn’t legal in JavaScript, so if the path is sent to the web dialog without any kind of check for this, then JavaScript will omit the back slash characters.
I might be missing something here, but I’m thinking this is also a side effect from calling UI.savepanel.
Edit 2
Also, if the value returned from UI.savepanel is sent to an external C function and read using the Ruby Extension API, the memory read is invalid and a segmentation fault is thrown.
I decided to send a dummy string in order to compare the result, and there were no issues.