You can't dynamically set openAppWhenRun. You need to create a new AppIntent with openAppWhenRun = true, and call it from you existing AppIntent using return .result(openIntent: NewAppletName()). The Dive into App Intents video has an example of this. at 17:19.