For some reason, at least on Mac, using revealToUser() shows the parent dir instead of the directory itself.
auto f = juce::File::getSpecialLocation(juce::File::userDocumentsDirectory);
f.revealToUser();
Opens the user home directory:
Instead of the expected, contents of the folder:
Could that be looked at? If changing it breaks some expected behavior, a flag to force the real directory contents would be very much appreciated.
Eyal
ttg
August 29, 2021, 5:49pm
2
It breaks code and has been for years now.
I guess you’re looking to use:
startAsProcess();
Instead.
3 Likes
The same thing happens in Terminal if you cd path
and then type open .
the parent folder is opened and the folder is selected. It’s really annoying.
I think this is a MacOS issue, not a JUCE issue.
daniel
August 29, 2021, 6:51pm
4
I think it is a misunderstanding:
My understanding of revealToUser is show this file (or folder) in the finder. So it will open the containing folder and select/highlight the file it was called on.
The docs for revealToUser() are actually clear:
Opens Finder, Explorer, or whatever the OS uses, to show the user this file’s location.
Actually on my machine (intel iMac, Big Sur) it doesn’t work that way.
I did:
cd ~/Documents
open .
And it opened the contents of the document folder, as expected…
That works super well! Thanks! Will that work the same way in Windows?
2 Likes
ttg
August 29, 2021, 7:47pm
7
I’m pretty sure it does. I use it for preset managers to show the presets folder. (Tested it a while ago but sure I’ve tested windows too)
2 Likes
I shall retest. Perhaps I’m thinking of another program that has the same ‘reveal in finder’ problem.
lalala
August 30, 2021, 12:15pm
9
eyalamir:
Actually on my machine (intel iMac, Big Sur) it doesn’t work that way.
I did:
cd ~/Documents
open .
And it opened the contents of the document folder, as expected…
You are both right, it depends which ‘view’ option you have in the finder (list vs columns)
4 Likes