Okay, I need to produce a list of avaliable installed macros.
I’m currently using a combination of macros.list(), listener selection and memstream to print a list of installed macros to the listener, select that list, copy it to a string and then parse it using a memstream…
While this does work, it works like an old battered donkey…Please, does any one know of a simple way to get a list of installed macros stright into a collection or array!!!
And just in case you thought I was crazy, here’s the code to prove it
struct ZOMacroDef (
iId,
sName,
sCatagory,
sSource,
fn toString = (
return "id = " + (iId as string) + "; Name = " + sName + "; Catagory = " + sCatagory + "; sSource = " + sSource
)
)
(
clearListener()
Macros.list()
setListenerSel #(0, -1)
local sText = getListenerSelText()
local sStream = memStreamMgr.openString sText
local lstMacros = #()
while (sStream.peekToken() != undefined) do (
local sId = sStream.readToken()
local sName = sStream.readToken()
local sCatagory = sStream.readToken()
sStream.readToken() -- The catagory is listed twice for some reason...
local sSource = sStream.readToken()
if sId != undefined and sName != undefined and sCatagory != undefined and sSource != undefined then (
local macroDef = ZOMacroDef iId:(sId as integer) sName:sName sCatagory:sCatagory sSource:sSource
append lstMacros macroDef
) else (
format "Last element = sId = %; sName = %; sCatagory = %; sSource = %
" sId sName sCatagory sSource
)
)
--close sStream
)
Why in gods name they simply dump the list to the listener is beyond me 
Cheers
Shane
