I was recently asked on Twitter if I knew a way of generating filler or placeholder text and I use Keyboard Maestro to do this usually.
My macro asks me how many paragraphs I want (usually 5) and then creates however many paragraphs I need - I only have 5 different paragraphs in there because that's enough for me that the text doesn't look regular.
To create any number of paragraphs I'm using a For Each together with a modulo calculation, I prefer to have an extra line break between each paragraph, hence formatting things the way they are - you could of course adjust this, but mine is setup so it works in Markdown.
Great idea for a macro; I've had a lorem ipsum text snippet for a while, but never thought to make the number of paragraphs adjustable in a macro like this. I do see a way it can be improved though:
This way, you don't have to account for the different Index variable values ahead of time, or otherwise hard-code different scenarios with a Switch/Case action; you can just enter the number of paragraphs and the macro will automatically create however many you enter.
The reason for the micro management is so that I can have 5 different paragraphs - originally my macro was like yours but having the same text repeated 5 times is rather obvious
Aha, now I understand. Having different text for each paragraph is something I never even thought of for filler text; this is really clever, and I happily stand corrected.
I do still have two suggestions for this macro, though: using variables instead of the clipboard (though of course this is only necessary if prefer to not have your clipboard history cluttered), and including a notification action at the end so you know that the macro executed successfully and that the text is ready to paste:
Adding them to the clipboard to be precise, but yes! In my day job I'm a web developer and somewhat regularly need placeholder text because I'm building something that will contain some text at some point - but doesn't yet
Bear in mind, despite some of our customers using KM, I have used it for less than an hour I do a ton of AppleScript and shell scripting, hence my succinct approach…
The shell script results can also be put on the clipboard (or whatever), as the need dictates. I used it to directly paste into a Markdown document in DEVONthink Pro Office (though it would obviously work in plain text, rtf, HTML, Formatted Notes, etc. too)
It could be easily done in pure AppleScript as well, but the shell is sexay (and powerful)!!
NOTE: to any curious/interested passers-by… The shell can be a very dangerous place. So don't treat my cavalier comment as a general beckoning to jump into Terminal and start messing about. Very bad things can happen, if you're not careful. And I have said for many years: In the shell, there is no forgiveness.
I am happy to have an expert for DEVONthink marry in the forum @DEVONtech_Jim.
Every day I think about how I can improve my workflow with it. Thanks to KM, this is also possible for me as a layman, without extensive knowledge with scripts.
Whenever I run either version (Rosemary's or gglick's), there is no difference between the output for 4 or 5 paragraphs; if I select the default of "5", the fifth paragraph is not included (the one that begins with "Pellentesque in maximus turpis."). Not a big issue, of course, but I can't see where the macro goes wrong, and that's a bit crazy-making!
(I'm a bit late to the party, but I've just seen this in the periodic KM Discourse summary.)