The c and g constants give you access to all of Leo’s source code. Here, we’ll discuss just two of them. There are hundreds more you can use.
g.openWithFileName opens a .leo file. For example:
ok, frame = g.openWithFileName(fileName,c)
new_c = frame.c
The return frame value represents the frame of the visual outline. frame.c is the frame’s commander, so new_c is the commander of the newly-created outline.