Utility to display your entire Android 'Tasker' configuration on your MAC.


Keywords
tasker, map, config, configuration, maptasker
License
MIT
Install
pip install maptasker==4.0.5

Documentation

PyPI PyPI - Downloads Downloads image PyPI - License

Code style: black "Buy Me A Coffee"


MapTasker

Display the Tasker Project/Profile/Task/Scene hierarchy on a PC/MAC/LINUX machine based on Tasker's backup or exported XML file.

This is an application in support of Tasker that is intended to run on a desktop running Windows, OS X or Linux (see Note 1). I found that my Tasker Projects/Profiles/Tasks/Scenes were becoming unmanageable, so I wrote a Python program for my MAC to provide an indented list of my entire configuration based on my Tasker backup XML file that I saved to my Google Drive.

A portion/example of the results can be found at https://imgur.com/a/KIR7Vep.

The Tasker backup or exported XML can either be manually uploaded to your PC/Mac/Linux/cloud-drive, or this program can fetch it directly from your Android device.

Program Dependencies

- Python version v3.11 (see Note 4) or higher and Tkinter 8.6 or higher.

- Tasker full or partial backup or exported XML file.

(anyname.xml…you will be prompted to locate and identify your Tasker backup/exported XML file) on your desktop, created by Tasker version 5 or version 6. Optionally, this can be fetched directly from your Android device (see Note 2).

Installation

  • Install MapTasker by entering the following command into the Terminal:

    pip install maptasker

  • To install it into a virtual environment, enter the following command into Terminal:

    • cd xxx, where 'xxx' is a directory into which you want to set up the virtual environment:
    • python -m venv venv
    • set VIRTUAL_ENV {directory path to 'xxx'}/venv
    • source {directory path to 'xxx'}/venv/bin/activate
    • pip3 install maptasker
  • To install it from GitHub, get the zip file by clicking on the 'Code' pull-down menu, select 'Download ZIP', save it into a new directory (e.g. /your_id/maptasker) and uncompress it into that directory.

Usage

  • Enter the command:

    maptasker (runtime options...se below)

See below for runtime options.

  • If running from the sourced GITHUB zip file, then do the following to run the program:

    pip install -r requirements.txt ...one time only, to first install the prerequisites

    python main.py (runtime options...se below) ...to run Map-Tasker

Program output:

  • The file “MapTasker.html” will be written to your runtime/current folder, which will be opened in your default browser as a new tab.
  • If the "-outline" runtime option is used, then a textual diagram of the configuration is also written as "MapTasker_Map.txt" and will be displayed in your default text editor. Ensure that text-wrap is off and a monospace font is used when viewing this map in the text editor.
  • The runtime settings are saved in the file" MapTasker_Settings.toml". You can modify this file but care should be taken not to change the field formats (e.g. change an integer to a text string). Incorrect values will be ignored.

Runtime: maptasker -option1 -option2 ...

Runtime options (only available if not using the GUI)

`-h` for help.

`-android_ipaddr` TCP/IP address of the Android device from which to fetch the backup/exported XML file (see Note 2).

`-android_port` the port number of the Android device from which to fetch the backup/exported XML file.
  Example: 1821

`-android_file` the location of the backup/exported XML file on the Android device.
  Example: /Tasker/configs/user/backup.xml

The above three 'android' options are mutually inclusive.

`-appearance` for appearance mode, one of system, light, dark.

`-conditions` to display a Profile's and Task's condition(s),

`-c(type) color_name` defines a specific color to 'type', where 'type' is *one* of the following:

  'Project' 'Profile' 'Task' 'Action' 'DisabledProfile' 'UnknownTask'
  'DisabledAction' 'ActionCondition' 'ProfileCondition' 'LauncherTask'
  'Background' 'ActionLabel' 'Bullets' 'TaskerNetInfo', "Preferences',
  "Heading', 'Highlight'

    Example color options: -cTask Green -cBackground Black cProfile 19c8ff

`-ch` color help: display all valid colors",

`-detail 0` for minimal mode: simple Project/Profile/Task/Scene names with no details,
`-detail 1` to display the Action list only if the Task is unnamed or anonymous,
`-detail 2` to display Action list names for *all* Tasks,
`-detail 3` to display Action list names with *all* parameters for all Tasks,
`-detail 4` to display detail at level 3 plus all Project and unreferenced global variables (default),
`-detail 5` to display level 4 detail plus Scene element UI details.

