My plugin currently stores its user-loadable settings files in Sketchup.find_support_files(“Plugins”)//Settings. I’m trying to create a UI.openpanel that defaults to this directory, permitting users to select the settings file they’d like to use.
On Windows 7, Sketchup Pro 2015, this works perfectly:
UI.openpanel(“Test Box”, Sketchup.find_support_file(“Plugins”))
However, the same command on OS 10.8, Sketchup Pro 2015, the open dialogue drops me into the directory I used the last time I successfully called UI.openpanel (~/Pictures). On further investigation, it seems the UI.openpanel implementation on OS X behaves strangely: it can’t show folders marked as hidden in Finder, but it also fails to open dialogues to folders I do have permissions for, e.g.,
UI.openpanel(“Test 1”, “~”)
UI.openpanel(“Test 2”, “/Users/”)
UI.openpanel(“Test 3”, “/Users//Movies”)
UI.openpanel(“Test 4”, “/Users//Movies/”)
All take me to the directory selected on my last successful use of openpanel. Switching from double to single quoting makes no difference.
Can OS X’s UI.openpanel open hidden folders (like the Plugins directory)? Am I missing something with the calling convention of openpanel?
Tested on OS X 10.8, Sketchup Pro 2015, Build 15.3.329
Thanks in advance!