Thank you very much for this great solution!
Lua Code:
function setcvarifexists(cvar, value)
if pcall(SetCVar, cvar, value) then
else DEFAULT_CHAT_FRAME:AddMessage("|cffff0000Cvar not found: "..cvar)
end
end
Only one call, I'm super happy with that! Gonna look into the secure action button from my other thread now