Suppose I have two .pdf
files. One is a comic book and the other is just a document. The behavior I want to achieve in the end is when I double click on the comic book, it will open the comic book reader software, but when I double click the plain document it will open it in the regular PDF reader.
To achieve this goal my idea is to intercept the 'open file' windows event and somehow inject a small script there. Maybe search for a pattern in the file path that's going to be open. Let's say all my comic books are in a /comic/
folder. So if the path contains the string comic
I open it with the comic book reader and else I open it with whatever windows wanted to open it by default.
The bottom line is, how can you open different files with the same extension with different programs without going through the open with...
menu?
I've seen an 'autohotkey' script that will open a file under the cursor in a specific program if you press a hotkey. This is somewhat a good solution, but I wonder if there's something better?
EDIT: Another idea is just to replace the default application in windows that opens PDFs with a script that does the above. IE, searches the path for a pattern and then opens it in a program according to its findings. Is something like that is possible?
.pdf2
means. Your solution relies on the program figuring out what kind of file it tries to open regardless of extension. Usually this is not the case..txt2
files with Notepad. And it works because Notepad can figure out that it's a text file regardless of the extension. This is not true for most programs. Many programs rely on the extension to figure out how they should treat the files. So if they see an extension they don't know, they don't know how to handle it.