After save a file I want to open the folder of saved file. How do I do that? Thank you very much!
Open the Start menu and type “File Explorer.” Find File Explorer pinned to the taskbar. Right-click a folder and select Open. Some folders already exist in File Explorer, such as Documents, Desktop, and Downloads.
Right-click your folder (not the parent one) and select Show More Options > Send To > Desktop (Create Shortcut). This will place your folder's shortcut on your desktop. Access your desktop by pressing Windows+D. On the desktop, find your folder's shortcut.
Just open it up to browse any area of your local storage or a connected Drive account; you can either use the file type icons at the top of the screen or, if you want to look folder by folder, tap the three-dot menu icon in the upper-right corner and select "Show internal storage" — then tap the three-line menu icon in ...
If I understand your question, you want to open the folder into which something was saved in the Finder?
This should do the trick -- it assumes that you have a reference to the savePanel.
NSURL *fileURL = [savePanel URL];
NSURL *folderURL = [fileURL URLByDeletingLastPathComponent];
[[NSWorkspace sharedWorkspace] openURL: folderURL];
If you are starting with an NSString
containing the path, then start with:
NSURL *fileURL = [NSURL fileURLWithPath: stringContainingPath];
Even better would be to not just open the folder, but have the saved file selected. NSWorkspace can do that for you:
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:
@[ URLToSavedFile ]];
The argument is an array of URLs, so if you have only one file you want to reveal, you simply pass an array of one object.
If, for some reason, you're targeting a version of Mac OS X older than 10.6, you'd use the older path-based method instead:
[[NSWorkspace sharedWorkspace] selectFile:pathToSavedFile
inFileViewerRootedAtPath:@""];
(You want to pass an empty string for the second argument so that the Finder will reuse an existing Finder window for the folder, if there is one.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With