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)
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.
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)
Oh ok, thank you for the information! Clearly I’m out of my depths here but I really appreciate the help
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.
/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.
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.