TextExpander need for Find and Replace


#1

Hi there!

I am a huge TextExpander user in my podiatric medical office for my clinic notes. It’s terrific and saves me hours of typing each month.

I would like to create a PopUp selection to pick the type of local anesthesia I use (I use 3-4 different mixes). Unfortunately each of these PopUp selections use the % (percent) sign. I have talked with Smile and right now the % sign is not useable in the options (i.e. answers) in the PopUp selection.

I’d like to use some type of text, [pct] for example, in the snippet options and then run some type of automation that will find and replace [pct] with % after the snippet is expanded.

I hope I have explained myself correctly, and appreciate any suggestions. While I am pretty good at making TE do my bidding, I have precious little experience in AppleScript or JavaScript. Maybe I could do it in Applesoft basic. :wink:

Thank you!

Mike


#2

I have a simpler solution for you, though I know nothing about anaesthesia mixes which may show here! Why not simply put a % after the choice box?


#3

I’m a police officer and I use TE everyday at work to create my daily activity report. One portion of my sheet asks for the % of oil remaining (in my radio car) I finally figured out was Rosemary advised. It works perfectly fine.


#4

Thanks to you both for your replies.

I should have given you this information before. Two of the specific mixes are:

1% xylocaine with epinephrine diluted to 1:200,000 with 0.5% marcaine plain
and
1% xylocaine plain mixed 50/50 with 0.5% marcaine plain

So, adding the % afterwards doesn’t work in these situations, unless I split the snippet into 3 parts for each snippet, which reduces the convenience substantially.

What I was thinking is spitting out the snippet:

1[pct] xylocaine plain mixed 50/50 with 0.5[pct] marcaine plain

and then running some type of script to go back and change the [pct] to %.

I hope that makes more sense, and again, I appreciate the discussion.

Mike


#5

Here’s an example of how I deal with this sort of limitation in TextExpander. I’ve run into it in different circumstances, but it is effectively the same issue of the format constraint.

Set-up a new JavaScriot based snippet and paste in the code below.

//Formula pairs [Description : Formula Details]
let jsonData = JSON.parse(`{
"Formula 1" : "2% Na, 1.5% K (by volume)", 
"Formula 2" : "0.25% Fe, 0.25% Na (by volume)", 
"Formula 3" : "0.15% Ag, 0.1% K (by volume)"
}`);

// %filltop%

jsonData["%fillpopup:name=Select the formula details to use:Formula 1:default=Formula 2:Formula 3%"];

This provides three formulas (by name) in a fill in pop-up, which the script then uses as the basis for a lookup in a set of JSON formatted data (key value pairs). The value is returned and output by the script. The key point is those values can have whatever content you want in them, including percentages.

This saves you having to have a two step process, and I actually often find it easier to maintain a JSON list like this rather than a complex pop-up. By naming things it just becomes much easier to use as a lookup I think. But that’s potentially just a personal preference.

Hope that helps.


#6

Thank you sylumer, I think that will work. I believe I can edit your script to work for me.

Thanks!

Mike


#7

Just as another alternative option for anyone who might need to use % or : in snippets, I would recommend looking into aText, which is an app like TextExpander, but which does not use % or : in its placeholder-text. aText will also import most TextExpander snippets.

(It’s also a $5 one-time purchase instead of a subscription; however, there is no iOS app.)


#8

Or a Windows client app.


#9

Thanks TJ. I am way too invested in TE to switch now, but a good alternative.

I was also thinking that I could use Keyboard Maestro for the few snippets that need some verboten characters, too.

Will play with both of these options this weekend.

Mike


#10

If you have Alfred with power pack you can use it too for text expansion


#11

Follow up a month later: there’s a new beta of TextExpander which supports %!

Power users will also find that they can now use % and : in a fill-in or popup.


#12

That’s great! Thanks for the heads up!