Export Macro + Macros/Subroutine dependencies

I can export a single macro, but if that macro calls one or more other macros or subroutines (i.e. it is dependent on them), then those macro dependencies will not be included when exporting.

Is there a way to export a macro and all macros it depends on?

I would like to use something like this to move macros onto another machine without having to manually search each macro I want to export for every single dependency.

Preferably this would keep the macro groups intact.

This isn't extensively tested, but give it a try. It aims to export the current macro as well as any subroutines or submacros that it calls.

Export Macro (Including Submacros).kmmacros (66 KB)

Macro screenshot

(You can disable the very first and last actions, assuming you don't use my Auto-Import macro.)

1 Like

Thanks @noisneil ! -

So far this macro appears to only export the currently selected macro.

Works for me. Hard to debug for you without being there to see what's happening. Can you debug to see where the macro aborts?

What have you tried?

It definitely works in a simple macro scenario where Macro 1 only calls Macro 2 and Macro 2 does nothing.

I will try to debug what happens when I run it on more complex macros.

It doesn't seem to be aborting or throwing any error messages - at least not in a notification or in the KM Engine log.

I'm not following. Macro 2 does nothing?

This is designed to export the parent macro and any subroutines or submacros that it calls directly, regardless of what they do.