Folder Panel
In the left panel of the Macro Execution Control, several folders are listed. They contain Python macros that can be executed by clicking Run.
Default folders
Macro Tutorials & Examples
Preinstalled macros are found by unfolding the Macro Tutorials & Examples folder.

The tutorial macros A, B, C and E need only a GeoDict Base license for execution. The tutorials D and F also need the modules FiberGeo and FlowDict and are the macros created in the workshop videos available on the Math2Market YouTube channel. Find the corresponding links in the macros by opening them in a text editor clicking Edit or use the links given in the tutorials topic.
All tutorials have detailed descriptions and thus can be very helpful for getting started with editing Python macros.
More advanced example macros can be found in the subfolder Python Scripting Examples. These Python scripts also use other GeoDict modules.
When selecting one of the available macros, the description area displays a report about the macro. In the macro, this report content can be found between the triple apostrophes after Description = ''' ''', and can be edited at any time after opening the macro with a text editor.
For the Tutorial-A-general.py macro, the text in the macro and in the description area are shown here.
|
GeoApps and My GeoApps
The GeoApps folder contains all the GeoApps to be found by selecting GeoApp from the menu bar. They are described in the GeoApps handbook.

The MyGeoApps folder can be filled with your own GeoApps as also described in the GeoApps handbook. By default, it contains MyFirstGeoApp, an example GeoApp
|
Session Macro
In the SessionMacro folder, macros containing all commands from the current GeoDict session and the last sessions are saved automatically. The commands contained in these macros are the same that can be found in the Session Macro dialog.
They can be edited at any time since they are saved in the SessionMacro folder inside the GeoDict settings folder.
|
Project Folder
The last folder is the selected project folder. All macros inside this folder are shown. Fill this folder for example, by using Record Macro or the Session Macro dialog.
|
Edit the folder panel
Four buttons are located under the left panel of the Macro Execution Control dialog:
- Add Folder: Click to add another folder containing macros to the panel.
- Browse: May be used to find and select a macro (*.py, *.gmc) from other than the already listed folders in the left panel. Macros shipped with GeoDict can be found for example in the folders GeoApps, GrainGeo, Macro Tutorials & Examples or GeoDictAI included in the installation folder of GeoDict.
- Refresh: Clicking Refresh actualizes the list of macros in the pull-down menu. After adding new macros to the project folder, click Refresh to have their file names included in the list.
- Edit: GeoDict macros are stored as readable text files and, therefore, can be edited using any text editor, e.g. Editor, WordPad, or Notepad++.
GeoDict does not recognize a file as a macro when the file extension is not *.py or *.gmc. This can happen for example when Windows settings are such that extensions are not shown and, coincidentally the text editor (i.e. Editor or WordPad) automatically adds an extension to the file name (*.txt, *.doc, etc). Then, GeoDict finds macro1.py.txt instead of macro1.py and does not recognize it as a macro, failing to open it.
The simplest solution is to select a text editor used in programming, e.g., Emacs for Linux systems, or Notepad++ for Windows.
After adding folders with the Add Folder or the Browse button, they can also be removed at any time by right-clicking on the folder and selecting Remove.
Example for editing a macro
The basic way to edit a macro (e.g. macro.py), is to find the macro file name in the project folder, right click on it, and select Open With…. Choose the editor from the list of available programs. However, the macro.py can be directly opened, and then edited from the Macro Execution Control. For this, highlight a macro in the left panel.
Click Edit to open the selected macro using the designated text editor. The macro then can be examined and edited.
The macro follows the previously described structure: Header={}, Description=''' ''', Variables={} and the command block.
You can modify directly any parameter or command listed in the command block, or perhaps, introduce a variable.
After modifications, the macro file can be saved with a different name (e.g. GeoDictMacro1.py). Click Refresh to have the name of the macro, modified and saved in the project folder, appear in the list of macros in the left panel of the Macro Execution Control dialog.
|