Remove All Ads from XDA

How do I do this text-based task?

262 posts
Thanks Meter: 47
By WaterMan!, Senior Member on 13th November 2019, 08:11 PM
Post Reply Email Thread
Hey guys, I'm trying to automate a task I do often for work. When I get a potential new customer, I receive a standard email with their information in a specific format. For example:

Name - x

Email - y

Phone - z

I am trying to figure out a way to interact with this body of text and automate it as much as possible. I would have to add a new contact with the name, and send out a standardized email as well as a text.

I haven't really made complex tasks like this, so I'm a bit lost as to where to start. I am rooted. I would also like to note that I'm using a proprietary email app (Blackberry Hub+ Inbox), so I think it may be easiest to start off the task by manually copying the body of the text and then somehow triggering the task.

Thanks in advance!
15th November 2019, 01:02 AM |#2  
ktmom's Avatar
Senior Member
Thanks Meter: 2,420
This project is actually a little complex, and it also interested me so, while I usually don't do this, here is a taskernet share.

Requires AutoTools to be installed because a webscreen is used. On install, you must edit actions 15 & 16 in the task. These are variables for the email subject and body.

The profile triggers when data starting with e.g. "Name - John Doe" is copied to the clipboard. Then a button pops up on the right side of your screen and when you tap it the information is entered into a new contact form that you can edit, cancel or save.

A second button becomes available which triggers the composed email action.

The buttons will time out after 30 seconds without triggering the associated task. You can also "fling" them away to dismiss.

The task is expecting each piece of information to be on a separate line like:

Name - John Doe

Email - [email protected]

Phone - (999) 999-9999

The labels for each line are used as variables in the task to identify the associated data. Therefore, the order does not matter. Though if "Name - " is not first, the profile will not trigger. You would need to edit the regex in the profile context.

If, for example, an address is on multiple lines, the task will need to be modified to handle that.

To limit the activation of this profile to only when the data is copied in a specific app such as an email client, add that app as a context in the profile.

The task is heavily commented.

Finally, I add my username into the profile and task names to help avoid the possibly of namespace collisions (when the imported project has the same profile, task or variable names as existing profile, task or variables). The -ktmom can be removed.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes