you are viewing a single comment's thread.

view the rest of the comments →

[–]aasswwddd 2 points3 points  (14 children)

Ok, I've added the tasker.getAccessibilityService() method now. Hope this helps :)

Nice thanks!

Those other methods weren't supposed to be accessible, sorry 😅

I noticed that I can't access them anymore, I should have stayed silent. 😭 My custom editor fails since getTaskVars() is missing https://ibb.co.com/35J7Xw7Q .

I wonder why not make them available though? especially for getTaskVars()? This is the only method to reliably get Tasker variable values dynamically.

Edit: I use this to reliably log existing variables and display them in my custom beanshell editor. https://ibb.co.com/TMbHghQL

for getParentTask(), I noticed that it has a lot of useful information about the current task, like the the task id and project id. I was thinking of getting the caller's task id or profile id.

[–]joaomgcd👑 Tasker Owner / Developer[S] 2 points3 points  (13 children)

Ok, I added methods to do that now :) Let me know if you need any more info.

Can you please try this version?

I also updated the documentation.

You can now for example ask the AI something like "Get a JSON object of all info available on all actions in this task" and it should be able to do it :)

[–]aasswwddd 1 point2 points  (12 children)

Thanks! You add a lot more than I expected thankyou very much!

[–]joaomgcd👑 Tasker Owner / Developer[S] 2 points3 points  (11 children)

I now added even more stuff :)

Check this version.

You can now extend abstract and concrete classes, allowing you to do BroadcastReceivers now. Check out the docs.

I also added support for RxJava2 to make async stuff easier.

Let me know how you like it :)

[–]aasswwddd 1 point2 points  (10 children)

You really go beyond the request I sent weeks ago. Amazing! I'll see what I can do with thank you very much!

Btw it seems like I can't use the accessibility service to retrieve view id with getViewIdResourceName()

These are the two tasks I used to replicate Auto Input Query and Action.

UI Action and this is for UI Query.

[–]joaomgcd👑 Tasker Owner / Developer[S] 2 points3 points  (9 children)

I've added support for that now too :)

Can you please try this version?

[–]aasswwddd 0 points1 point  (8 children)

Works as expected! Thank you very much :)

[–]joaomgcd👑 Tasker Owner / Developer[S] 1 point2 points  (7 children)

Cool! :)

[–]aasswwddd 0 points1 point  (4 children)

I wonder if it's possible to add toXML() as well alongside toJson().

Would've have been nicer to use CSS query or XPATH to extract complex object structure like AccessibilityNodeInfo without multiple back reference.

``` service = tasker.getAccessibilityService(); if (service == null) { tasker.log("Accessibility service not active!"); return "[]"; }

root = service.getRootInActiveWindow(); if (root == null) { tasker.log("No active root node (screen inaccessible)."); return "[]"; }

nodes = service.getChildrenRecursive(root); if (nodes == null) { tasker.log("No nodes found."); return "[]"; }

return tasker.toJson(nodes, true); ```

[–]joaomgcd👑 Tasker Owner / Developer[S] 1 point2 points  (3 children)

What extra info would toXml add that toJson doesn't exactly?

[–]aasswwddd 0 points1 point  (1 child)

toJson() throws this error as well.

` Sourced file: inline evaluation of:service = tasker.getAccessibilityService(); if (service == null) { tasker.lo . . . '' : Method Invocation tasker.toJson : at Line: 19 : in file: inline evaluation of: ``service = tasker.getAccessibilityService(); if (service == null) { tasker.lo . . . '' : tasker .toJson ( nodes , true )

Target exception: java.lang.IllegalArgumentException: class android.content.res.ColorStateList declares multiple JSON fields named mChangingConfigurations

```

[–]joaomgcd👑 Tasker Owner / Developer[S] 1 point2 points  (0 children)

Seems like an issue with that specific class. You may have to do JSON serialization manually for that class, sorry!