`-directory` to display a directory of all Projects/Profiles/Tasks/Scenes,
`-e` to display 'everything': Runtime settings, Tasker Preferences, Directory, Profile 'conditions', TaskerNet info and full Task (action) details with Project variables, etc.
`-file` to specify a specific XML file to read from your local PC/MAC/Linux drive.
`-font` font to use (preferably a monospace font),  If "-f help" is entered, then the list of installed monospace fonts on your system will be printed out on the runtime console.
`-g` to get arguments from the GUI rather than via the command line,
`-i` the amount of indentation for If/Then/Else Task actions (default=4),
`-n {bold highlight italicize}` to add formatting options to Project/Profile/Task/Scene names,
`-o` to display the Configuration outline and output a map as MapTasker_map.txt
`-preferences` to display Tasker's preference settings,
`-pretty` to make the output pretty by breaking the lines at commas and open parenthesis,
`-reset` to ignore and reset the previously stored runtime arguments to default values,
`-runtime` to display the runtime arguments and their settings at the top of the output,
`-twisty` to display Task details hidden by a twisty "▶︎".  Click on twisty to reveal.  (Mutually exclusive with '-everything')
`-taskernet` to display any TaskerNet share details,

The following three arguments are mutually exclusive.  Use one only:

`-project 'name of the project'` to display a single Project, its Profiles and Tasks only,
`-profile 'profile name'` to display a single Profile and its Tasks only,
`-task 'task name'` to display a single Task only,

Ai analysis support via OpenAi and Llama is currently only offered through the GUI. (See Note 5).

Examples

The MapTasker GUI:

Sample output with runtime option '-everything':

Sample Configuration Map from runtime option -outline:

Example runtime options:

'maptasker -detail 2 -conditions -taskernet'
    (show limited details and include Profile and Task 'conditions' and TaskerNet details.)

Example using the GUI:

'maptasker -g'

Example fetching backup file directly from your Android device:

'maptasker -android_ipaddr=192.168.0.60 -android_port=1821 -android_file=/Tasker/configs/user/backup.xml'

Example using a specific local XML file (File_List.prf.xml) from Google Drive:

'maptasker -file "/Users/mikrubin/Library/CloudStorage/GoogleDrive-mikrubin@gmail.com/My Drive/Python/maptasker/File_List.prf.xml"'

Notes

1

Windows 11 has been tested and verified to work. Limitations:

  • The Edge web browser, though, closes as soon as it opens when invoked from this program. Therefore, it is recommended to use any browser other than Edge.
  • Notepad does not treat spacing correctly for the configuration diagram (MapTasker_Map.txt). Install an app such as "Typepad" and set it as your default app for opening txt files.

2

For the "Get backup" (retrieve the Tasker XML file directly from your Android device) option to work, you must have the following prerequisites:

  • Both the desktop and Android devices must be on the same network.

  • The sample Tasker Project must be installed and active on the Android device, and the server must be running (see Android notification: "HTTP Server Info..."). Make sure to run the "launch" Task and enter your Google Drive ID.

  • The TaskerNet profile, MapTasker List, must be imported into Tasker in order for the 'List XML Files' button to work.

  • Once the XML has been retrieved from your Android device, it is not necessary to keep retrieving it unless it has changed since it is automatically saved on your desktop.

3

If having problems getting Tkinter to version 8.6, try the following:

  • uninstall python
  • brew install tcl-tk
  • reinstall python

If still having Tkinter version problems, refer to this StackOverflow post.

4

If you are unable to upgrade to Python version 3.11 or higher, an older version of MapTasker is still available for Python version 3.10, via the command:

'pip install maptasker==2.6.3'

With this older version, you will not get the benefits offered by the newer version. Refer to Changelog for details.

5

Ai analysis is available through the GUI only. You can run an analysis using a single Profile or Task only. Support is available for server-based OpenAi (chat-gpt) and local-based Llama.

The usage of llama models also requires that you manually install Ollama from here and you must run the application once to do the initial setup. Then you can run an analysis via the GUI (see the "Analyze" tab).

To-Do List (in no particular order)

  • Auto Update Feature

  • Fix output column alignment

  • Support Windows 11

  • Add a runtime option for more pretty output

  • Add Ai support to analyze Profiles and Tasks

  • Save and restore the Ai Analysis and popup window locations

  • Include/map remaining Tasker preferences

  • Support additional plugins

Privacy Statement

No information whatsoever is captured and sent via the network to myself or any other third party.

When reporting an error, you will most likely be asked to provide the output log file from the error and your XML file, both of which will be solely used to debug the program and then immediately deleted.

The only network traffic that occurs is if and when you retrieve the backup/exported XML file directly from your Android device on the same network, and during the GUI startup to check the pypi.org server for updates to the program.

Contributions

Taskometer

©Connor Talbot 2021 for Clippy

Tom Schimansky for CustomTkinter

Akash Bora for CTkColorPicker