Hi,
the function in the screen load script is in the GUI Lua chunk. The macros are included in the Gcode interpreter chunk.
Only one chunk can run at a time. Thus a macro cannot call code from the GUI, in fact a macro cannot access variables
in the GUI either.
If you wish to share data between the two chunks use registers, that's what they're for.
You cannot share functionality with the GUI.
Your choices are to duplicate the functionality within your macro. It may be possible to put the function into a module
as modules can be accessed by either chunk.
Craig