I have a very basic App Intent extension in my macOS app that does nothing than accepting two parameters, but running it in Shortcuts always produces the error "The action “Compare” could not run because an internal error occurred.".
What am I doing wrong?
struct CompareIntent: AppIntent {
static let title = LocalizedStringResource("intent.compare.title")
static let description = IntentDescription("intent.compare.description")
static let openAppWhenRun = true
@Parameter(title: "intent.compare.parameter.original")
var original: String
@Parameter(title: "intent.compare.parameter.modified")
var modified: String
func perform() async throws -> some IntentResult {
return .result()
}
}
I looked into this further, and the openAppWhenRun
can't be set to true
in an intents extension. The purpose of the extension point is for intents that you expect to complete without a full app launch for their normal functionality (that is, I'm leaving aside error conditions that may require an app launch for the customer to resolve that error). Intents that you design to always require an app launch should live inside the main app, since that is what will wind up executing to complete that app launch.
— Ed Ford, DTS Engineer