Trim Text
Remove whitespace around entered text
This Rule gives you a small text-cleaning prompt when a copied value has unwanted whitespace at its edges. You supply the text, Rulr applies Trim, and the cleaned result goes to the clipboard for use in another app.
When: The exact phrase ;rulr is typed. Do: Ask for input, transform that input with Trim, and copy the transformed Text Result. There is no If Condition. The prompt is configured to stop the Rule when cancelled, so cancellation should not continue to the clipboard Action.
Configure and try it
- Import with Open this Rule in Rulr and review Text Typed. Replace the trigger with a distinctive phrase if
;rulrconflicts with another routine. - Check the input prompt and keep Transform Text connected to the prompt’s Input Variable. Keep Set Clipboard to Text connected to the transformation result.
- Grant Accessibility access for the typed Trigger. Enable the Rule and enter the phrase in a temporary document.
- Supply a value with spaces or line breaks before and after the meaningful text. Paste the result into a temporary note and compare it with the input. Try cancelling the prompt on a second run.
Requirements and limits
Text Typed and Transform Text require Rulr Pro. The source is the text entered into the prompt; the sample does not automatically read a selection or the previous clipboard content.
Trim removes surrounding whitespace rather than rewriting internal spacing, fixing grammar, or changing letter case. Copying the result replaces the previous clipboard text without pasting it automatically. For encoding a clipboard value and inserting it directly, see Paste URL-Encoded Text.