Device.isUsingDarkAppearance() always returns false in Shortcuts

I have this script

// IsDarkMode
Script.setShortcutOutput(Device.isUsingDarkAppearance())
Script.complete()

Works fine in Scriptable. But always returns false when call in in Shortcuts via the Run Script action. Is this a bug with Scriptable or Shortcuts?

It’s an odd issue. I have made a script similar to yours and I’m seeing the same behaviour. However, if I close Shortcuts from the multitasker and reopen it before running the shortcut, it will always report the correct appearance.

I’m not yet sure why this is happening but it could be an issue with Shortcuts. I’ll dig a little further.

1 Like

Thank you. Yes, it looks like a Shortcuts issue. It follows whatever the mode at when Shortcuts was launched after force closing it.

If I launch Shortcuts in dark mode, it will always return true even if I toggle dark mode while still in the Shortcuts app.

If I close the app and toggle back to light mode and launch Shortcuts, it becomes always false then.