globalmapper.RunScript ====================== .. currentmodule:: globalmapper .. py:function:: RunScript (str aFilenameOrText, GM_LoadFlags_t32 aLoadFlags, int aReserved) -> GM_Error_t32, GM_LayerHandle_t32, uint32 Runs a Global Mapper script (.gms) or workspace (.gmw). You can provide the filename of the script to run or you can provide script as raw text. Any layers loaded by the script will be returned as a pointer to an array of Layer Handles, and a uint32 will also be returned to specify the length of the array. Both will be 0 if no layers were loaded or created. Refer to :doc:`the tutorial page on working with layer handles<../sampleCode/DemoLayers>` for more information on how to turn the array pointer into a usable object in Python. Almost all of the functionalities in Global Mapper that don't have a corresponding function call in the SDK can be accessed using RunScript. The complete list of scripts that can be performed by this function can be found here: https://www.bluemarblegeo.com/knowledgebase/global-mapper-22-1/Scripting_Reference/Global_Mapper_Scripting_Language.htm :param str aFilenameOrText: str with full path of script or the actual text of the script :param GM_LoadFlags_t32 aLoadFlags: Extra flags for load behavior :param int aReserved: Reserved for future use; must be 0. :returns: Error Code :rtype: GM_Error_t32 :returns: Pointer to array of layer handles loaded by the script :rtype: GM_LayerHandle_t32 :return: Number of layer handles in the array :rtype: uint32