Looking for help understanding an error string - addons

Trying to run a command to get my UI layout info to get a macro made, but I keep getting this string even after all my Addons are disabled, I would really like to not have to remove the addons completely if I can help it but I’ll do what I need to.
Command I’m trying to run: /run C_EditMode.GetLayouts().activeLayout

Error string:

Message: [string "C_EditMode.GetLayouts().activeLayout"]:1: '=' expected near '<eof>'
Time: Wed Feb 19 13:00:02 2025
Count: 2
Stack: [string "C_EditMode.GetLayouts().activeLayout"]:1: '=' expected near '<eof>'
[string "@Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:2304: in function `?'
[string "@Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5492: in function `ChatEdit_ParseText'
[string "@Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5144: in function `ChatEdit_SendText'
[string "@Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5180: in function `ChatEdit_OnEnterPressed'
[string "*ChatFrame.xml:140_OnEnterPressed"]:1: in function <[string "*ChatFrame.xml:140_OnEnterPressed"]:1>

Locals: msg = "C_EditMode.GetLayouts().activeLayout"
userScriptsDisabled = false

This is saying the game doesn’t know what you are trying to do as C_EditMode.GetLayouts().activeLayout is a variable and you don’t seem to be trying to assign a value to it so???

If you want to see what value the variable holds then you need to tell the game where to send the information eg. your General chatframe:
/run print(C_EditMode.GetLayouts().activeLayout)
or
/run local x = C_EditMode.GetLayouts().activeLayout print('Layout Number:',x)

1 Like

This.

But using the “activeLayout” selector only returns the numeric index of the currently-active layout, which probably isn’t what your looking for. It’s just a number. It doesn’t seem like useful information to…

You want to display the layouts table, and to display that in the WoW console you use the /dump command instead of /run.

/dump C_EditMode.GetLayouts().layouts

1 Like

And for the pedantry of it, to dump the active layout:

/run local active = C_EditMode.GetLayouts().layouts[C_EditMode.GetLayouts().activeLayout] DevTools_Dump(active.systems) print('End Active Layout No.', C_EditMode.GetLayouts().activeLayout, active.layoutName)
1 Like

That’s nice. (Complicated, but the layout[] table is complicated and multi-layer.)

I ran out of steam trying to figure out how to boil it down to just the current layout table.

Oh ok, thank you for the information! Clearly I’m out of my depths here but I really appreciate the help :smiley:

Going to edit this but I don’t know if you’ll see it, forums won’t let me reply to you, errors everywhere for me today…

As to what I’m trying to do:

Mainly I just want to be able to swap between two different UI layouts with a single button, and I googled how to do that and I was working off a couple different results talking about needing this information to put into a macro but not really HOW to do that… its a bit more complex than I was expecting so explains why I’m running into issues.

Maybe a little information on what you are wanting to do might help.

1 Like

Thanks a ton for the response, I clearly don’t know what I’m doing really lol so I am really grateful for the information

Just noticed your addtion to your previous reply.

You could first

/run local x = EditModeManagerFrame:CreateLayoutTbls() for k, v in pairs(x) do print(v.index, v.layoutInfo.layoutName) end

to list the ids and names of your layouts. Once you know which two you want to swap between, modify this macro with the two id numbers (replace the 3s and 4 the macro uses)

/run local id = C_EditMode.GetLayouts().activeLayout == 3 and 4 or 3; EditModeManagerFrame:SelectLayout(id)

Note: if you add/remove layouts, the ids could change. It’s also possible to have two id entries with the same name.

Edit: Removed superfluous output.

1 Like

I bet this is what I was supposed to be trying to find cause one of the things I was looking at was talking about finding the ID, but the info wasn’t very thorough. Thank you!

Update: the macro is switching between what it’s claiming to be the UI’s I have saved (the ids and names are correct when I hit the macro) but the layouts are definitely not correct. It’s rotating through the “Modern (Preset)” and “Classic (Preset)” so I think I’m doing something else wrong. :skull:

It seems the character info is offset from the presets.

I updated both scripts in my previous post to something that might work better (the offset may change if Blizz. ever add/remove presets).

1 Like

That worked! Thank you so so so much! I truly appreciate you taking the time to help me with this :hugs: