I have a macro working in KM 75.1 and I am trying to find out why a part is not working in 75.0
The code in the macro is as follows:
_Adblockplugin_rules {
macroinfo=_("Edit the rules file");
$cmdline = getSecureExtensionHandler("txt");
$acfg_File=$ARG."."."txt";
$__path=getfolder(ProfileFolder)."\\".$acfg_File;
$__data=readfile($__path);
$__data==""?&_Adblockplugin_FileNotFound:exec(sub("%1",$__path,$cmdline));
}
That code is called from this menu item:
setmenu($_adA, macro, "View/edit rules", "_Adblockplugin_rules(adblock)", 1);
I correctly obtain the file when using KM 75.1, but nothing at all happens when it runs in 75.0.
The difference seems to be the code needed in main.kmm.
The code being called in main.kmm is this in 75.1:
function getExtensionHandler($ext) {
return _getExtensionHandler($ext, "open");
}
function getSecureExtensionHandler($ext) {
return _getExtensionHandler($ext, "edit");
}
The code being called in main.kmm is this in 75.0:
getExtensionHandler{
# use for text files
$__desiredAction="open"; &_getExtensionHandler;
}
getSecureExtensionHandler{
# use for script files
$__desiredAction="edit"; &_getExtensionHandler;
}
Is there a simple change that I can make so that the macro will run in both KM versions?