Notifications
Clear all
[Closed] Macroscripts category & names lists
Feb 13, 2010 7:54 pm
hi guys, i’ve a new question,
how could i get the category and name lists like in the customize user interface?
i tried to use the macros.list() function, but couldn’t do anything with it :banghead:
2 Replies
Feb 13, 2010 7:54 pm
It looks like macros.list() prints the info you need to the Listener, then returns “OK”.
You can redirect that listing into a stringstream and then parse the stream into an array.
fn GetMacrosListOutputAsArray = (
local ss,mlist,id,info
ss = stringstream ""
macros.list to:ss
seek ss 0
mlist = #()
while not eof ss do
(
id = (readDelimitedString ss " ") as integer
info = filterstring (readLine ss) "\""
append mlist #(id, info[1], info[3], info[5], info[7])
)
mlist
)
print (GetMacrosListOutputAsArray())