Action
Move to Reminders
Posted by agiletortoise,
Last update
1 day ago
Parse natural language reminders from the selected lines. Once parsed, show a confirmation of the planned reminders before continuing, then continue.
Default instructions tell model to look for #ListName to assign a reminder lists - the list must already exist. It will parse out date time values as due dates.
This action requires Chat Console support (OS 27 or greater, Apple Intelligence enabled).
By default, uses Appleās Private Cloud Compute model for parsing.
Steps
-
script
// get information const [st,len] = editor.getSelectedLineRange() let selectedText = editor.getTextInRange(st, len) let lines = selectedText.split("\n") let cleanedLines = [] // loop over lines, adding non-blank lines // also clean up line, removing any list/task prefix for (line of lines) { let trimmedLine = line.trim() // remove whitespace trimmedLine = trimmedLine.replace(/^[-\* \[\]x]+/, "") if (trimmedLine.length == 0) { // skip blank lines continue } cleanedLines.push(trimmedLine) } if (cleanedLines.length > 0) { // setup session let model = new ModelSession() model.mode = "pcc" model.addToolSet("reminders") model.addInstruction(`Your primary purpose is to create a new reminder for each line in the prompt text. If the line has a # character, compare the text that follows it and if it matches the name of an existing list, create the reminder in that list and remove the list name from the text. Look for date and time information in common formats and natural language and if found, strip that text from the line and assign a due date based on that information. Assume a day name is the next future date of that day, looking for modifiers like "next" and adjust date. Also try to parse things like "in 2 weeks", etc. and find times in formats like 2pm, 3:15, etc. Assume your prompt is the full text to parse, and return a short summary of the work done, but do not actually create the reminders until a follow up prompt confirms the plan. After a confirmation, return a simple non-detailed summary, like "3 reminders created"`) // pass lines to model to parse and display work plan let response = model.respond(cleanedLines.join("\n")) let p = new Prompt() p.title = "Work Plan" p.message = response p.isCancellable = true p.addButton("Continue") if(p.show()) { // user confirmed, tell model to go ahead and create the reminders let response = model.respond("Create those reminders") alert(response) } } else { // no tasks to create alert("No tasks found, please select lines first") 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.