Code: Select all
$menu = <<<MENU
PeaZip;;"<xypath>\Tools\PeaZip\peazip.exe"
Open;openwith "<xypath>\Tools\PeaZip\peazip.exe";"<xypath>\Tools\PeaZip\peazip.exe"
Extract to Folder;openwith """<xypath>\Tools\PeaZip\peazip.exe"" -ext2folder";"<xypath>\Tools\PeaZip\peazip.exe"
Add to Archive;openwith """<xypath>\Tools\PeaZip\peazip.exe"" -add2archive";"<xypath>\Tools\PeaZip\peazip.exe"
Notepad++;;"<xypath>\Tools\Notepad++\notepad++.exe"
Open with Notepad++;openwith "<xypath>\Tools\Notepad++\notepad++.exe";"<xypath>\Tools\Notepad++\notepad++.exe"
MENU;
$command = popupnested($menu);
if ($command != '') { load $command, , "s"; }
So just using these two programs as examples, the idea would be that if I, say, have a .txt file selected, the "Notepad++" menu and submenu will show, but only the "Add to Archive" submenu would show (as a .txt file doesn't need to be extracted or opened with an archiving program, but I may want to add it to an archive), but if it's, say, a .rar file, all PeaZip menu/submenu will show but none of the Notepad++ menus (as I don't need to open a .rar file in Notepad++). In essence making this a more customizable version of the POM.
I'm not really looking for someone to write a whole script for me, just a simple example of something like "Show Notepad++ menu and submenu if a .txt file is selected, else hide them" so I can get an idea of what that looks like would be appreciated.