Dynamic autotext?

User-to-User discussion about the PhraseExpress macro programming.
Post Reply
posthocrobot
Posts: 5
Joined: 11 May 19, 23:30

Dynamic autotext?

Post by posthocrobot » 11 May 19, 23:35

What I want to accomplish is this:

A phrase that will activate when the letter "t" is typed after any number, e.g. 1t, 20t, 1.34t, and will incorporate that number into the phrase content, e.g. Give 1 assignment, Give 20 assignments, Give 1.34 assignments...

Is that possible?

Kind regards and thank you for your time,

Edwin

posthocrobot
Posts: 5
Joined: 11 May 19, 23:30

Post by posthocrobot » 12 May 19, 00:50

So, in essence, what I was thinking is utilizing the RegEx /(\d+(?:\.?)\d+)t/g for matching purposes and to allow back referencing to the number. Is that possible?

posthocrobot
Posts: 5
Joined: 11 May 19, 23:30

Post by posthocrobot » 12 May 19, 01:03

EDIT: THIS RegEx (\d+\.?\d*)t.

Peter Stotz
PhraseExpress Expert
Posts: 761
Joined: 27 Feb 08, 15:07

Post by Peter Stotz » 12 May 19, 11:59

Hi Edwin,
"Dynamic Autotext" - an interesting idea...
But not yet possible, as far as I know.

For quite different prefixes my suggestion is a macro like this with autotext e.g. #t :
{#SHIFT {#HOME}}{#clipboard -cut}{#balloon -title Inherited value: >{#insertclipboard}< -onclick {#insertclipboard}}
Use:
Type in a prefix followed by the autotext #t
3.1415#t ______ → 3.1415
text#t_________ → text
word1 word2#t _ → word1 word2

Peter
Windows 10 - PhraseExpress v14.0.143

posthocrobot
Posts: 5
Joined: 11 May 19, 23:30

Post by posthocrobot » 12 May 19, 23:43

I figured that out last night. :) So, I don't need to capture the group with RegEx, but, how to implement the dynamic autotext? Ideally, it would be nice if the autotext could be \d+\.?\d*t so that it is triggered anytime "t" is typed immediately following a number. But, I cannot find out how to do that.

posthocrobot
Posts: 5
Joined: 11 May 19, 23:30

Post by posthocrobot » 12 May 19, 23:45

Peter Stotz wrote:
12 May 19, 11:59
Hi Edwin,
"Dynamic Autotext" - an interesting idea...
But not yet possible, as far as I know.

For quite different prefixes my suggestion is a macro like this with autotext e.g. #t :
{#SHIFT {#HOME}}{#clipboard -cut}{#balloon -title Inherited value: >{#insertclipboard}< -onclick {#insertclipboard}}
Use:
Type in a prefix followed by the autotext #t
3.1415#t ______ → 3.1415
text#t_________ → text
word1 word2#t _ → word1 word2

Peter
Windows 10 - PhraseExpress v14.0.143
This is definitely a step in the right direction! I'll use this implementation for now until something more intuitive can be implemented. Thank you!

Post Reply