Extract Text To Input at Program

deswantog

New member
Hello,

I wanna ask how to extract some text notification.. Ex :
<#>Masukkan kode berikut untuk tembak paket di Web Grosir AXIS. Kode valid sampai 5 menit:7PYDPR.Jangan share ke org lain.DFvo3Kt734T

I need to get code 7PYDPR
6 digit Letter & Numer randomly

and then Input it At Program Running at macrodroid automaticly
like the picture .. IF i type 1 letter its automaticly move to another box at picture OTP

thank for your help
 

Attachments

  • Screenshot_20210506-113852304.jpg
    Screenshot_20210506-113852304.jpg
    278.6 KB · Views: 46

FrameXX

Well-known member
So you want extract text from notification or from screen? Extracting text would be possible with regex.
 

deswantog

New member
extract text from notification...
then run it to enter otp automatic at program as the picture above...

can you help me
 

Dm114

Well-known member
Hello,

I wanna ask how to extract some text notification.. Ex :
<#>Masukkan kode berikut untuk tembak paket di Web Grosir AXIS. Kode valid sampai 5 menit:7PYDPR.Jangan share ke org lain.DFvo3Kt734T

I need to get code 7PYDPR
6 digit Letter & Numer randomly

and then Input it At Program Running at macrodroid automaticly
like the picture .. IF i type 1 letter its automaticly move to another box at picture OTP

thank for your help
Try a regex like this:
Code:
menit:([0-9A-Z]{6})
assuming that the code to extract is always preceded by the word/letters 'menit:'

Otherwise tell us to find a more complex regex rule.

After extracting code, fill in the clipboard and use UI interaction to position the pointer on the first field to type in and paste the content of the clipboard (assuming the app allows to use the clipboard to paste the whole code and not every digit one by one).

I use the same kind of routine for codes recieved by SMS to fill in confidential codes in some banking sites and it works fine.
 

dhj49er

Well-known member
I use the same kind of routine for codes recieved by SMS to fill in confidential codes in some banking sites and it works fine.
I would like to do that, but am not familiar with regex.
Is it possible to upload a copy of your macro?
Thanks
 

dhj49er

Well-known member
I've tried pasting a message with a code into variable s and test run the regex action and the code was written into variable s. So that's excellent.
Just need an SMS with a code to make sure I've set up the trigger correctly.
Thank you Dm114, your macro has been a big help.
 

Dm114

Well-known member
I've tried pasting a message with a code into variable s and test run the regex action and the code was written into variable s. So that's excellent.
Just need an SMS with a code to make sure I've set up the trigger correctly.
Thank you Dm114, your macro has been a big help.
It's exactly what I was about to suggest to test the macro: set the string variable with an old SMS text you copy/paste.

Glad to help you!
 

dhj49er

Well-known member
I received an SMS with code, but the bank had put its telephone number before the code. The international telephone number started with + and was 11 digits long.
The regex code you provided extracted the first 6 digits of the telephone number.
I found a beginner's guide to regex at
and decided to write my own regex.
Attached is my attempt - I noticed all the codes I receive are 6 digits in length and all have a leading space.
On the SMS with code preceded by telephone number, this correctly gets the code.
I've used it once on a received SMS and it correctly got the code.
 

Attachments

  • Screenshot_20210512-155003_MacroDroid.jpg
    Screenshot_20210512-155003_MacroDroid.jpg
    108.1 KB · Views: 61

Dm114

Well-known member
I received an SMS with code, but the bank had put its telephone number before the code. The international telephone number started with + and was 11 digits long.
The regex code you provided extracted the first 6 digits of the telephone number.
I found a beginner's guide to regex at
and decided to write my own regex.
Attached is my attempt - I noticed all the codes I receive are 6 digits in length and all have a leading space.
On the SMS with code preceded by telephone number, this correctly gets the code.
I've used it once on a received SMS and it correctly got the code.
Great! 👍

I wrote my macro accordingly to the SMS I use to receive. Of course it is not perfect and can't be used worldwide. The most important is that you could write or adapt yours to match your own requirements.

May I make a suggestion? If you have only one company sending messages with a particular format, you could test which company is sending the SMS and execute the actions according to the syntax (either the 'odd' one(s) or the 'general' one)...
 

Lerotuf

New member
Muito obrigado.
Acabei de baixá-lo e irei configurá-lo para meu uso e aguardar o SMS! Não recebo um fluxo constante de mensagens SMS com alfinetes, mas avisarei quando tentar a macro.
voce poderia deixar a macro aqui o link nao esta indo preciso dessa macro tambem
 

Lerotuf

New member
Nao consigo achar o macro do SMS nesta página você teria como posta o link direto aqui da macro por favor ?
 
Top