[MOD][XPOSED] Macro / Text Expansion

Search This thread

mikmitch

Senior Member
Jul 18, 2008
71
138
Tallahassee
Automatically expand text sequences in any text box in (almost) all apps!

Featured on XDA-portal. Thanks to @Will Verduzco (willverduzco) for the article!

This is an Android Xposed module to perform Macro / Text expansion. The module allows short key sequences to be transformed into other, usually more time-consuming, sequences of keystrokes. This means that frequently used or repetitive sequences of keystrokes can easily be automated. Since it uses Xposed and operates at the text widget level, it works with all factory and third party keyboards, and can be added to user dictionaries for even faster use.

After creating my fun I am Groot module, I thought I'd do something more practical with run-time text processing using Xposed.

Screenshots
t105RI9.png


h4hYchT.png



Requirements

Instructions
  • Download apk from Xposed Module Repository
  • Install module as a normal apk
  • Open Xposed Installer and click checkbox to enable
  • Reboot device to activate module

Download
v1.2 - Xposed Module Repository


Tips & Hints
It's best to set the macro phrase to a term that is not normally used in conversation, since all instances of this phrase will be replaced.
For example, using the macro 'address' to denote your home address would be a poor choice, since this would change a statement like 'enter your email address' into 'enter your email '123 xyz street'
A better choice is to add a symbol and set the alias to something like '@addr' to prevent inadvertent text expansion.
Changes to macro list require reboot to activate.


AutoHotKey import file notes
  • Import macro lines that match ::macro::expansion
  • Does not yet handle AutoHotKey wildcards/regular expressions
  • Lines containing non-ASCII characters are also ignored
  • Enable import/restore debug logging to troubleshoot missed macro issues
Any AutoHotKey text file should be importable without modification.
If the module is not able to handle the macro (yet) it will simply ignore the line.
The module does not have an upper limit on the number of macros that can be entered/imported, but performance will degrade on significantly large lists, especially on older devices.


Known Issues
FC issue with MultiAutoCompleteTextViews; temporarily disabled
Not yet working in web browsers & WebViews; work in progress
Macros should be functional with these browsers: Atlas, Dolphin, Now Browser Extended
Limited/no function with these browsers: AOSP, Chrome, Chrome Beta, Now Browser Pro
Support for these in progress


Disclaimer
I try my best to thoroughly test everything I publish, but given the staggering number of devices, ROMs, and apps I cannot make any guarantee that something will go wrong. Use at your own risk!


Source code
This module is open source software, available on my Github page, licensed under the Apache 2.0 license
If you are a developer and want to contribute, fork the repo and submit a pull request.


Credits

Problems/feedback
  • If you find this useful, click thanks!
  • If something is broken, let me know and I'll try my best to fix it!
  • If a feature is missing, suggest it and I'll try to add it!
 
Last edited:

mikmitch

Senior Member
Jul 18, 2008
71
138
Tallahassee
Changelog

Version 1.2 (current)
  • Backup/export & restore/import macro list in AutoHotKey & JSON formats
  • Support for MultiAutoCompleteTextView boxes
  • Option to disable macro expansion in password boxes
  • Option to make macro expansion case insensitive
  • In-app about/support/donation links

Version 1.1
  • Removed the regular expression restriction from macros
  • Update minimum SDK for ICS support (API Level: 14 and up)

Version 1.0
  • Initial release
 
Last edited:

chavocarlos

Senior Member
Mar 6, 2011
446
110
Guayaquil
Mmmm good work, but I will pass, I prefer to fight with my lazyness instead to save sensible data in the phone or third app with root access. Anyways good work dude!.
 

-V-O-Y-A-G-E-R-

Senior Member
Jun 6, 2006
394
89
\dev\null -yu
www.mariotomic.com
I was sooo happy when I saw this module tonight, but soon realized that it's not really usable for me. Just because those chars that are forbidden because reg exp.

I use similar app on OS X and BlackBerry has it natively. I replace m@ with my email and a number of Skype smiles (cch becomes (chuckle)), but because of those limitations, none of the above examples cannot be actually used.

Could you please explain more in detail what exactly seems to be the problem with those banned chars? Could there be an option to switch them if user needs them?
 

mikmitch

Senior Member
Jul 18, 2008
71
138
Tallahassee
I was sooo happy when I saw this module tonight, but soon realized that it's not really usable for me. Just because those chars that are forbidden because reg exp.

Thanks for the feedback. I've been able to correct the issue and have removed the regular expression restriction. The updated module has been pushed to the Xposed Module Repository. Let me know if you have any more issues!
 

DrRuckingFetard

Senior Member
Sep 5, 2013
124
14
Sydney
I was looking for a way to get the look of disapproval --> ಠ_ಠ into a keyboard emoticon list but now with this mod i can insert it via a macro shortcut.. probably not really the purpose of the module but until I can think of something more productive to add in there it's just for that haha :highfive:

good work!
 
  • Like
Reactions: desertmod1

undaclazz

Senior Member
Oct 14, 2011
229
70
Yogyakarta
Nice, Now I can make shortcut on Swiftkey... but it requires reboot everytime I add new shortcut? Would be nice if we can add on the fly ... :D
 

MattKneale

Senior Member
Feb 7, 2011
96
15
Fantastic module!

I can foresee this have having some problems with LastPass fill for long, random passwords. Let's say I had @ly as a macro for "love you", those three characters could occur together in a password and when filled, you'll automatically get "love you" in the password field!
 

chw9999

Senior Member
Dec 29, 2006
389
78
Bensheim
oh, want too, want too! But I have only ICS, and the package seems not to be compiled to support it :(

Could you pretty please make it compatible with ICS, Puuhleeeze :)

