Skip to main content
Solved

Is it possible to trigger off of a variable change

  • July 19, 2023
  • 2 replies
  • 763 views

Tricia_Spoonts

It appears that when you change a variable mode e.g. from light/dark mode it does not trigger a selection or document event. Is there an event that you can hook into on a variable mode change that may not yet be documented.

Best answer by tank666

I just tested, the documentchange event fires when the variable mode changes. This event does not fire only when you switch from the first mode to auto and vice versa.

This is because the PROPERTY_CHANGE event type does not yet support the explicitVariableModes property.

This topic has been closed for replies.

2 replies

tank666
  • 4873 replies
  • Answer
  • July 19, 2023

I just tested, the documentchange event fires when the variable mode changes. This event does not fire only when you switch from the first mode to auto and vice versa.

This is because the PROPERTY_CHANGE event type does not yet support the explicitVariableModes property.


Tricia_Spoonts

Thank you @tank666 I see that it was not firing because I didn’t have any colors in my test document that changed. Never start coding after 11pm 🙂