2

I use tasker to edit setting from google maps. I have a xml file with following content.

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
  ...
  <set name="nontransit_route_options$105347668285068041666">
    <string>AVOID_TOLLS</string>
    <string>AVOID_HIGHWAYS</string>
    <string>AVOID_FERRIES</string>
  </set>
  ...
</map>

Settings in UI

Each togglebutton add by activating a line with

 <string>AVOID_*</string>.

And remove the line by deactivating.

So now I want to add or remove a line with tasker. For example %avoid_highway is true so add line in set-tag.

Step 1 First I need to read the set-tag like (perl regex):

/<set.*name="nontransit_route_options.*(<\/set>|\/>)/gsu

I ignore the number cause I don't know what it means.

Step 2 I build my own set-tag and add the tag lines. Then replace the set-tag and save it.

One problem more: If all togglebuttons are deactivated the tag is self closed:

    <set name="nontransit_route_options$105347668285068041666" />
ExaShox
  • 33
  • 6
  • it is possible to use shell script with tasker. example: run shell script:"cat file" exportTo:%var1 – ExaShox Sep 18 '19 at 09:31

0 Answers0