-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
apiIssues related to APIIssues related to APIfeature requestNew feature or improvementNew feature or improvementstatus: fixed in next releaseThe issue will be closed once next release is availableThe issue will be closed once next release is available
Description
Describe the feature and the current behavior/state.
A method that return the selected items in Finder (files and folders). I've asked @thomaspaulmann about this on Slack and he suggested something like getSelectedFile, that would fit nicely with getSelectedText. I'm not completely convinced by the naming though because the method would ideally return an array of finder items, something like this:
interface FinderItem {
path: string;
isFile: boolean;
isDirectory: boolean;
}And that could be used like this:
const selection = getSelectedFiles();
const files = selection.filter(item => item.isFile);
files.forEach(file => { console.log(file.path) });Will this change the current api? How?
No.
Who will benefit with this feature?
Extensions that act on the selected files and/or folders, like #147 – Open Finder Selection With…. Some examples:
- an extension with commands to open the selection with specific applications, so you could assign a keyboard shortcut to open files with your code editor for example;
- an extension to upload the selected file to an online file sharing service;
- an extension to display the summed size of the selected files;
- an extension to compress the selected files;
- an extension to convert the format of the selected image files.
Any Other info.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiIssues related to APIIssues related to APIfeature requestNew feature or improvementNew feature or improvementstatus: fixed in next releaseThe issue will be closed once next release is availableThe issue will be closed once next release is available