Action Blocks

Just to confirm that action blocks is currently only in the beta and this may not yet be available to all beta users. There were massive changes required to support action blocks and other significant changes in this release so I am treading carefully with this.

I will certainly consider all feature requests for action blocks, but they may have to wait until the next release depending on priorities as I don't want to delay a full release rollout for too long.
What would help me most after Action Blocks (functions) would be a step debugger. I'm used to having debugging in my development IDE's.

This would save me a lot of time that I'm currently using up placing testing variables and logging almost every line of code.

I always worked with developers who believed in overcommenting their code. What I'm trying to say is this, I always comment my code so someone new could come in and know how a block of code works.

Waiting for a step debugger. Might be tough.
 

tanutanu

Well-known member
What would help me most after Action Blocks (functions) would be a step debugger. I'm used to having debugging in my development IDE's.

This would save me a lot of time that I'm currently using up placing testing variables and logging almost every line of code.

I always worked with developers who believed in overcommenting their code. What I'm trying to say is this, I always comment my code so someone new could come in and know how a block of code works.

Waiting for a step debugger. Might be tough.
Agree. Step by step execution mode is helpful even if running through entirely forward only. Setting break point is also nicer.

I'm making a debugging HUD to monitor variables as a macro with TouchTask overlay feature but it is too slow:(
 
Last edited:
Agree. Step by step execution mode is helpful even if running through entirely forward only. Setting break point is also nicer.

I'm making a debugging HUD to monitor variables as a macro with TouchTask overlay feature but it is too slow:(
I like and use TouchTask. I'll check it out, thank you for adding your input into this thread.
 
Nice job @MacroDroidDev with Action Blocks! As previously requested I guess you'll add to your ToDo list a copy/paste function to copy actions from a standard macro to a new ActionBlock.

Is this new functionality very different from a "standard macro" called by 'Macro Run' action with 'Block next actions untill complete' option selected? It's what I currently use in several 'calling macros' and it works fine like a "called function" (with global variables as input/output parameters).
I thought an Action Block would act like a function from what I read in the Wiki. I hope it stays that way.

In a well written function, you never (hardly ever) have to change the code inside the function, it always behaves the same. You may have different inputs and outputs, sometimes none of one or the other

Please tell us that Action Blocks will behave like the Wiki I read three weeks ago?
 

tanutanu

Well-known member
I thought an Action Block would act like a function from what I read in the Wiki. I hope it stays that way.

In a well written function, you never (hardly ever) have to change the code inside the function, it always behaves the same. You may have different inputs and outputs, sometimes none of one or the other

Please tell us that Action Blocks will behave like the Wiki I read three weeks ago?
Yeah, normalization of Input/output data type is very standard and pros of function as we know. Changing harder is also one of the basics(and pros). As transformng to Action blocks, the code safty and stability are improve:)

Basically, a "function-ish" macro can be realized by a regular macro as you guys know.
As my code refuctorings, a caller macro just sets arguments as a string in a global variable, then a "function" detect it via "Variable change" trigger and find a specific code block. After processing, write the return value back in the global variable and die. The caller is resumed by "Variable change" trigger in "Wait until" action.

The technique has a cons like followings:
- Not guarantee the dependency. Once adding even 10ms wait, the "function" is suspended(but continues after another macro die)
- Have possibility to occur unexpected macro errors. As the management reason, I set the argument packed in a string and split it in the "function" side. I always check Input values before processing(I never believe me). The input data type definition feature is helpful to reduce unexpected "function" macro side data handling errors.
- Naming and namespace. I named both a caller macro code block and a "function" code block to check the fact where it comes from and it surely runs, but they are not guaranteed unique.
- Splitting is a little annoying. The regex performance is not so good, especially Extract Text action, and stacks in a loop sometimes. And that's the routine I execute most frequently:(
- Looks different in a macro clearly. "Action block" action has its own unique keyword and the icon. So easy to identity even in a super long macro as same as a plugin call is, while "Set variable" action for just setting a value is very common and too many.

I wish Action blocks solve the cons a normal function-ish macro has. On the other hand, it still has a pros that it can be codable wherever I want(and it's also a cons).
I'm not sure what @Dm114 want to say and what "very different" is, but I expect above Action blocks pros as only the differences.
 
Last edited:
Yeah, normalization of Input/output data type is very standard and pros of function as we know. Changing harder is also one of the basics(and pros). As transformng to Action blocks, the code safty and stability are improve:)

Basically, a "function-ish" macro can be realized by a regular macro as you guys know.
As my code refuctorings, a caller macro just sets arguments as a string in a global variable, then a "function" detect it via "Variable change" trigger and find a specific code block. After processing, write the return value back in the global variable and die. The caller is resumed by "Variable change" trigger in "Wait until" action.

The technique has a cons like followings:
- Not guarantee the dependency. Once adding even 10ms wait, the "function" is suspended(but continues after another macro die)
- Have possibility to occur unexpected macro errors. As the management reason, I set the argument packed in a string and split it in the "function" side. I always check Input values before processing(I never believe me). The input data type definition feature is helpful to reduce unexpected "function" macro side data handling errors.
- Naming and namespace. I named both a caller macro code block and a "function" code block to check the fact where it comes from and it surely runs, but they are not guaranteed unique.
- Splitting is a little annoying. The regex performance is not so good, especially Extract Text action, and stacks in a loop sometimes. And that's the routine I execute most frequently:(
- Looks different in a macro clearly. "Action block" action has its own unique keyword and the icon. So easy to identity even in a super long macro as same as a plugin call is, while "Set variable" action for just setting a value is very common and too many.

