I'm trying to receive a list of Notes from Apple Notes as a shortcut parameter. Some testing shows that I can receive them as String
or IntentFile
(RTF format), like so:
struct NoteIntent: AppIntent {
static var title: LocalizedStringResource = "Use Note"
static let description: LocalizedStringResource = "Use a Note."
@Parameter(
title: "Note",
description: "Apple Notes item"
)
var note: [IntentFile]
static var parameterSummary: some ParameterSummary {
Summary("Use \(\.$note)")
}
@MainActor
func perform() async throws -> some IntentResult {
return .result(value: note.first?.fileURL?.absoluteString)
}
}
But the IntentFile
type does not carry the usual metadata on each Note like summary, folder, tags, creation date and last modified date. I can only infer note the title from the file name. Is there a more appropriate parameter type that would allow me to receive the Note contents along with its metadata?