My purpose is to add file layers into my document, linking to existing other documents.
However I can’t figure out how to use FileLayer (if this is possible) in python scripts. I’d like to have access to its methods so I can set its properties after creating it (with FileLayer.setProperties() from libkis documentation).
root = doc.rootNode()
layer = doc.createNode(name, "filelayer")
print("layer has path() method ? " + str(hasattr(layer.__class__, "path")) ) # doesn't have FileLayer methods such as FileLayer.path()
If you haven’t yet, check out the Python Plugin Developer tools. There is a full list of Krita API plus other tools that make making python scripts and plugins much easier.