This macro execute tag can be used in this basic format:
Code: Select all
$MEX<macro_script>
Code: Select all
$MEX<macro_script arguments>
Here is an example of a typical script:
Code: Select all
function key_macro()
local arguments = "";
local count = argc();
if count > 0 then
count = count - 1;
for i = 0, count, 1 do
arguments = arguments .. argv(i)
arguments = arguments .. ' '
end
end
local message = "This output generated was by the 'mex-test.lua' macro."
if (string.len(arguments) > 0) then
message = message .. " Arguments Supplied: " .. arguments
end
-- this will be the result of the macro expansion
print(message)
end
key_macro() -- run the macro
Here is an example of how this macro script can be used using the basic format:
Code: Select all
$MEX<mex-test.lua>
Code: Select all
$MEX<mex-test.lua arg1 arg2 arg3>
Code: Select all
echo $MEX<mex-test.lua>
Code: Select all
This output generated was by the 'mex-test.lua' macro.
Code: Select all
echo $MEX<mex-test.lua arg1 arg2 arg3>
Code: Select all
This output generated was by the 'mex-test.lua' macro. Arguments Supplied: arg1 arg2 arg3
For example, this echo will list all text files in the current directory:
Code: Select all
echo $MEX<mex-dir.py *.txt>
Code: Select all
echo $MEX<mex-dir.py c:\temp\ *.txt>