Plug-In: AFM • Prompt Tester

REQUIRES: macOS 26, iOS 26, iPados 26, visionOS 26 • OmniFocus 4.8

This plug-in will display a text input, into which you enter a prompt for the Apple Foundation Models. The response will be logged to the application console window.

(⬇ see below ) Prompt Tester plug-in on the Automation Console toolbar:

Prompt Tester plug-in on Console toolbar
ALM • Prompt Tester
  
/*{ "type": "action", "targets": ["omnifocus","omnioutliner","omniplan","omnigraffle"], "author": "Otto Automator", "identifier": "com.omni-automation.all.prompt-tester", "version": "1.1", "description": "This plug-in will display a text input, into which you enter a prompt for the Apple Foundation Models. The response will be logged to the application console window.", "label": "Prompt Tester", "shortLabel": "Prompt Tester", "paletteLabel": "Prompt Tester", "image": "apple.intelligence" }*/ (() => { var preferences = new Preferences() // NO ID = PLUG-IN ID const action = new PlugIn.Action(async function(selection, sender){ try { storedPrompt = preferences.readString("storedPrompt") if(!storedPrompt){ storedPrompt = "PROMPT-GOES-HERE" } shouldUsePasteboard = preferences.readBoolean("shouldUsePasteboard") if(!shouldUsePasteboard instanceof Boolean){ shouldUsePasteboard = false } inputForm = new Form() textField = new Form.Field.String( "textInputValue", null, storedPrompt ) checkSwitchField = new Form.Field.Checkbox( "shouldUsePasteboard", "Use clipboard text for prompt", shouldUsePasteboard ) inputForm.addField(textField) inputForm.addField(checkSwitchField) inputForm.validate = function(formObject){ shouldUsePasteboard = formObject.values["shouldUsePasteboard"] if(shouldUsePasteboard){ if(!Pasteboard.general.hasStrings){throw "No text on clipboard"} return true } textValue = formObject.values["textInputValue"] textStatus = (textValue && textValue.length > 0) ? true:false return textStatus } formPrompt = "Enter prompt:" formObject = await inputForm.show(formPrompt, "Continue") shouldUsePasteboard = formObject.values["shouldUsePasteboard"] console.log("PROMPT:", prompt) if(shouldUsePasteboard){ var prompt = Pasteboard.general.string preferences.write("shouldUsePasteboard", true) } else { var prompt = formObject.values["textInputValue"] preferences.write("shouldUsePasteboard", false) } preferences.write("storedPrompt", prompt) console.log("PROMPT:", prompt) session = new LanguageModel.Session() response = await session.respond(prompt) console.log("RESPONSE:", response) } catch(err){ if(!err.causedByUserCancelling){ console.error(err.name, err.message) new Alert(err.name, err.message).show() } } }); action.validate = function(selection, sender){ version = Number(Device.current.operatingSystemVersion.versionString) return (version > 25) }; return action; })();