Target Scripts
Target Scripts
Scripting refers to the act of creating and running a file that will carry out many operations in a row. If you perform a task
repeatedly in Target, you can automate the task using a script. Geosoft Scripts are ASCII files (with a *.gs extension) that
contain a series of actions or commands that are grouped together in a single file to accomplish a task automatically. This
How-to Guide is intended to provide you with a basic introduction to Geosoft Scripts in Target.
For more information on using Scripts, see the Creating Scripts In Oasis montaj Technical Note, available online at:
www.geosoft.com/resources/technotes/
www.geosoft.com 1
Target How-To Guide
Click the Help button for more information on creating a Script file.
To view a Script
1. On the Edit menu, click Edit a File.
The Edit file... dialog appears.
2 www.geosoft.com
Target How-To Guide
2. Using the Browse button, select the script file from your project folder.
3. Click OK. The system opens up the file in your default text editor.
Example
In the example below, we created a script file using the script file record option. This operation writes a script file (*.GS) by
recording each GX that you run during the session until you stop script recording (from the GX menu). The resulting (*.GS)
file contains sufficient parameter and database information to run the selected GXs in the same sequence. We recorded a
script of two different GXs - added a line path and line profiles to a map.
Below is the recorded script file test.GS.
The two GXs that were recorded are shown beside the GX command: PATH and PROFILE.
www.geosoft.com 3
Target How-To Guide
/-------------------------------------------------------------------------
/ LOG OPENED : Mon Sep 10 15:37:30 2012
/-------------------------------------------------------------------------
CURRENT Map,"e:\testing\Magnetics.map"
CURRENT Grid,"e:\testing\mag.grd(GRD)"
CURRENT Database,"e:\testing\Mag.gdb"
SETINI PATH.LINE_COLOR="K"
SETINI PATH.LINE_THICKNESS="0.15"
SETINI PATH.TICKFLAG="0"
SETINI PATH.LABEL_FORMAT="TL"
SETINI PATH.LABEL_DIR="0"
SETINI PATH.LABEL_COMPASS="0"
SETINI PATH.LABEL_LOCATION="1"
SETINI PATH.LABEL_SIZE="2.5"
SETINI PATH.LABEL_COLOR="K"
SETINI PATH.LABEL_WEIGHT="0"
SETINI PATH.H_OFFSET="2"
SETINI PATH.V_OFFSET="0"
SETINI PATH.GAP="0"
SETINI PATH.THINRES="0.02"
GX path.gx
CURRENT Map,"e:\testing\Magnetics.map"
CURRENT Grid,"e:\testing\mag.grd(GRD)"
CURRENT Database,"e:\testing\Mag.gdb"
SETINI PROFILE.CHANNEL="mag"
SETINI PROFILE.SCALE="100"
SETINI PROFILE.BASE=""
SETINI PROFILE.LOG="0"
SETINI PROFILE.LOGBASE="1.0"
SETINI PROFILE.SMOOTH="0"
SETINI PROFILE.COLOR="MY"
SETINI PROFILE.THICKNESS="0.15"
SETINI PROFILE.STYLE="0"
SETINI PROFILE.PITCH="5"
SETINI PROFILE.PFILCOL="N"
4 www.geosoft.com
Target How-To Guide
SETINI PROFILE.NFILCOL="N"
SETINI PROFILE.GAP=""
SETINI PROFILE.JOIN="1"
SETINI PROFILE.PLOTORDER="1"
GX profile.gx
/-------------------------------------------------------------------------
/ LOG CLOSED : Mon Sep 10 15:37:46 2012
/-------------------------------------------------------------------------
For more information on using Scripts, see the Creating Scripts In Oasis montaj Technical Note, available online at:
www.geosoft.com/resources/technotes/
www.geosoft.com 5