I have about 6 complex sales email snippets that all share the same basic architecture: two optional sections (“peak” and “off-peak”) that control different blocks of text scattered throughout each snippet, along with nested snippets. These have been refined over a long time and I really don’t want to rearchitect them.
Each snippet also has a date fill-in field (a text field I fill in formatted mm-dd-yy). The rule for which optional section should be selected is simple:
- Peak: Saturday, April through October
- Off-Peak: Everything else
Right now I manually check the correct optional section checkbox every time. The problem is twofold:
- If I check the wrong one, the wrong pricing and copy goes out.
- If I forget to check either one, large chunks of the email just don’t appear in the output. I don’t notice until I’ve already filled in all the other fields (customer names, venue, dates, greeting, etc.) and the snippet has expanded. At that point I have to start over and re-enter everything. It’s a real time sink.
What I’m looking for: A way to auto-select the correct optional section (peak or off-peak) based on the date I enter in the fill-in field. Ideally something I can apply across all 6 snippets without duplicating them or converting all the optional sections to JavaScript conditionals.
I’m on TextExpander 8.4.2 on Mac. Is there a way to programmatically control optional section state from a JavaScript or shell script macro? Or another approach I’m not seeing that preserves the current snippet structure?
Appreciate any ideas.
Paul
If I understand correctly, Are you filling in the date because it is being used in various spots? It sounds to me that it would be much easier just to have 2 versions of the snippet and you simply select if you want peak or off peak. I may be misunderstanding your set up.
Get ChatGPT or Claude to help you write some apple-script to select depending on date, take that portion of code and edit it into your existing snip. To get %fill… Looking code to change to bubbles, switch between text and applescript and back after making any minor edit [like adding and deleting a space] which it needs to understand edit complete
TextExpander staff: is there a way to use non-printing “return” characters to make snippet readable but not expand the spaces and returns surrounding not selected “optional sections”
1 Like
Hi Alex,
Yes, the date is used in various spots throughout the snippet. But there’s more to it than just peak vs off-peak.
Each snippet has around 20+ fill-in fields (customer name, spouse name, venue, greeting style, event type, etc.) plus about 15 other optional sections beyond peak/off-peak (venue-specific content, greeting variations, contact info toggles, and more). And peak/off-peak aren’t just one block of text each – they each control multiple sections scattered throughout the snippet that change pricing, copy, and other details in different places. I go through the fill-in panel, enter all the details, check the relevant options, and the snippet builds a complete customized email.
Having two versions of each snippet would mean maintaining 12 snippets instead of 6, and every time I update the copy or add a venue or tweak the structure, I’d need to do it in two places. With all the nested snippets involved, that gets fragile fast.
The peak/off-peak logic is the one part that’s fully deterministic – it’s just a function of the date I’m already entering. So ideally I’d love a way to have TextExpander auto-check the right optional section based on that date input, rather than duplicating everything.
1 Like
Got it. I think it would be doable through JavaScript but would be hard to make suggestions or test without seeing your snippet/options.