A script snippet can generate text or perform an action. Use it when a fixed snippet or a calculation cannot produce the result you need.
Scripts run with your Mac user’s access. Review the source before trusting it, including any commands that change files or contact a network service.
Choose a script mode
Start with a plain-text snippet without formatted content, images, or template blocks. Expand Script and turn on Use a script.
Choose Generate text to insert the script’s output. Choose Run action when the command performs work and its output should not become snippet text.
For a small Generate text example, enter:
printf 'Hello from Tapiri.\n'
Give the snippet a recognizable name and select Quick Search only while learning the workflow.
Save, review, and trust
- Save the snippet.
- In its Script controls, choose Review and Trust.
- Read the exact saved source and its mode.
- Choose Trust This Saved Script only when you understand and accept what it will do.
- Use the saved snippet from Quick Search and inspect the result.
Trust belongs to the saved script. Editing it requires review again. Revoke Trust removes its approval. Importing a library does not import script approvals, and a full-library restore clears them.
Running scripts requires an active trial or license. Previewing a template containing a linked script shows a placeholder; it does not run that script.
Run an action without inserting text
Choose Run action in Script mode, enter the command you intend to run, and Save. Review and trust this saved version separately. Use Run Saved Action in the editor or the saved action in Quick Search. Copying a snippet never runs an action.
Read the completion or failure message. A successful action reports that no text was inserted; check the actual result of your command as well. If you cancel an in-progress action, inspect what already happened before running it again.
Understand execution behavior
Tapiri runs shell scripts through /bin/sh, one at a time, with a five-second timeout and a 64 KB output limit. Generate text needs nonempty UTF-8 output. Run action discards output instead of inserting it.
Use a command that finishes promptly. If execution fails, read the error, review the script, save any correction, and trust the new saved version. Check whether an action already took effect before retrying it.
Cancelling an operation or undoing inserted text cannot reverse files changed, requests sent, or other effects of a script.
Use confirmed template input
A script linked into a template can read confirmed field answers and pattern captures from the JSON file named by $TAPIRI_INPUT_FILE. Quote that path when passing it to commands. Tapiri does not automatically add clipboard text or app context to this input.
Use linked snippets to include the script in a larger template. Preview the surrounding content and questions first, then review the actual script execution separately.
For simple arithmetic, dates, or reusable text, the visual template controls are easier to maintain and do not require script trust.
