Ask Me Anything: TextExpander Fill-Ins

Hi, Tamaryn, here are a couple of videos that you may find helpful. Date/time macros always expand the current date and time, but you can use date math macros to adjust them.

@josh.centers I am not sure what you meant. Here is a short video with the issue. - VIDEO

@AlexBainov I noticed a few hardcoded line breaks, meaning there are empty lines that are probably being retained. Does the issue persist if you remove them? (By the way, I’m a fellow T&E lawyer practicing out of Rochester, New York.)

I re-read your earlier reply and see that you’re already aware of the empty lines causing the problem.

One workaround is to add a fillpart with a name that just has a space, like this:

%fillpart:name=optional part 1:default=no%a%fillpartend%
%fillpart:name= :default=no%%fillpartend%
%fillpart:name=optional part 3:default=no%c%fillpartend%

A more elegant solution is to use nested snippets. Create a new JavaScript snippet that takes the content of the existing snippet and removes empty lines. This is working for me:

let input = `%snippet:your_existing_snippet%`;
let cleaned = input
  .split('\n')
  .filter(line => line.trim() !== '')
  .join('\n');

cleaned;
let strVSARefund = "[variable here that would be called VSARefund]";
let numVSARefund = parseFloat(strVSARefund);
let formattedVSARefund = numVSARefund.toLocaleString("en-US", { style: "currency", currency: "USD" });

let strPPMRefund = "[variable here that would be called PPMRefund]";
let numPPMRefund = parseFloat(strPPMRefund);
let formattedPPMRefund = numPPMRefund.toLocaleString("en-US", { style: "currency", currency: "USD" });

let strGAPRefund = "[variable here that would be called GAPRefund]";
let numGAPRefund = parseFloat(strGAPRefund);
let formattedGAPRefund = numGAPRefund.toLocaleString("en-US", { style: "currency", currency: "USD" });

let strTWRefund = "[variable here that would be called TWRefund]";
let numTWRefund = parseFloat(strTWRefund);
let formattedTWRefund = numTWRefund.toLocaleString("en-US", { style: "currency", currency: "USD" });

let result = `

VSA Refund: ${formattedVSARefund}
PPM Refund: ${formattedPPMRefund}
GAP Refund: ${formattedGAPRefund}
TW Refund: ${formattedTWRefund}

`;


result;



Thanks, @HaniSarji . I’ll try this out.

Thank you very much Alex!!

1 Like

@HaniSarji Tested this and it works great as a solution for me. Very creative/clever one. Thank you so much!! Appreciate it. I only added an additional \nso that still adds a line break after each description (but deletes extra blanks).

P.S. I will keep in mind for T&E for Rochester if ever have come across situations there. If you need any help in Manitoba, Canada, do not hesitate to reach out. If any other province, I have contacts in some other provinces, so do not hesitate to reach out if needed.

2 Likes

Is there a lengthy discussion somewhere or text as well as the video. This went way over my head, but I understood just enough to know this is exactly what I need.

Say a patient has one of the primary criteria for a diagnosis. Then it would be nice for the pop-up to show the next major criteria or criterion

Some patients may not meet full criteria or maybe subclinical symptoms of a medication side effect for example, or only Meeting 5 out of 9 symptoms but but still still having just a severe side effect.

If then type thinking-
That is some next level.

In short, I’m using text expander like a Neanderthal

1 Like

This would be amazing for a law practice as well. I believe that TextExpander runs through a snippet one time, not recursively.

A workaround might be to give the user questions (really instructions) that walk the user through an analysis.

So, instead of a dropdown, the user would see something like this:

Is x true? 
- Yes: Type ,x.t
- No: Type ,x.f

What the user types will trigger other snippets that ask the next question until the user is given with the final analysis.

Once the analysis is done, you can create a clean-up snippet that takes the entire content and returns only the parts you need.

I’m going to try this with my retainer agreements. I’m thinking that the last step might be to convert the entire questionnaire into LaTeX, since I’m also experimenting with LaTeX to typeset my documents. My LaTeX document has variables but they are cumbersome to fill in manually. The idea of going from a guided interview (with branching logic) to a final deliverable is quite compelling.

1 Like

Definitely has potential to improve my flow. Ill have to redo some templates abd ultimately have a typed and printed list too the side at least til I get used to it.. The idea may seem simple, but Ill need to play with it a bit.

Maybe shorten my snippets too and just have 2-4 times as many might expedite so not to far down any path and then not qualifying or meeting the criterion. I think what I’m trying to say is, I’ll have to.Plan it first then build it!

That would be ideal. If you have the analytical steps already, then creating snippets for them is just some extra effort.

Another approach that has worked tremendously well for me is a modular approach. I build the basic framework (here, the cleanup script at the end is probably the most important), and then I add “scenarios” as I go along.

So, for my retainer example, I might start with just one client and one type of retainer (estate planning). Then I might add another scenario (estate administration for a will, i.e. probate), and then another (estate administration for an intestate estate).

The benefit of this approach is that I come across clauses (or snippets) to use as I read cases and get more experience. I’m only modifying one snippet that gets called instead of an entire program.

If you want something allows branching, then you might want to look into docassemble, which is an open source software that enables the exact type of interviews we want: https://docassemble.org/ You can deploy an instance on your local machine or deploy it on a server, such as AWS. But there is a steep learning curve and things aren’t always intuitive. Right now, I’m learning about objects and how to pickle them using docassemble. I can do things in plain vanilla Python code, but I’m still trying to figure out how to do them the docassemble way. (The upside is client-facing interviews, which might be worth the effort.)

1 Like

Every time I add an optional section when I use TextExpander, it’ll have the text underneath the optional section in red. I saw a similar one from someone else, and all they had was the text (without the expansion). I tried to recreate it but wasn’t able to.

I want to recreate:

[toggle box a] Title Text a
[toggle box b] Title Text b

However, whenever I do it, I get

[toggle box] Title Text A

Expanded text a in red

[toggle box b] Title text b

Text expanded b in red

Hi, @pranayparikh, can you share a screenshot of the Snippet in the Snippet Editor? I think I know what’s happening.

Not sure if this is the right area, but I was hoping that you would be able to do a multi clipboard only using text expander because the content stays local versus I don’t wanna accidentally getting clipboard contents of confidential information being sent

But I did realize if you’re using text expander to do a progress note and it’s you’re wanting it for organization. The old copy and paste is still very effective but using it within text expander so I can now copy any lab results that are abnormal and place them into a fill-in multi line.

I can also create a section for EKG results

I can also create a section for any notes that were reviewed from the previous clinician or their primary care and have it all organized in one snippet for the progress note.

When you’re trying to do this efficiently and sometimes charts aren’t as well organized as they need to be being able to do this on the fly is like removing a major pain point for me

A way to lock snippet to Prevent closing before your ready to hit OK. Or ENTER. Preventing premature Closing or ending ?

Yes, see below

1 Like

@pranayparikh It looks like the pop-up is displaying the first optional section twice? Everything looks correct in the Snippet editor. I recreated the Snippet and it works as expected for me. @Rextexpander, any idea what’s happening here?

@pranayparikh Would you be able to share a larger screenshot of how your snippet is set up in the editor? Do you have any other fill-ins named the same thing as your optional section?