Read from/Write to File: dynamic values

Dm114

Well-known member
In the same way File name can be entered dynamically, could it be possible to dynamically/programmatically enter folder name or partial path either by:
- entering a constant or variable in the folder name field, or
- prepending file name with whole or partial path?

Examples for reading/writing from/to Macrodroid subfolders:
• folder name:
/0
• file name:
/MacroDroid/{lv=MDsubfolder}/{lv=FileName}
OR
• folder name:
/0/MacroDroid/{lv=MDsubfolder}
• file name:
{lv=FileName}
 

AkashiDom

Active member
Or maybe just do path to file like
/storage/emulated/0/Macrodroid/{lv=MDsubfolder}/{lv=FileName}
In any case, this is honestly a thing that we need in macrodroid.
Shell script have this feature then why don't file operation in macrodroid don't have it?

If you saying it user friendly, then do like you can select directory/file then the path to directory/file will be turn to dynamic.
 

Dm114

Well-known member
Or maybe just do path to file like
/storage/emulated/0/Macrodroid/{lv=MDsubfolder}/{lv=FileName}
In any case, this is honestly a thing that we need in macrodroid.
Shell script have this feature then why don't file operation in macrodroid don't have it?

If you saying it user friendly, then do like you can select directory/file then the path to directory/file will be turn to dynamic.
Your suggestion is fair as well. Mine was to keep current Actions structure.

Let's see what @MacroDroidDev will suggest...
 

AkashiDom

Active member
Lucky and unlucky day, I got a good news and bad news.

Good News:​

I found a way to do these things!

Bad News:​

I injured my arm and next week is my school day

So I should say stay tuned.
It maybe need a week to complete but if I'm ready sooner, then sooner it comes.
 

sampleuserhere

Active member
Macrodroid doesn't have All File Access permission, Google denied the request long time ago.

Thus, Macrodroid has to let the user pick the folder first before querying the folder.

Either Macrodroid has to try request the permission again or requires an external app action to monitor dynamic folder. The latter should be possible via a plugin mechanic or he could have done it his own with his helper app.
 

AkashiDom

Active member
Macrodroid doesn't have All File Access permission, Google denied the request long time ago.

Thus, Macrodroid has to let the user pick the folder first before querying the folder.

Either Macrodroid has to try request the permission again or requires an external app action to monitor dynamic folder. The latter should be possible via a plugin mechanic or he could have done it his own with his helper app.
Your wrong, at least maybe your right but I found a solution.
I won't tell you how but when I'm feeling better, I'll show you.

I won't tell how it's work yet(except for this guy, for some reason I've believe that his not a person that would steal stuff then claim as his. only for helping ofc!) but it is possible.
 

sampleuserhere

Active member
Your wrong, at least maybe your right but I found a solution.
I won't tell you how but when I'm feeling better, I'll show you.

Meh, this is a forum. You could always reply when you're feeling okay telling us your solution.

Anyhow, his request is an action, not workaround with shell command. IIRC, It's impossible to achieve without the full file access as this action typically use Android API instead of wrapping shell command.
 

AkashiDom

Active member
I...
Meh, this is a forum. You could always reply when you're feeling okay telling us your solution.

Anyhow, his request is an action, not workaround with shell command. IIRC, It's impossible to achieve without the full file access as this action typically use Android API instead of wrapping shell command.
...am using shell command
He want action? There's this called action block
 

Endercraft

Moderator (& bug finder :D)
Well. MacroDroid Helper has all files permission. So wouldn't it be simple to either update the helper to implement these actions or make the actions trigger trigger shell scripts in the helper?
 

sampleuserhere

Active member
Well. MacroDroid Helper has all files permission. So wouldn't it be simple to either update the helper to implement these actions or make the actions trigger trigger shell scripts in the helper?

It sure is, which what I already mentioned first. It's just a matter whether @MacroDroidDev wants to circumvent this situation with the helper app or not.
 

MacroDroidDev

Administrator
Staff member
I have been periodically trying to get the permission by submitting alpha versions to the Play Store. They deny me every single time and I have tried lots of approaches/appeals etc. It's extremely frustrating as both Automate and Tasker have the permission and I even followed advice by the creator of Automate on how he got approved and no luck.

It's easy to say just put it in the helper file but this makes my life massively more complicated in terms of implementation, long term maintenance and user support. Not to mention the fact that in the long term Google will no doubt make it harder and harder for it to install (and some users really dislike installing third party tools).

When I can finally find the enthusiasm to look at this again I will try once more to get approval but I don't have it in me right now.
 

Dm114

Well-known member
I have been periodically trying to get the permission by submitting alpha versions to the Play Store. They deny me every single time and I have tried lots of approaches/appeals etc. It's extremely frustrating as both Automate and Tasker have the permission and I even followed advice by the creator of Automate on how he got approved and no luck.

It's easy to say just put it in the helper file but this makes my life massively more complicated in terms of implementation, long term maintenance and user support. Not to mention the fact that in the long term Google will no doubt make it harder and harder for it to install (and some users really dislike installing third party tools).

When I can finally find the enthusiasm to look at this again I will try once more to get approval but I don't have it in me right now.
What a pity! Sorry I wasn't aware of that: always silly limitations from G**gle! 😠

Ok, so, on my side, let's say I didn't ask anything on this field and keep on maintaining and developing "our" MD with a minimum stress.

Good luck. 👊
 

sampleuserhere

Active member
@MacroDroidDev well said, I appreciated your elaboration. I'm fully aware of how frustrating it can be fighting against "google chat bot" as Joao (the developer of Tasker) had them against him a couple of times and they weren't very pleasant ones.

For those who's interested could have come up with a plugin mechanic or create your own action block as @AkashiDom had shown before.

Monitoring folder/file event is a bit harder so incorporating Macrodroid with Automate is the only free option I could think of, I'm not too sure about from outside the store.
 

AkashiDom

Active member
@MacroDroidDev well said, I appreciated your elaboration. I'm fully aware of how frustrating it can be fighting against "google chat bot" as Joao (the developer of Tasker) had them against him a couple of times and they weren't very pleasant ones.

For those who's interested could have come up with a plugin mechanic or create your own action block as @AkashiDom had shown before.

Monitoring folder/file event is a bit harder so incorporating Macrodroid with Automate is the only free option I could think of, I'm not too sure about from outside the store.
I've done it. It just that... Check my new profile post
 
Top