Action
Summarize Draft
Posted by agiletortoise,
Last update
1 day ago
Asks the local, on-device AI to summarize the content of the current draft
This action is meant as an example action to demonstrate the use of SystemLanguageModel
scripting. (docs)
(requires iOS/macOS 26 + Apple Intelligence)
Steps
-
script
// CREATE A PROMPT TO SEND TO MODEL const prompt = `You are a newpaper copywriter. Provide a brief summary of the text below (approximately 200-300 characters in length): ${draft.content}` // CREATE MODEL OBJECT let m = new SystemLanguageModel() let response = m.respond(prompt) // IF TAGS RETURNED, PROMPT TO SELECT AND ASSIGN if (response) { let p = new Prompt() p.title = "Summary" p.symbolName = "brain" p.message = response p.addButton("OK", "OK") p.show() } else { alert(m.lastError) context.fail() }
Options
-
After Success Default Notification Info Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.