UnityStandaloneFileBrowser icon indicating copy to clipboard operation
UnityStandaloneFileBrowser copied to clipboard

User home dir shortcuts don't work

Open ghostravenstorm opened this issue 3 years ago • 2 comments

Shortcuts to the user's home dir like %userprofile% on Windows and ~/ on Linux don't work as expected when summoning the open file panel.

var paths = SFB.StandaloneFileBrowser.OpenFilePanel("Open File", "%userprofile%", extensions, false);

Using %userprofile% for example opens the panel on the same executing dir with .../UnityApp/%userprofile%/ in the file name field. image Using C:/Users/user instead corrects this behaviour to open on the user's home dir be default as desired, but its silly to hardcode user names.

ghostravenstorm avatar Feb 28 '22 19:02 ghostravenstorm

Yes, I too was confused about this behavior. Is there any workaround?

monsieurpooh avatar Jul 24 '24 04:07 monsieurpooh

WORKAROUND: %userprofile% can be derived by: Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)

monsieurpooh avatar Jul 24 '24 04:07 monsieurpooh