AutoInput Easy Tasker Import 1.4

Easily import tasks, profiles, scenes and projects via the share menu

  1. bdiddy

    bdiddy New Member

    Joined:
    Jun 19, 2016
    Messages:
    9
    Likes Received:
    1
    ok so i got it working. the issue stemmed from needing a wait action before doing a UI query as well as some inconsistencies between projects and task / profiles Etc. I will admit that the way I fixed it can be streamlined probably more than significantly however it ceased to be fun after 4 hours or so. Also it should be multilingual however that's based on the assumption that Tasker element IDs are universally English. Specifically the ID for profiles / task / scenes / projects is net.dinglisch.android.taskerm:id/tab_text

    If this is not the case for other languages then it will not the functional I know how to fix it I just don't feel like it right now
     

    Attached Files:

  2. soumyaranjanmahunt

    soumyaranjanmahunt Member

    Joined:
    Oct 8, 2018
    Messages:
    120
    Likes Received:
    4
    The profile seems very unreliable and i tried my best to get it work but it didn't. So I made my own version.

    Important: The problem with my version is no support for scene import.

    This profile uses intent so will be compatible with all the languages. Also only AutoShare plug in is needed for basic import, you need AutoInput to fully automate it.

    So with the profile context you can use the same context as this one, that is
    Command:all
    Sender:all
    Subject:all
    Text:all
    File:\w+\. (tsk|prf|prj)\.xml (regex)

    For the task:
    First use launch app task to launch Tasker, and then wait a bit(2 seconds)

    Important: Launching Tasker is necessary for importing multiple profiles at once.

    Then initiate a for loop with variable %file in array %asfile() (contains file names shared).

    Inside the for loop comes important part:
    Send intent via AutoShare:
    App:AutoShare
    Action:Share
    In file give %file as input and for advance option:
    Android package: net.dinglisch.android.taskerm
    (Tasker package name)
    Android class: com.joaomgcd.taskerm.datashare.import.ActivityImportTaskerDataFromXml
    MimeType: text/*

    This is enough to initiate import(a series of windows for all the files) then you can choose to see description, overwrite existing or cancel the import. If you want to completely automate the process use AutoInput to accept the dialogs, the explained steps below will work properly if the importing object doesn't exist already.

    The basic task for AutoInput to accept all such windows is to click yes. So
    Action: Click
    Type: Text
    Value:YES
    Is Tasker action: True
    (Important: Check "Is Tasker action" in advanced option or it won't work)

    So first find type of the file shared by using "Variable search and replace" and store the variable. For tasks two windows with yes to be clicked so two AutoInput action, same goes for profiles. For projects one AutoInput action required.

    Full profile description:

    Profile: Tasker Import (156)
    Event: AutoShare [ Configuration:Command: all
    Sender: all
    Subject: all
    Text: all
    File: \w+\.(tsk|prf|prj)\.xml (regex) ]
    Enter: Import (121)
    A1: Launch App [ App:Tasker Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
    A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
    A3: For [ Variable:%file Items:%asfile() ]
    A4: Variable Search Replace [ Variable:%file Search:(tsk|prf|prj)(?=\.xml) Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array:%type Replace Matches:Off Replace With: ]
    A5: Flash [ Text:%type() Long:Off ]
    A6: AutoShare [ Configuration:package: net.dinglisch.android.taskerm
    Class: com.joaomgcd.taskerm.datashare.import.ActivityImportTaskerDataFromXml
    App: AutoShare
    Action: Share
    MimeType: text/*
    File: %file Timeout (Seconds):10 ]
    A7: If [ %type(1) ~ tsk ]
    A8: AutoInput Action [ Configuration:Type: Text
    Value: YES
    Action : Click
    Is Tasker Action: true Timeout (Seconds):20 ]
    A9: AutoInput Action [ Configuration:Type: Text
    Value: YES
    Action : Click
    Is Tasker Action: true Timeout (Seconds):20 ]
    A10: Else If [ %type(1) ~ prf ]
    A11: AutoInput Action [ Configuration:Type: Text
    Value: YES
    Action : Click
    Is Tasker Action: true Timeout (Seconds):20 ]
    A12: AutoInput Action [ Configuration:Type: Text
    Value: YES
    Action : Click
    Is Tasker Action: true Timeout (Seconds):20 ]
    A13: Else If [ %type(1) ~ prj ]
    A14: AutoInput Action [ Configuration:Type: Text
    Value: YES
    Action : Click
    Is Tasker Action: true Timeout (Seconds):20 ]
    A15: End If
    A16: End For

    The intent action to import projects may be added in version 5.5 to support import from anywhere(i.e web) so this may not work in early version.
    Also the profile is attached. View attachment Tasker_Import.prf.xml

    Sent from my ONEPLUS A5000 using Tapatalk
     

Share This Page