1

So I want some kind of solution to take a phone number from my call list, contacts or anywhere else, then transform it in a specific way and then add some digits and symbols in front of the number and a symbol after the number, and then forward the newly created number to the dialer.

For example, I have a phone number in my call list "+37066611111", if I share it as a number in my dialer app (DW contacts and dialer), I get this kind of text:

Contact name:
+37066611111

I want some kind of tool to get this text, drop this part:

Contact name:
+370

Then add additional symbols and digits to the remaining number "66611111", so that the result would look like this:

866622222,789#9#0866611111#

Then pass this newly created number back to the dialer. Is it possible?

I'm using a bootleggers ROM (Android 9 pie) installed on a Motorola Moto E 2015 phone.

1

Not all requirements of the question are met in this answer, but this is as close as I got so far, and I'm quite happy with it.

So, this requires to copy the telephone number without the contact name, like this:

+370 666 11111

Next, I used tasker to create a task which reads the number from the clipboard, loses the "+370" and spaces and then adds the additional digits and symbols.

I used the "Variable set" action to set a new variable to %CLIP (this way the copied number in a clipboard is saved to a separate variable, so we can manipulate it further).

Name:
%nr
TO:
%CLIP

Then I used "Variable Search Replace" action on the new variable to get rid of "+370". Took me some time to find out how to get rid of the "+" symbol, because tasker doesn't search for "+" in this action, so I used "\D" in the search parameter, which finds any symbols that are not digits, so it worked for me.

Variable:
%nr
Search:
\D370
Replace Matches: checked
Replace with:
08

Then another "Variable Search Replace" with a space in the search parameter to get rid of the spaces. (the "replace matches" must be checked to delete the found text from the variable)

Variable:
%nr
Search:
 
Replace Matches: checked
Replace with:

Then a "Variable set" action to create a new variable with the additional digits and symbols

Name:
%nrr
TO:
866622222,789#9#%nr#

And lastly - the "System > Set Clipboard" action to copy the transformed number back to clipboard, so I can use it anywhere I like.

Text:
%nrr

Then I created a button in the quick settings to launch this task, so all I have to do is copy the tel. no. which I want to transform, use the quick settings button for the task and paste the new number to my dialer app. Originally I wanted Tasker to forward the new number for the dialer to call, but if I use the "Call" action in tasker, everything after the comma in the new number is not forwarded to the dialer. So pasting the number is good enough for me.

I understand that not many people may want this functionality, but if I help even one, I'm happy. I'm willing to edit the answer so it would be easier to understand, but please tell me how to improve it in that case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.