Is there a way to have a global variable set based on screen number?

I'm trying to change a text entry so that the text alignment will switch between left or right depending on whether I'm on screen 1 or 2 respectively. I had the idea of creating a global variable and tying 2 values to screen number somehow, but I can't seem to find a way to do it.

Does anyone know if there is a way to change a global variable based on the number of the screen you're on?

You can try this formula in the alignement of the text

$if(si(screen)=1,left,right)$