That said, when I access a file-type that has no association, I am presented with this generic explorer menu...
Like xy, just about every program on my computer is portable and so this menu never has the options I'm looking for. Therefore I'd like to over-ride this explorer menu with a custom menu that has a list of programs that I've picked, as well as a "Look for another app on this PC" option in-case I need an external program that's not on that list.
I know xy has it's own right-click "Open with" option, but that only displays the programs associated with the file-type, therefore it's pretty useless for unknown file-types that have no association. A lot of the unknown file-types I run into are linux files, which have no extension since they're not necessary on a linux machine.
I believe the only way to make a custom open-with menu that will popup whenever an unknown file-type is launched would be through scripting. The problem is that I haven't been able to figure out how to capture unknown file-types in the File Association menu, nor am I able to load a script instead of a .exe.
I tried this syntax in File Association, which does capture everything, but that becomes a problem for .exe files and possibly others...
Code: Select all
"Unknown FileType";*><xyscripts>\UnknownFileTypesMenu.xys
Code: Select all
/*
An "Open with" menu alternative to the built-in explorer option
$menu = <<<MENU
How do you want to open this file?
0) Vim|run lax("<xypath>..\..\GitPortable\Wrapper-Vim.exe" <selitems>)|"<xypath>..\..\GitPortable\Wrapper-Vim.exe"
1) MediaInfo|run lax("<xypath>..\..\MediaInfoPortable\MediaInfoPortable.exe" <selitems>)|"<xypath>..\..\MediaInfoPortable\MediaInfoPortable.exe"
2) MPC-BE|run lax("<xypath>..\..\MPC-BEPortable\MPC-BEPortable.exe" <selitems>)|"<xypath>..\..\MPC-BEPortable\MPC-BEPortable.exe"
-
3) Look for another app on this PC
MENU;
// Get X/Y position of a control
$position = controlposition('TAB 1', 0);
$x_pos = gettoken($position, 1, '|');
$y_pos = gettoken($position, 2, '|');
// Display the context menu
$command = popupnested($menu, $x_pos, $y_pos,,,,,|);
// Run the selected command or skip if it uses an id #
if ($command && !regexmatches($command, '^\#\d+$')) { load $command,, s; }
Can anyone shed some light on how I might go about getting this to work?