06-05-2008, 04:28 PM
Thank you ken. This function implements your idea.
Function QmReplaceSystemFunction
Function QmReplaceSystemFunction
;/
function $funcSystem $funcReplaceTo
;Use this function to automate modifications of System functions, macros, toolbars and menus.
;Replaces text of funcSystem (a function or macro etc in System folder)
;with text of funcReplaceTo (a function or macro etc somewhere else).
;Replaces only text, but not trigger or other properties.
;Saves the changes in System.qml file. Please ignore the 'QM does not save changes...' warning.
str sysfile="$qm$\system.qml"
SetAttr sysfile FILE_ATTRIBUTE_READONLY 2
int idsys=qmitem("System"); if(!idsys) ret
if(val(_s.getmacro(idsys 8))) end "System folder is read-only. Right click it, select Folder Properties and uncheck read-only."
str s.getmacro(funcReplaceTo)
s.setmacro(funcSystem)
out "%s successfully replaced." funcSystem
if(!SilentExport(+idsys sysfile 3)) out "Warning: failed to save. To save manually, export System folder." sysfile
err+ end _error