Detect preview mode

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

if inPreviewMode:
    doSomething()

Yes. See system.util.getSystemFlags().

1 Like

Thank you very much.