sampleuserhere
Active member
I'm kind of a bit testing how far I could go with Macrodroid and would love to get used to with how stuff works around here. So far I've only ever done simple macros with this app.
I'm not that used to working with the syntax, tools, and actions altogether to process the data. So I'd like to ask what kind of existing challenges related to the topic that I could explore and maybe some assistances on how to solve the some challenges I've been struggling with.
Here's the challenges that I'm already settled with.
1. Combining two or more arrays without loop.
This is fairly easy.
Not settled yet
1. Creating multiple arrays from a text
This is a bit hard to deal with. My current approach is
Not really the way to go. While I could do them in one bulk, the data set should be identical and repetitive (like CSV) or else I have to form the regex very carefully. Obviously this is still very hypothetical, but I could foresee this one is not going to be conveniently applicable for most cases.
Anyway, Is there any I could extract the groups into multiple arrays? Say, I have the following regex.
It will match 1:ai and sets {lv=order[0]} to 1 and {lv=name[0]} to ai. This is the approach I usually do in Tasker, may be worth to ask this one just in case Macrodroid has similar tools that I'm not aware of.
2. Escaping newline and preserving escaped or literal newline
I look around and several people posted about this topic and it seems that most of them implied that Macrodrod will always try to convert \n to literal newline? Is this really the case with Macrodroid?
I realize the way Macrodroid handles newline seems a bit odd for some cases.
Other Challenges?
Do you guys have any other problem you have been struggling with until now?
Not saying I would and could definitely solve it. However there are challenges that could be encountered only by those who are already well-versed with Macrodroid. I'm still far miles away from that so I'd like to know some earlier if possible.
TIA.
I'm not that used to working with the syntax, tools, and actions altogether to process the data. So I'd like to ask what kind of existing challenges related to the topic that I could explore and maybe some assistances on how to solve the some challenges I've been struggling with.
Here's the challenges that I'm already settled with.
1. Combining two or more arrays without loop.
This is fairly easy.
- I just need to create a sequence number with 0 to {size=array} subtracted by 1 with seq in Shell Script.
- Replace the number with {lv=array 1[$0]}.
- Then as the final step, split the text with the divider.
- The final array should be automatically evaluated by Macrodroid.
Not settled yet
1. Creating multiple arrays from a text
This is a bit hard to deal with. My current approach is
- Match the full set of data with regex,
- Turns them into JSON arrays [{},{}].
- Parse them with JSON parse and use Macrodroid variable syntax to refer the values with their path.
Not really the way to go. While I could do them in one bulk, the data set should be identical and repetitive (like CSV) or else I have to form the regex very carefully. Obviously this is still very hypothetical, but I could foresee this one is not going to be conveniently applicable for most cases.
Anyway, Is there any I could extract the groups into multiple arrays? Say, I have the following regex.
Code:
(?<order>\d+):(?<name>[a-z]+)
It will match 1:ai and sets {lv=order[0]} to 1 and {lv=name[0]} to ai. This is the approach I usually do in Tasker, may be worth to ask this one just in case Macrodroid has similar tools that I'm not aware of.
2. Escaping newline and preserving escaped or literal newline
I look around and several people posted about this topic and it seems that most of them implied that Macrodrod will always try to convert \n to literal newline? Is this really the case with Macrodroid?
I realize the way Macrodroid handles newline seems a bit odd for some cases.
- Returning stdout that contains newline after executing Shell Script action.
- Entering newline in set variable action.
Other Challenges?
Do you guys have any other problem you have been struggling with until now?
Not saying I would and could definitely solve it. However there are challenges that could be encountered only by those who are already well-versed with Macrodroid. I'm still far miles away from that so I'd like to know some earlier if possible.
TIA.