Launched from the File Menu with the Open Script Editor option, the Script Editor dialog can be used to create, view, edit and run scripts in Global Mapper. Multiple script files will open as separate tabs in this dialog and can be run individually using data loaded in the open workspace, or files called in the script. Click here for a guide to the Global Mapper scripting language.
The Script Editor can also be opened from the Script Builder to edit and save a Global Mapper Script recorded with the builder tool.
When working in the Global Mapper interface, select tool dialogs contain a Copy Script button allowing you to copy the complete Global Mapper Script command to the clipboard to more easily create scripts lines for select actions.
Creating and editing scripts with the Script Editor requires Global Mapper Pro.
Scripts can be viewed and run through the Script Editor without Global Mapper Pro.
Scripts using Global Mapper Script, Python, or Global Mapper Spatial Scripting (*.gmss) can be created, edited, and run through the Script Editor dialog. To work with a python script (*.py file) python v3.9 must be installed.
The Script File pane displays the current script file and allows you to edit the script content. The script text displayed in this pane will be colored to differentiate between commands, parameters, values, and comments. When starting a new script, save the file or select the appropriate script language from the Edit menu to enable syntax colors.
To load a new script file use the File Menu > Open option or click the Load Script... button at the bottom left corner of the dialog. If a script is already open in the Script File pane, the new script will be opened in a new tab. Script tabs can be closed with the x on the tabbed interface or with the Close Tab File Menu option in the dialog.
If you would like the script file to make use of data already loaded in the main view and to also affect what is displayed in the main view, check the Run Script in the Context of the Main View option prior to running the script.
To run the loaded script file from the active tab, click the Run Script button. Any warning, error, or status messages generated while running the script will be output to the Script Results pane.
Use the toolbar button to add or remove bookmarks in a script. A bookmarked line of script will show a rectangle tag on the left of the line index in the Script File pane. Use the Next Bookmark and Previous Bookmark toolbar buttons to jump from one bookmarked line to another.
Save As - Select this option or use the Ctrl+Shift+S shortcut to save the current script to a new file.
Open - Select this option or use the Ctrl+O shortcut to open a existing script file. If a script is already open in the dialog, the new file will open in a new tab.
Reload - Select this option or use the Ctrl+R shortcut to reload the script in the active tab to reflect any changes made in the source file outside of Global Mapper.
Close Tab - Select this option from the File Menu to close the active tab but keep the dialog open.
Redo - Select this option or use the Ctrl+Y shortcut to redo an undone change in an open script.
Cut - Select this option or use the Ctrl+X shortcut to cut the selected script text.
Copy - Select this option or use the Ctrl+C shortcut to copy the selected script text.
Paste - Select this option or use the Ctrl+V shortcut to paste the copied or cut text into the script editor.
Language - When beginning to write a script, select the language, either Global Mapper Script or Python that will be used. This will enable the colored text indicators to help user differentiate between commands, parameters, values, and comments.