Hi All,
I have created the attached Standard Macro and need to convert it to a Batch Macro.
The current macro takes input file from a path and if in case the file is missing from that path it would take a dummy file from another path so that the further workflow runs smoothly even if input data is missing.
I just wanted to replace the directory input tools with macro input tool to make it a generic macro, which can be used in any workflow.
Desired result: I would place 2 directory input tool, connect it to a batch macro (the macro would have 2 input anchors and 1 output anchor) and get output.
Solved! Go to Solution.
Hi @VEDH
If you only want to develop a generic macro that can take in any input, you can just replace the directory tool with a macro input tool.
you only need batch macro if you want to repeat the same set of procedures to a fixed list of instances.
if you have not done so yet, highly recomend:
- interactive lessons on Macro (one of the the bes in my opinion)
- the recorded 3-part videos on macro.
dawn
Hi @VEDH
If you use the Directory tool to avoid the missing file, you should use the Batch macro.
But if not, you can use the normal macro. In this case, you have to modify the workflow.
Batch Macro :
You have to add the Control Parameter tool and Action tool.
Action tool setting:
- Select the Red line "Directory - value" row.
If you want to use normal macro, the workflow will be more complicated.
In this case, you can use the FileExists function of formula tool to confirm whether the file path is correct.
Hi @DawnDuong,
Already tried replacing the directory tool with a macro input tool. It did not work, I get 3 input anchors. Please refer the attached workflow.
PS: Tried all the combinations of macro input.
hi @VEDH
from what you described about the inputs, you don’t need a batch macro. Do you need to use a batch macro because you have an assignment on batch macro?
if you can visually illustrate what inputs you have and what desired outputs you want to get, the community can better help you. Especially what the “batch” in batch macro is supposed to do
I must admit i do not follow 100% what is requires.
dawn
Hi @AkimasaKajitani and @DawnDuong,
I played around with control parameter a lot. However, could not get desired output when the file was missing from original location.
Do you need to use a batch macro because you have an assignment on batch macro? - No, I do not have any assignment on batch macro. I am Ok with any macro type.
Below is how I want my workflow to look like
Desired Result:
Below is the current state:
I want all the tools in container to be in a single macro. That's all.
Hi @VEDH
you can just convert the directory tools to input macros. Do not put any control parameter on the canvas. If a canvas has a control parameter, it is automatically recognised as a batch macro and then you will have +1 more macro input that looks like an inverted question mark. SomethiNg like this will do the trick.
Hi @VEDH
I modified your macro at two three point.
1. Macro Input should have minimum fields
If you set many unnecessary fields to the Macro input tool, you must set the wasted fields.
If you set only required fields, you can set some fields.
2. If the macro have some input, you'd better to name the anchor(Using Anchor Abbreviation option).
What this tell us is that upper input is for dummy file.
3. I changed from Batch macro to standard macro
Please check attached workflow.
Hi @AkimasaKajitani,
A ton of thanks to you.
I literally got frustrated trying multiple combinations of settings with all different tools.
So, what I understand now is I was adding too many fields in template input, which caused this error.
Thanks a lot once again. Could have a peaceful weekend now, lol