Is there a feature in JUCE "Open containing folder" which just opens the OS default file browser for the file path?
Like:
#if JUCE_LINUX || JUCE_MAC || JUCE_WINDOWS
/* open the path in the OS native file browser */
void File::openContainingFolder();
#endif
Cheers
Got it - URL can do this :-)
URL( _file.getFullPathName() ).launchInDefaultBrowser();
Have you tried File::revealToUser() ? Or is that not what you mean?
Yes, that's it what I want!
Thanks
How do you open the folder instead of revealing the folder?
oh, like this, took me a while to understand:
File(userPresetFolder).startAsProcess();
Would have appreciated openFolder() function.
Would also appecreciate existsAsFolder() function.
bool File::existsAsFolder()
{
return exists() && !existsAsFile();
}
void File::openFolder()
{
if (existsAsFolder())
startAsProcess();
}
edit: oh, there’s an isDirectory() function.
luzifer
November 11, 2019, 2:10pm
6
I agree that having this as an alias is more discoverable and readable
Elan_Hickler:
File::openFolder()
jimc
November 11, 2019, 4:53pm
7
This gets me all the time. File(“somedirectory”).revealToUser() … I imagine most people want to see somedirectory open, not see somedirectory’s parent…
1 Like