@if:$foo always false

I was trying to make a button that gets a value from the user (dlgstring) and performs an action depending on its input.
It doesn't look like we can compare values here?
But at least it says we can check whether a variable has been set.

@if:$foo      |    test if a variable called "foo" has been set

However, I can't get that to work :woozy_face:

@set ts={dlgstringS|Enter the desired file size in MB|10}
@Output {$ts}
@toggle:update
@if:$ts
@Output Yes! {$ts}
@if:else
@Output nope

Will always read "nope", no matter what $ts is set to.
I've tried variations like @if:{$ts} etc, I've tried putting a @toggle:update before the @if or at the top... Nothing seems to work :woozy_face:

How can I do this?
And once I get over that hurdle: Is there a way to check if the value equals another variable?

These checks are performed before the commands are executed.

What the...
How come the @set instruction isn't executed before the commands are executed then?
Can we please make that a thing? Because that seems just bad :upside_down_face:

Isn't this that you want :

@if:!$glob:$ts
@set glob:ts={dlgstringS|Enter the desired file size in MB|10}
@Output ts set to {$glob:ts}
@if:common

@toggle:update

@ifset:$glob:ts
@Output Yes! {$glob:ts}
@if:else
@Output nope