Detect preview mode

Just a quick question.
Is there anyway to detect preview mode in scripts? Something like this

if inPreviewMode:

Yes. See system.util.getSystemFlags().

1 Like

Thank you very much.

Any ideas on how to do the equivalent in Perspective? I know the designer can tell when you are/are not because of how it handles click interactions with the page, but I am not sure if Perspective itself is able to tell in any way.

Would be a nice feature to have in the session props if not.

IIRC, there are a number of session props that only work in a real Perspective client. Look at those.

Yeah I can use a couple to determine if I am in a designer or if I am in a browser/app, but nothing to show Preview mode or not. At least nothing immediately visible in the session props.