One of the email clients I use quotes replies by converting
this is a line I need to reply to
to
>this is a line I need to reply to.
At an absolute minimum, that should have a space after the chevron. So I built this:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Action: Abort if no clipboard text ""
0002 String: Assign from clipboard text ""
0003 String: Replace text ">=>space$"
0004 Clipboard: Assign text "string$"
(End)
Basic but straightforward.
However, what I'd LIKE to be able to to is take a block of text, strip the quote marks off it, rewrap it to a -- say -- 72 character line width, then put the quotes back -- and bearing in mind that some of the source text might be quoted already so might need doubled chevrons.
I used to use a mail client that could do that -- might have been The Bat! but (for unrelated reasons) I won't use it anymore. :)
So I thought maybe I could make a script that could do something like that -- but I can't find a way to do the rewrap element. I could probably find a way to handle multi-level quoting on a line-by-line basis, with some thought, but the rewrap element is beyond me.
So... any chance of a function that could rewrap plain text to a specified width, while respecting paragraph breaks? :)
Quote from: oblivion on April 30, 2026, 05:38:47 PMany chance of a function that could rewrap plain text to a specified width
Done for the next release. :) But check your email to get it now.
(https://www.alomware.com/images/forum/word-wrap.png)
awesome! Thanks!
Hiya -- sorry, the rewrap isn't quite right, I don't think.
It's preserving all line ends, so the rewrap doesn't quite work as intended.
If I rewrap this paragraph in this environment, it'll probably work, because it's a single line being wrapped by the window manager, but in my email client, there'll be a <cr><lf> pair at the end of every line and two between paragraphs.
So what I want to be able to do is
rewrap a paragraph that's only really apparently a
paragraph but is actually a group of lines
of varying lengths
into something that looks like a genuine paragraph.
Like this:
So what I want to be able to do is rewrap a paragraph that's only really apparently a paragraph but is actually a group of lines of varying lengths into something that looks like a genuine paragraph.
I assume it works this way because the mail client has already rewrapped the original email and put newlines in so the inserted chevrons are always at the start of the line.
Also -- sorry, this is only related in my head -- once I've rewrapped the paragraph, I want to requote it, so I'm using
String: Replace text "~=~>space$"
to replace a newline with a newline followed by a chevron and a space. It works -- but I only found out tilde was a newline by accident in the help for a different command and thought I'd try it before designing a loop through the rewrapped text line by line.
Saved me lots of work but it should be in the help for the String: Replace text command :)
In case it's helpful, my current action looks like this:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Action: Comment "Remove quote chevrons, rewrap and put quote marks back with an extra space"
0002 Action: Abort if no clipboard text ""
0003 String: Assign from clipboard text ""
0004 String: Replace text "~>=~"
0005 String: Word wrap at "68"
0006 ;String: Replace text "~=~>space$"
0007 Clipboard: Assign text "string$"
(End)
I think you want the "String: Remove line breaks" step:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 String: Assign "So what I want to be able to do is~rewrap a paragraph that's only really appar¬
ently a~paragraph but is actually a group of lines~of varying lengths~into something that looks lik¬
e a genuine paragraph."
0002 String: Remove line breaks "1"
0003 Alert: Show a message "string$"
(End)
So this:
So what I want to be able to do is
rewrap a paragraph that's only really apparently a
paragraph but is actually a group of lines
of varying lengths
into something that looks like a genuine paragraph.
Becomes this:
So what I want to be able to do is rewrap a paragraph that's only really apparently a paragraph but is actually a group of lines of varying lengths into something that looks like a genuine paragraph.