Best solution to write, read and edit macro code, need suggestions

I would like to receive some advice to better organize the macro code.

When you create the macro code, you divide it into various parts?

Do you use the comment or echo command?

How do you sort macro code so you can easily read and edit it?

You can add images to show me how you organize macro code writing to make it easier to read and fix.

Thank you

1 Like

I always comment each section and also commands where I can. This makes it so much easier to change or fix things later on.
Unfortunately, you can’t comment on XType/XClick anymore like you used to with older versions.
It would be nice to have syntax highlighting like you mentioned here: Change comment color in ui vision gui with a better color choice (black or other)

1 Like

Thanks for the answer, your solution is good but it doesn’t solve the problem because some commands also use the third box for example the select command, the executescript command, the store command use the third box and therefore it is not available. It would be useful if admin could add a fourth box in the commands to be able to comment or add notes.

When you have a long macro code it becomes difficult to remember each command which function it executes without a comment, using the comments as they are now is not easy because they are not in the same command line and they also greatly enlarge the length of the code.

It would be interested if admin could introduce a space on the same command line to add a little note.

A workaround to have a better color in the comment command would also be useful.

Imacros have a easy solution to solve this in code for javascript macro code need to put // in code

Example imacros code

window.close(); // comment
window.close(); // comment
window.close();
1 Like