Page 1 of 1

UI text input char replace

Posted: 05 Aug 2017 12:29
by yogi108
Hi,

Just got the following working:

text = getTextById("com.p1.chompsms:id/new_message_field");
text=replace(text, '“', '"');
setText2ById("com.p1.chompsms:id/new_message_field", text);

Normally I want the character " for scripting, in the case above typing SMS.
If the character “ appears, it should be replaced with ", hope you see the little difference.
It works with chomp SMS because I got the text id.

Could this be done global as well?
Package with *
Getting the textfield id which has focus, replacing the character and writing the new value back?

Thanks a lot,

Re: UI text input char replace

Posted: 05 Aug 2017 19:03
by Martin
Hi,

You could try to get this working with trigger UI Event and Event Type Text changed.
I think there are some examples in the flow sharing forum that used this feature to replace some abbreviations to the longer form while typing.

Regards,
Martin

Re: UI text input char replace

Posted: 06 Aug 2017 11:06
by yogi108
Hi Martin,

I found the flow text expansion and will have a deeper look at it,

Wie immer Danke :-)
LG