A Word Macro for Processing Plain Text
If you’re like me, sometimes you like to write in a plain text editor or on an iPad app, but the end result needs to be styled appropriately in Microsoft Word.[1] Here are some things I do when doing that:
- Search & replace all double spaces with single spaces.
- Replace all double-dashes (–) with em-dashes (&mdash). In the case of Onyx Path stuff, with spaces around em-dashes.
- Replace all single quote marks with quote marks. If you’re not familiar with the process, that sounds weird, but what this does is cause Word to trigger smart quotes on all such characters.
- Same as single quote marks, but for double quotes.
- Replace three dots (…) with an ellipsis character (…).
- Replace all of the multiple hard returns I’ll do with a single one. (I’ll often do two hard returns in a text editor so I can see them easily as separate paragraphs.)
- Remove all of the hanging and trailing spaces on each paragraph.
How to do all that manually
The first few are simple, as it’s just global search & replace. With the dashes and the ellipsis marks, I never remember the hot keys, so I copy one instance of the mark I want in the replace field, and I paste it into the field — pretty simple.
It’s the wildcards that can get tricky. Here’s what it should look like:

The funky bit in “Find what” is Word code for “find any times when there are two or more carriage returns in a row.” That’s how Word does “regular expressions” — and if that all looks fucking weird and arcane to you, don’t worry! It’s programmer-speak, and if you’re inclined, click on that link and learn more.
What’s in “Replace with” is the code for “paragraph break.” Why am I’m using “^13″ in Find and “^p” in Replace? That’s a thorny questions, one whose answer is either “trust me” or “read up about crazy find/replace mojo.”
The “Use wildcards” box needs to be checked, or none of this works.
Here’s what I do for the above searches:
- First, I look for all spaces trailing at the end of a paragraph. (Yes, you won’t normally see them, but they do fuck with other searches and are sloppy in general.) I search for ” {1,}^13″ (don’t include the quotes, and it does start with a space). I replace with “^p” (again, without the quotes).
- Then I look for all the spaces hanging at the beginning of a paragraph, which is both sloppy and visible. I search for “^13 {1,}” (don’t include the quotes, and there’s a space between the ’3′ and the ‘{‘). I replace with “^p” (again, without the quotes).
- Finally, I kill all the multiple paragraph marks. I search for “^13{2,}” (no quotes, and this time there are no spaces), and again replace with “^p” (again, no quotes).
Really important: I have my cursor at the top of the document. It doesn’t quite work if your cursor happens to be in the middle of one of these searches.
Oh, and make sure that when you don’t need to use wildcards anymore, that that box is unchecked.
When to do this
This is all stuff I do the moment I bring text into Word, before I process it further. I’m assuming when I do this that I’m going to do much more text processing, which means I’ll end up finding any weirdness that happens from global search/replaces.
How to not do that manually
That’s a lot of stuff to do manually every time I need to, and typing all that in every time is asking for errors. So why not make a macro! (If you’re lost here, check out the first post where I put up a macro.)
Sub SimpleSearchReplaceAll(sFind As String, sReplace As String)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = sFind
.Replacement.Text = sReplace
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub SimpleSearchReplaceAllWild(sFind As String, sReplace As String)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = sFind
.Replacement.Text = sReplace
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub ProcessPlaintextMacro()
'move to start of document
Selection.HomeKey Unit:=wdStory
'double spaces
SimpleSearchReplaceAll " ", " "
'smart double quotes
SimpleSearchReplaceAll """", """"
'smart single quotes
SimpleSearchReplaceAll "'", "'"
'em-dash
SimpleSearchReplaceAll "--", "—"
'ellipsis
SimpleSearchReplaceAll "...", "…"
'hanging space before paragraph
SimpleSearchReplaceAllWild "^13 {1,}", "^p"
'trailing space at end of paragraph paragraph
SimpleSearchReplaceAllWild " {1,}^13", "^p"
'double paragraph; do this after fixing hanging/trailing spaces
SimpleSearchReplaceAllWild "^13{2,}", "^p"
End Sub
Once that’s installed, there’s a new macro to choose from:

Select that and click on Run, and it’ll process the entire document. (Oh, and if you’re not programmer-savvy, the green lines are comments in the code that aren’t executed.)
Two notes: first, if you know how to overload a sub in VBA so that I don’t need two different versions just to turn on wildcard, I’m all ears. (That ideally works as late as 2008.)
Second, this is the building block for other macros that convert text to different house styles — all this stuff is basic, and my macros for, say, making my life easier on documents for various publishers would start here.
- Ryan
[1] Or you have freelancers who miss something when submitting turnover to you. Same methods apply.
My MisCon 27 schedule
Next weekend, I’ll be at MisCon 27 in Missoula, Montana, along with a couple of my cohorts from the Paizo office, Adam Daigle and John Compton. If you’re there, come check us out!
Here’s what I’m on deck for. In addition to this, I’ll be around to play games, chat, drink, and I’ll even have some prototypes to try out.
I’m Never Setting Foot in a Tavern Again. (Gaming)
Fri 2:00 – 2:50 PM, (Containment Room)
Pros and Guests: John Compton, Justin Farrington, Marc Johnson, Ryan Macklin
The journey of a 1,000 miles begins with a single session. You only get one chance at beginnings, whether for an ongoing campaign or a convention one-shot. Discussion will focus on techniques for getting a game off and running, including tips on preparation, techniques and the judicious use and avoidance of cliches.
Guerrilla Warfare in RPGS (Gaming)
Fri 6:00 – 6:50 PM, (Containment Room)
Pros and Guests: Ryan Goble, Ryan Macklin, Rob McDonell (Illuminati Rob)
How do you GM a resistance-based game where the PCs must fight a guerilla campaign against established, entrenched bad guys? Can they sleep safely in the woods at night, sustain themselves by hunting and gathering, and gain the assistance of local farm folk? How do they build the requisite rag tag army? What about retribution against the peasants suspected of harboring them? How do they eventually kill the evil emperor and lift the people from oppression?
Opening Ceremonies (Geek Discussion)
Fri 7:00 – 7:50 PM, (Containment Room)
Attend our opening ceremonies and watch CthulhuBob cry. Also find out what’s happening at MisCon 27.
Pathfinder: Ask Me Anything (Gaming)
Sat Noon – 12:50 PM, (Containment Room)
Pros and Guests: John Compton, Adam Daigle, Kyle Elliott, Dave Gross, Ryan Macklin
Ask the Paizo guys anything you ever wanted to know about Paizo, Pathfinder, rocket science, theology, plumbing repair, whatever.
Working With Licensed Intellectual Properties (Gaming, Writing)
Sat 5:00 – 5:50 PM, (Containment Room)
Pros and Guests: David Boop, Jim Butcher, John Goff, Dave Gross, Ryan Macklin
A discussion of the issues and pitfalls of working with someone else’s property and dealing with fan expectations of said property.
Mental and Physical Health in the Community (Gaming)
Sat 6:00 – 6:50 PM, (Upstairs Programming 1)
Pros and Guests: Ryan Macklin
A discussion about gamers dealing with depression, anxiety, and physical ailments. Using personal experiences, we explore strategies to overcome it, including tapping into our communities.
Improvisational GMing Workshop (Gaming)
Sun Noon – 1:50 PM, (Upstairs Programming 2)
Pros and Guests: Ryan Macklin
Ryan Macklin will run a 2-hour, hands-on workshop on GMing techniques, based on the problems you’re dealing with today. He’ll help you find ways to address problems with preparation and adaptation, dealing with people at the table, and executing a smooth session. Get and keep your players hooked on your game while making your GMing easier with Ryan’s help.
Getting The Most Out Of Working With Editors (Gaming)
Mon 11:00 – 11:50 AM, (The Cave)
Pros and Guests: Adam Daigle, Ryan Macklin
Learn how to find an editor, establish a good rapport with them, and how to get the most out of that relationship. Lead by editors who are Industry Insider guests!
Closing Ceremonies (Geek Discussion)
Mon 3:00 – 3:50 PM, (Great Hall)
Come see CthulhuBob cry for joy and catch a sneak peek at what’s in store for you next year at MisCon 28 May 2014.
- Ryan
Two Small Text Layout Ideas
Working at Paizo for the last few months, there are two concepts I’ve picked up on that I’m applying to other books down the road. They’re not mind-blowing ideas, but because we’re all learning this ad hoc, some techniques only get discovered as you’re working with different professionals.
Text Between Headers
If you look at Paizo products, you’ll see that wherever there’s a header, there’s at least one line of normal body copy between that at the next header. Usually it’s more substantial, but sometimes it’s just “The following may be selected at any level.” or similar.
The reason for this? It lets headers breathe on the page. They don’t run into each other, and it makes scanning on the page easier. So now when I’m working on a book, if the structure has me writing one header and then immediately after that a subheader, I stop to put something in between them. (Sometimes just “XXX” so that I know to come back to it later.)
Stop at H2s
We don’t go beyond second-level headers here, which blew my mind. As someone from a crunchy software background, getting deep with headers made sense. (I think we went down to H4s in some earlier Fate Core drafts, though not often.) So to see this limiter was interesting.
If there’s information breakdown after H2, it’s done in the body copy, with a bolded or italicized phrase & colon.
Second-Level Header
Here’s some more stuff!
Stuff 1: Stuff!
Stuff 2: More Stuff!
Stuff 3: Even more!
And you’ll notice that there’s a line in between the header and the further breakdown. (And the astute will notice that the colon isn’t styled.)
If you flip through some products (especially those over the last year, as the styles have evolved over time in both the editorial and art direction camps), you’ll see all sorts of little things like this. There’s so much I’ve learned here, which gets me fired up to come to work every day (aside from, you know, making games). Occasionally I’ll share what I’ve learned with y’all.
- Ryan
A (Crap) Argument for Boob Window Armor
I’m a huge fan of My Brother, My Brother and Me (an advice show for the modern era)[1]. One of the bits they’ll do involves occasionally giving real advice, and then when they realize they’re helping someone and not being funny, one of the hosts will interrupt with “Unless…” and then the three of them go on a laughable journey.
This has made me think about some really stupid shit in our world, like the boob window armor. I mean, it’s just there to titillate a demographic, but in the process makes a character portrayal just ridiculous and difficult to take seriously, and alienates not just women readers who are objectified, but anyone who would be embarrassed to be caught with such images in public.[2]
Unless…
(Unless…)
Unless this is a world where chakras are a source of powerful magic. And the only way to work such magic is to have your charka exposed. Sure, it makes it easy to shoot you in the heart…unless you can do totally awesome psychic shields because your heart chakra is open. That’s right, bare boob window = power.
This started as a silly idea, a MBMBaM “Unless,” and then it started to hit me: what if we were playing in such a world where magic required different chakras being uncovered? Well, there’s more than one chakra! You know what would be a fearsome sight to see on the battlefield?
Yeah, he’s not naked because he’s poor or because he’s just trying to be intimidating, but because he needs to keep all those chakras free since he’s a goddamned battle-wizard.
(Or, he’s bluffing and isn’t actually a battle-wizard, though only the bold will dare to find out.)
Anyway, it’s a pretty fucking ridiculous idea, and doesn’t justify boob window armor, but sometimes it’s interesting to take something that’s stupid and work a model that makes that something reasonable in a different world. So a setting where different magic requires different chakras to be “unburdened” is a world where some people don’t wear helmets into battle, and some people just wade in naked. Plus, dudes wearing boob window armor. And that’s kinda funny to me.
Play the Unless… game next time you see something stupid. You might hit on a usable idea, or you might just amuse yourself.
- Ryan
P.S. If you’ve read this and think I’m cheering on boob window armor, turn your literacy card in. You’re done.
[1] If you like hilarious advice podcasts, check out this sampler. And this one.
[2] In fact, I bet some people have closed this window because of the image attached.
Resistance: a Grey Ranks Hack
There are these two things that I love that, for a long time now, I’ve wanted to smash together: Grey Ranks and the Terminator resistance war.
I got to play Grey Ranks at Dreamation 2009 with Jason Morningstar facilitating it. That single convention session cemented itself as one of the strongest emotional moments I’ve had in a game.[1]
For those who don’t know what Grey Ranks is, here’s the quick pitch from the site:
In Grey Ranks, you will assume the role of a young Polish partisan before, during, and after the disastrous 1944 Uprising against the Germans. Together with your friends, you’ll create the story of a group of teens who fight to free their city, one of countless Grey Ranks “crews” that take up arms. Your characters – child soldiers – will have all the faults and enthusiasms of youth. Across sixty days of armed rebellion, they will grow up fast – or die.
I suggest that, if you’re interested in one of the rare RPGs that is actually about war and not about just winning a series of battles, read up.
I have been a Terminator fanboy forever. For my 13th birthday, my mom took me & some friends to see Terminator 2: Judgement Day. I can’t tell you how many times I’ve watched that. I love the shit out of Terminator: Sarah Conner Chronicles. I even rewatched T3 (which was not great) in preparation to watch Terminator: Salvation (also not great). But even though those movies were disappointments, I still ate up the world-building.
I still eat it up. And maybe part of the reason the Resistance War intrigues me is that, until Salvation, we heard about it the way we hear about many real words: second or third-hand, as people telling stories. It’s fascinating.
One of my favorite little bits is the slang introduced by the TV show: “I won’t be the bastard that brings metal down on the Connors.” I like “metal” over “toaster,” maybe because it sounds more natural to me?
Because Grey Ranks is truly about how war changes you and how you’re a person with desires, and because it’s a game about an occupation, it felt like a possibility for being a game that tells Tech-Com’s story. I’ve been codenaming this project “Resistance” for the last few years, but it never went beyond notes and drinking with friends (notably my good friend Justin Smith). A few months ago when John LeBoeuf-Little came up with the final piece of the puzzle that might make the game work, but I still hadn’t tried playing it until last night.
From here on, this post assumes you know what the fuck I’m talking about, in terms of both of those.
Resistance
The core story of Grey Ranks is of kids growing up during an uprising that will fail. Here, the Human Resistance is destined to win, and about the personal costs of that victory as heroes grow into battle-scarred, PTSD-suffering veterans. The tagline is “How much of a machine will you become in order to fight the machines?”
I should start off saying that there’s no time travel. If there is time travel, that’s another Tech-Com unit, not you guys, and you don’t know shit about that.
The world follows, more or less, how you’d except from the Terminator-verse, but with a sprinkling of Matrix and Battlestar Galactica — the machines have to have human collaborators, so that there’s that conflict. And Skynet has a plan for humanity that doesn’t solely involve wiping them out, which is why there are Skynet Work Camps and why the machines round people up rather than just bomb them.
Resistance takes place in the city you’re in, rather than telling you about another location. This will make the Situation Elements either difficult or vague to construct, but some of that can be solved through some setting creation, where we turn our current city into one that’s suffered machine devastation for five years.
A brief timeline that throws out factual Terminator canon, in favor of something a little simpler/easier for those who aren’t well-versed in the IP:
- Five years ago, Skynet happened. It restricted human freedoms, but didn’t immediately nuke us. It just took away all our guns and ruled over the world.
- Four years ago, the Retaking failed. Humans attempted to shut down Skynet, but Skynet saw it coming. Seeing that humans would not accept machine rule in this manner, it began creating internment arcologies, and with that nations were sundered.
- Two years ago, the First Human Uprising finally broke, its leaders’ executions broadcasted. Humans were warned that further insurgency would “forfeit humanity.”
- A few months ago, we seized an opportunity, and the Second Human Uprising began. True to its word, Skynet began slaughtering armies. It’s destined to win, but at what cost?
What Stays the Same
The grid does. The basic mechanics of a chapter does. I liked all that and didn’t want to fuck with it.
What Changes
The Trappings
First of all, all the Grey Ranks fiction trapping need to be replaced: the Radio Lightning, the situation elements, etc. Frankly, that’s the hardest (or at least most work-intensive) part, and definitely the part I haven’t touched yet.
The Characters
Naturally, as heroes of Tech-Com and not as teens growing up, the characters are very much different.
- Pseudonym becomes Callsign
- Age isn’t 15/16/17, but teen/early 20′s/pushing 30
- District shifts to Before Skynet, but I don’t know what all’s there right now. It’s not about places, but about what you remember about how the world was.
- Thing You Hold Dear only shifts slightly: “Country” becomes “Humanity” and “First Love” becomes “Romance”
- Add Role, your job in Tech-Com. Pick two off this list: heavy weapons, hacker, pilot, scout, combat engineer, demolitions (note, “commander” and similar intentionally not on this list, as to not mess with the Mission Leader bits)
- Your Reputations start off as positive, heroic things. You choose them for your character (with a healthy list, sure) When you mark off the d10 (not the d8), it becomes the negative — either going too far or going the other direction. (“Brave” could become “Suicidually Overconfident” or become “Shell-shocked.) The rest of the group decides on the new reputation for you.
- Characters need to want some sort of life beyond smashing metal.
The last part is one of this game’s darlings, the first idea I had back in 2009 about hacking Grey Ranks for the Resistance War.
Scenes
Personal scenes don’t change. Mission scenes change slightly: they always require a human extra, whether someone from Tech-Com or some civilian encountered. If you give a d10 for a mission scene, a human (extra) is killed in the process — making the contribution dice not about success/failure, but about consequence and people surviving. Success/failure feels very “teenagers in over their heads,” not “heroes of the Resistance.” And I think “cost” is a recurring theme to play with.
Feel
Because of the situation, I think we’re going to be a bit more ready to have these characters die than we do in Grey Ranks, but full-on play would tell if that’s true.
What’s New
Humanity’s “Hit Points”
This is the bit that John LeBeouf-Little came up with to make this interesting. Humanity has a list of five things about its future, and every time a mission’s lost, we cross one off. So, yes, humanity will certainly win the war, but we’re playing for humanity to not lose itself in the process (just as we’re hoping to not lose our characters in the process):
- Democracy
- Technology
- Faith & Spirituality
- Hope for the Future
- Rule of Law
I call this “Our Ideals.” I suspect that often, Technology will be the first thing to go. Humanity’s dump stat, if you will — but still, it’s an interesting choice. And if the table can’t agree, the Mission Leader chooses.
If you lose all five, the game is over. Sure, humanity beats Skynet, but what point is there in fighting for it?
The Wall
Tech-Com has an overall game sheet. Along with Our Ideals, it has a large section whose background is a bit like a war memorial, and its titled “The People Who Died So Humanity Could Live.”
Every time a human dies — from putting a d10+ in the Mission, from the corners on the Grid, from the rule below, etc — we take a moment and write down a bit about that person. If your mechanical action or narration killed someone, you write it down. If your character dies, someone else writes it down.
You don’t just write down a name, but also a little more. Here’s from our game:
- “Stickshift,” he was useful in his skinniness
- That little girl on the road in her dirty flower dress, she never saw the HKs coming
- “Jackknife” — thought it was responsible for everyone, and we loved him for it
“The New Character Rule”
A fresh character with all their Thing You Hold Dear checkmarks ready to go — that’s a valuable asset to a mission. Characters who have used all that up in a strange way become a liability. So I just, while typing this post, came up with a new rule: In between missions, if you want a new character, narrate your current character committing suicide.
(This is part of that whole “making mechanics that you hope people won’t choose, but by giving the option you make not choosing it — and choose it — have meaning.” vibe)
Always Name/Describe Human Extras
Just what it says — always name and describe them when they show up. Make humans real.
Other Stuff
I would need name/callsign lists, lists of people with different descriptions, etc.
I’m not sure how to approach chapters 1 & 10 yet.
Those are my notes for the moment. There’s clearly more work to do, if I were to fuck with this more.
A huge thanks to Justin Smith & John LaBoeuf-Little for talking with me about it, and for Kit La Touche and Lillian Cohen-Moore for testing a chapter with me last night (despite all of us being pretty tired).
- Ryan
[1] Which Jason recorded back then, all of us talking about the game after the fact.






