PDA

View Full Version : Macroscripts category & names lists


holycause
02-13-2010, 06: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:

biddle
02-14-2010, 06:24 AM
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())

holycause
02-14-2010, 08:16 AM
i ll check it, thanks :thumbsup:

CGTalk Moderation
02-14-2010, 08:16 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.