Notifications
Clear all

[Closed] Macroscripts category & names lists

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

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())

i ll check it, thanks