Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Keyboard shortcut or programmatic way to open file in specific app #11314

Open
reidprichard opened this issue Feb 15, 2023 · 5 comments

Comments

@reidprichard
Copy link

What feature or improvement do you think would benefit Files?

As part of my workflow, I have a macropad with buttons dedicated to open files I've selected in Explorer in the app of my choosing. This is accomplished by AutoHotkey tapping into the COM interface to get the paths of selected files. In PowerShell, a simplified version of this would look like (New-Object -ComObject Shell.Application).Windows()[0].Document.SelectedItems() | Select-Object Path (gets path of first selected item in first open Explorer window).

I have no idea if this is a realistic request, but would it be possible to register a COM object to allow programmatic interaction with Files? Alternatively, it would accomplish my current goals to have customizable keyboard shortcuts for "Open selected file(s) with ____ application".

My knowledge of the Windows APIs is pretty limited, so it's possible that there's already a way to do this?

Requirements

Either:

  1. A COM object will allow programmatic interaction with Files OR
  2. A keyboard shortcut will open selected file(s) with the specified .exe

Files Version

2.4.33.0

Windows Version

10.0.22621.1265

Comments

No response

@yaira2
Copy link
Member

yaira2 commented Feb 15, 2023

I'm not sure if we can add official support but depending on the action, you can already use auto hot key to trigger keyboard shortucts. See this comment #2355 (comment)

@reidprichard
Copy link
Author

Fair enough. Yeah, I think it should be doable by sending F2, Ctrl+A, Ctrl+C to get the name of the selected item, though that wouldn't work for multiple files.
Just thought I'd ask!

@yaira2
Copy link
Member

yaira2 commented Feb 20, 2023

Perhaps we can implement this natively when we add support for custom actions.

@yaira2 yaira2 changed the title Keyboard shortcut or programmatic way to open file in specific app? Feature: Keyboard shortcut or programmatic way to open file in specific app Feb 20, 2023
@yaira2
Copy link
Member

yaira2 commented Feb 20, 2023

@cinqmilleans do you think we can support this with custom actions?

@cinqmilleans
Copy link
Contributor

This is something that will be very easy to do with actions. In a next iteration, there will be a mechanism to add/remove custom actions in CommandManager. It will be enough to create an Action class, instantiate it with the parameters (software, hotkey, ...), add it to the commands and the shortcut will work. It will be necessary to provide a repository to store custom hotkeys and actions, but it is an overlay to CommandManager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Planning stage
Development

No branches or pull requests

3 participants