I have some file associations that I'd like to run with variations. Ok, I can duplicate the command and create an alternative entry.
But that slowly fills up the menu...
So I thought "wouldn't it be nice if I could edit the command before it is executed"? In other words: most of my CFA are
>run something where something can be any expression. So my simply idea was to do >run confirmCMD(something) where confirmCMD is a user-defined function that takes a string variable as argument and returns a string. So I wrote a basic prototype for said function:
Code: Select all
function confirmCMD($cmd) {
text $cmd;
}load confirmCMD;That errors with a message "Script file .. does not contain any valid lines". I added a line "$x=0;" and that removes the err - but the CFA behaves differently now: I am prompted to confirm a message "0" and then the current folder opens in Explorer. I guess it is not possible to run multiple commands.
A solution to this would be to put the whole command into a separate script and simple load that as part of the CFA.
That would, however, lose the "central maintenance" of CFAs, as I'd have CFAs and scripts to look after then
Is there a way I could make the function "confirmCMD" easily available to all scripts? (I thought adding
/script= to the commandline might do it, but the function was not available afterwards)
XYplorer Beta Club