Instead of making openAppWhenRun dynamic, store a flag in UserDefaults I think this way you will prevent the the shortcut from triggering