I wish Action blocks solve the cons a normal function-ish macro has. On the other hand, it still has a pros that it can be codable wherever I want(and it's also a cons).
I'm not sure what @Dm114 want to say and what "very different" is, but I expect above Action blocks pros as only the differences.
I'm a newbie to this forum & to MacroDroid in general. Thank you and everybody for the prompt responses. I don't know how to use the reward system here - Thank you again.

I hope Action Blocks will behave like semi-overloadable functions which is how I read the Wiki. MacroDroid is easy to use. Action Blocks as the Wiki referenced, would give MacroDroid competitive advantage over the competition.

I'm a full time working software engineer. I've developed some useful unique MacroDroid macros that are in beta testing. When I'm finished, how do I get them on the forum?
 

Jacob L

Moderator (Lawsonator)
I'm a newbie to this forum & to MacroDroid in general. Thank you and everybody for the prompt responses. I don't know how to use the reward system here - Thank you again.

I hope Action Blocks will behave like semi-overloadable functions which is how I read the Wiki. MacroDroid is easy to use. Action Blocks as the Wiki referenced, would give MacroDroid competitive advantage over the competition.

I'm a full time working software engineer. I've developed some useful unique MacroDroid macros that are in beta testing. When I'm finished, how do I get them on the forum?
If you are using the pro version of MacroDroid you can add them to the store if you want. Press the template button at the bottom and then press the cloud, select your macro. Then you choose a category, name and description.

Otherwise, you can press the three dots menu in the top right of the macro you are editing and choose share macro, save it to your device and you can then attach it to the forum posts in 'Share your macros' You can also use the share tile on MacroDroid home screen to save them
 

tanutanu

Well-known member
I'm a newbie to this forum & to MacroDroid in general. Thank you and everybody for the prompt responses. I don't know how to use the reward system here - Thank you again.

I hope Action Blocks will behave like semi-overloadable functions which is how I read the Wiki. MacroDroid is easy to use. Action Blocks as the Wiki referenced, would give MacroDroid competitive advantage over the competition.

I'm a full time working software engineer. I've developed some useful unique MacroDroid macros that are in beta testing. When I'm finished, how do I get them on the forum?
How do you mean semi-overloadable?
The design that output parameter has default value and can overwrite depending on the processes in an Action block?
Action blocks can't have the same name, so it is impossible to overload polymorphic such as C++ or Java.
 

Dm114

Well-known member
...
I'm not sure what @Dm114 want to say and what "very different" is, but I expect above Action blocks pros as only the differences.
In fact, it was already possible to write "kind of" functions with 'Run macro' action but, as MacroDroidDev said « It's actually similar in many ways, but this is... more accessible for new users to understand. »
 

Dm114

Well-known member
I thought an Action Block would act like a function from what I read in the Wiki. I hope it stays that way.

In a well written function, you never (hardly ever) have to change the code inside the function, it always behaves the same. You may have different inputs and outputs, sometimes none of one or the other

Please tell us that Action Blocks will behave like the Wiki I read three weeks ago?
Yes it acts like a real function. It is autonomous, with its own input and output parameters.
 

tanutanu

Well-known member
Yes it acts like a real function. It is autonomous, with its own input and output parameters.
Autonomous? Do you understand what I wrote in this thread?

In fact, it was already possible to write "kind of" functions with 'Run macro' action but, as MacroDroidDev said « It's actually similar in many ways, but this is... more accessible for new users to understand. »
So, what are the "very different" things you thought? You are always talking very small things exaggerated without any trials.
The Jamie words you quoted is just the outline or concept of Action blocks. You don't answered neither logical or reasonable.
Please tell me more clarified and straight when you quote what I said and/or reply to me.
 
Last edited:
How do you mean semi-overloadable?
The design that output parameter has default value and can overwrite depending on the processes in an Action block?
Action blocks can't have the same name, so it is impossible to overload polymorphic such as C++ or Java.
From what the Wiki says, it acts this way. Overloading is beyond the scope of what I have time to discuss here.

It works for me. Sorry if I'm curt here, I spend my time providing solutions (coding, testing, and documentating.
 

tanutanu

Well-known member
From what the Wiki says, it acts this way. Overloading is beyond the scope of what I have time to discuss here.

It works for me. Sorry if I'm curt here, I spend my time providing solutions (coding, testing, and documentating.
hm, I just wanted to hear about how you defined the word "semi-overload(able)." I don't talk about (method) overloading itself though.
Action block can accept empty string and/or zero(-1 or so, meaning self-defined "undefined" value) as the arguments, so it might be considerable as "overloadable" if it contains specific branches to change the behaviors.
I catch you meant a sort of wrapper:unsure:
Anyway, I expect your macro release:)
 
Last edited:
hm, I just wanted to hear about how you defined the word "semi-overload(able)." I don't talk about (method) overloading itself though.
Action block can accept empty string and/or zero(-1 or so, meaning self-defined "undefined" value) as the arguments, so it might be considerable as "overloadable" if it contains specific branches to change the behaviors.
I catch you meant a sort of wrapper:unsure:
Anyway, I expect your macro release:)
 
If you are using the pro version of MacroDroid you can add them to the store if you want. Press the template button at the bottom and then press the cloud, select your macro. Then you choose a category, name and description.

Otherwise, you can press the three dots menu in the top right of the macro you are editing and choose share macro, save it to your device and you can then attach it to the forum posts in 'Share your macros' You can also use the share tile on MacroDroid home screen to save them
Thank you Jacab for answering my question. I bought the Pro version of MacroDroid as soon as I tested the environment. I believe in rewarding.

My unique and useful macros are being developed to be run on on all versions of MacroDroid without any external apps or any helper apps. When ready, I'd like to post them in a place for select testers, if you have a suggestion?
 
Tanutanu, just Google the words you're interested in, better yet, use the time you spend on the boards and to code, test, and document more code friend.
 
Top