Open files with different programs depending on filetype?

Hi there,

Is it possible to set a hotkey to open selected files with different programs depending on the filetypes in Directory Opus?

For example, when I press F4, if the selected file is .txt then EditPlus opens it and if the selected file is .avi then The KMPlayer opens it... etc.

I have searched the forum but could not find the solution.

Maybe I can just let DOpus "open" the file and let the associated program do the job?

I coded a very simple program for your aim. Extract the attached zip file and copy Runner.exe to System32 dir.

Make a new button or hotkey with following code:

@nofilenamequoting Runner.exe "{o}"
Runner.zip (221 KB)

I don't mean this too sound TOO sarcastic - so please take with a grain of salt... but:

If it's ok to just let Opus call the default shell action for a given filetype (very often 'open') the n what special "hotkey" would you need other than... tada... the key?

Aside from that, I think the only way you could 'control' exactly what Opus executes as far as the particular shell 'action/verb' against a file based on it's filetype would be to set the default shell action externally from Opus. For instance, there's no direct way to tell Opus to run shell->open for one file type, and shell->play or shell->edit for different filetypes "with the same hotkey"...

FileType ACTION=dblclk in Opus will do the same thing as double-clicking a file.

You can also use things like ACTION=open but open isn't always the default verb so the two are not always equivalent.

Like Steje says, the Enter key already does this.

Similar question, can I configure Dopus such that it opens a file type with a different standard program than Windows Explorer does?

For example, I want to set Adobe Reader as standard viewer for PDF files (in order to get PDF thumbnails!), but still want Dopus to open all PDF files in PDF-XChange Viewer, not in Adobe Viewer.

Can this be done?
David.P

Yes, using the double-click event on the filetype. You shouldn't need to though. Just use the standard Open With menu to change the association as that should not affect thumbnail generation.

Unfortunately, changing the default Open With program association from within Dopus changes this setting not only for Dopus, but system-wide (also for Windows Explorer).

And as soon as Adobe Reader (or Acrobat) is not the standard PDF viewer, PDF thumbnail creation is not working anymore.

Thus, how would I go about to make use of the double-click event on the file type PDF?

Thanks already
David.P

Weird. I would not have thought that changing the association using the Open With menu would affect that.

Settings -> File Types -> PDF -> Events -> Left Double-Click.

Then click Browse... and find the EXE you want to use. Add {filepath} after the EXE.

Thanks Leo!

For some reason, I had to add ""{filepath}"" after the exe.

Btw. strangely, in below screenshot of the settings for the system file type PDF, it can be seen that PDF is registered as PDF-XChange Viewer file. Any PDF file however is still opened in Adobe Acrobat (which is set as standard PDF handler in Windows) from Dopus, when I right click on a PDF and choose "Open".

Thus, is there a way to also change the right-click-open association (in Dopus) to PDF-XChange Viewer somehow, thereby still keeping Adobe as standard PDF handler in Windows?

Thanks heaps already
David.P

An action called "Open with PDF-XChanger Viewer" isn't the same as an action called "Open", although either of them can be set as the default double-click action. Or you can override it using the Open With menu.

I still don't understand how using the Open With menu could possibly break Adobe's PDF thumbnails since it doesn't change the filetype at all. It's an override that is stored elsewhere in the registry. Using the Open With menu is different to telling either of the programs to take over the file type (which may modify or replace the file type completely).

If you want to change the actions or the context menu items then you can do all of that using the file type window.

Ok, I now managed to get a new context menu entry for opening PDF's in PDF-XChange Viewer:

It is not the context menu entries that break the PDF thumbnail generation, it's just that Adobe Viewer or Acrobat must be set as standard PDF handler in Explorer in order to get PDF thumbnails at all.

What I don't understand is the difference between "Actions" and "Context Menu" in the File Type dialogs shown here. It seems that only the "Context Menu" tab actually does something (makes a new context menu entry), whereas the "Actions" tab doesn't seem to do anything.

Rgds David

Actions can be called directly by other programs (via ShellExecuteEx) while context menu items can't.

Both appear together on the context menu, though.

Thanks.

For some reason, the "Action" tab's content doesn't turn up in the context menu, only the "Context Menu" entry does.

David.P

Try holding Shift when you right-click the files.

Hmmm, the only difference when holding Shift is that I get one additional Conetxt Menu entry: "Pin to Start Menu".