Thanks!
 

mikmitch

Senior Member
Jul 18, 2008
71
138
Tallahassee
Thanks! Now . and () work, but $ is making problems. :$ gets expanded into : only :) $ sign is gone.

This is probably due to the significance of '$' in regular expressions (and why the first release of the module didn't permit any regex chars at all!).

Try adding a backslash in front of the dollar sign \$ to make sure it is interpreted as literal text (in the macro editing screen, not when you are actually using the macro). I'll look into a more permanent fix as well.
 

mikmitch

Senior Member
Jul 18, 2008
71
138
Tallahassee
Fantastic module!

I can foresee this have having some problems with LastPass fill for long, random passwords. Let's say I had @ly as a macro for "love you", those three characters could occur together in a password and when filled, you'll automatically get "love you" in the password field!

Good point. I'm a LastPass user too and definitely have some long random passwords with special characters that might inadvertently get matched to a macro! I'll see if I can find a way to exclude text that gets filled by specific apps.
 

MattKneale

Senior Member
Feb 7, 2011
96
15
Good point. I'm a LastPass user too and definitely have some long random passwords with special characters that might inadvertently get matched to a macro! I'll see if I can find a way to exclude text that gets filled by specific apps.

Thanks, that'd be great. Might be easier to just implement an 'ignore password fields' option.
 
  • Like
Reactions: mikmitch

Top Liked Posts

  • There are no posts matching your filters.
  • 63
    Automatically expand text sequences in any text box in (almost) all apps!

    Featured on XDA-portal. Thanks to @Will Verduzco (willverduzco) for the article!

    This is an Android Xposed module to perform Macro / Text expansion. The module allows short key sequences to be transformed into other, usually more time-consuming, sequences of keystrokes. This means that frequently used or repetitive sequences of keystrokes can easily be automated. Since it uses Xposed and operates at the text widget level, it works with all factory and third party keyboards, and can be added to user dictionaries for even faster use.

    After creating my fun I am Groot module, I thought I'd do something more practical with run-time text processing using Xposed.

    Screenshots
    t105RI9.png


    h4hYchT.png



    Requirements

    Instructions
    • Download apk from Xposed Module Repository
    • Install module as a normal apk
    • Open Xposed Installer and click checkbox to enable
    • Reboot device to activate module

    Download
    v1.2 - Xposed Module Repository


    Tips & Hints
    It's best to set the macro phrase to a term that is not normally used in conversation, since all instances of this phrase will be replaced.
    For example, using the macro 'address' to denote your home address would be a poor choice, since this would change a statement like 'enter your email address' into 'enter your email '123 xyz street'
    A better choice is to add a symbol and set the alias to something like '@addr' to prevent inadvertent text expansion.
    Changes to macro list require reboot to activate.


    AutoHotKey import file notes
    • Import macro lines that match ::macro::expansion
    • Does not yet handle AutoHotKey wildcards/regular expressions
    • Lines containing non-ASCII characters are also ignored
    • Enable import/restore debug logging to troubleshoot missed macro issues
    Any AutoHotKey text file should be importable without modification.
    If the module is not able to handle the macro (yet) it will simply ignore the line.
    The module does not have an upper limit on the number of macros that can be entered/imported, but performance will degrade on significantly large lists, especially on older devices.


    Known Issues
    FC issue with MultiAutoCompleteTextViews; temporarily disabled
    Not yet working in web browsers & WebViews; work in progress
    Macros should be functional with these browsers: Atlas, Dolphin, Now Browser Extended
    Limited/no function with these browsers: AOSP, Chrome, Chrome Beta, Now Browser Pro
    Support for these in progress


    Disclaimer
    I try my best to thoroughly test everything I publish, but given the staggering number of devices, ROMs, and apps I cannot make any guarantee that something will go wrong. Use at your own risk!


    Source code
    This module is open source software, available on my Github page, licensed under the Apache 2.0 license
    If you are a developer and want to contribute, fork the repo and submit a pull request.


    Credits

    Problems/feedback
    • If you find this useful, click thanks!
    • If something is broken, let me know and I'll try my best to fix it!
    • If a feature is missing, suggest it and I'll try to add it!
    7
    I'm still waiting for 5.1.1 compatibility. I hope this mod is not abandoned.
    Working on it
    3
    New module version has been pushed to the Xposed repository!

    New features:
    • Backup/export & restore/import macro list in AutoHotKey & JSON formats
    • Support for MultiAutoCompleteTextView boxes
    • Option to disable macro expansion in password boxes
    • Option to make macro expansion case insensitive
    • In-app about/support/donation links

    AutoHotKey import file notes:
    • Import macro lines that match ::macro::expansion
    • Does not yet handle AutoHotKey wildcards/regular expressions
    • Lines containing non-ASCII characters are also ignored
    • Enable import/restore debug logging to troubleshoot missed macro issues

    Any AutoHotKey text file should be importable without modification.
    If the module is not able to handle the macro (yet) it will simply ignore the line.
    The module does not have an upper limit on the number of macros that can be entered/imported, but performance will degrade on significantly large lists, especially on older devices.

    A soft reboot is required to active any changes to settings or macro lists.
    3
    @mikmitch

    Would it be possible to add option for an import from .txt file, with all the macros we would like to add so we can just type them up on a computer (for people who don't have external keyboards for their devices)?

    Thanks for your work! It is very very useful! :)
    3
    Doesn't work with xposed for 5.1.1 ?
    Saw your post on Xposed modules collections thread. If this has been actually abandoned, I can try to implement compatibility for 5.1 and merge into Text Xposed.
    But before taking any step further, I'd like to wait till there's an official word by rovo regarding Xposed for 5.1.x