ACTION_OPEN_DOCUMENT error when selecting Folder in http-Request

ajyta

New member
Hi!
I know, it's a little bit unusual to run Macrodroid on AndroidTV, but it works. At least many things...
Unfortunately one action I would like to use within a macro reports an error during configuration.

If I want to select a folder to store the http response within a file, Macrodroid reports an ACTION_OPEN_DOCUMENT error.

Even if I import a macro from another device, which has the correct setting, on execution there is also a similar error within the system log.

The reason could be that ACTION_OPEN_DOCUMENT_XXX - functions are not implemented by the device, because it does not support the Android Storage Access Framework, which Macrodroid may make use of it by an Intent (Intent.ACTION_OPEN_DOCUMENT).

Is there a way to work around or do somebody know a way to provide the framework capabilities by an sideload installation?

BTW, at the moment I was unfortunately not able to get root access on my AndroidTV, but for sure ADB access is possible as well as sideloading of Apps.

BR,
Peter
 

dsnz

Well-known member
have you tried saving to a variable and then using shell script ?

also..

where do you get these errors when configuring to save to file and click to select folder ? or at a later step in configuration ?
 

ajyta

New member
Hi, thanks for the hint. Saving to a variable works, but I do not know, how to hand over this variable to a shell script.
The next action within the macro would be "send last photo to email", and for that, I wanted to store the result of the http request (a photo) in a file which is then sent to an email address in the next step. If I would use the shell script, I don't know If I had to do all the email sending stuff including base64 encoding or Macrodroid could catch up the file in the next step, so I have to give it a try.

And I get the error ACTION_OPEN_DOCUMENT if I select a folder (directory picker).

As wrote above, if I use a macro vom standard Android10 device by import (BTW, everthing runs without error on that android version) where the folder is set already I get a runtime error within the system log.

BR,
Peter
 

dsnz

Well-known member
sending an email having as body the content of a variable is way easier than messing with files (I do this everyday)
try it now and problem solved
😊

(about base64 etc you worry too much with needjess details , MD will send the email correctly)
 

ajyta

New member
Already tried yesterday. Sending a email with the image (transfered by variable) is not working, because there is no possibility for base64 encoding in between. Works great for text variables, but not for binary variables.

In addition you would have to manipulate the email header (Content-Type: multipart/mixed, etc.) to add the jpg image as an attachment and that's (I have tried it yesterday) also not working ;-(.

Shell script I have tested now, and it also seems not to work on unrooted devices.

It would be best if Macrodroid would support a function where binary variables could be send by email (as attachment/including base64 encoding) without going via file.

But many thanks for your hints!
 
Top