Scripts and Commands

The Plan editor provides advanced control over the imaging session. It is possible to execute internal APT commands or external scripts and programs after exposure end. Enter the command that you want to be executed in the field “Script”. If you check the box “Wait script to end” the execution of the script/program will be synchronous and APT will not continue with the next exposure until the end of the external operation. Leaving it unchecked APT will execute the command asynchronously and will continue with the plan as soon as the script/program is started. The internal APT commands are executed always synchronously.
In order easily to see which lines in a imaging plan has advanced behavior, they are marked with apostrophe (') character. You can see this in both Plan Editor and in Camera Tab. 
You can combine the scripts/commands with 0s exposures. This allows executing a script/program or command without taking an image for example - to rotate to dome or to close the roof in the plan end.
In this example the lines 2 and 4 are set to execute internal commands without making exposures:
APT has a dedicated editor for Scripts and Commands which saves the need to format manually the required parameters. It also gives a short information about every command. To open this editor click on the button "Script or Command" in Plan Editor. The screenshot below shows a formatted command for GoTo with Ra/Dec populated using the Object Browser.
Here is the list of the supported internal APT commands and their parameters. Note that hash (#) is required in order to determine that you want to execute internal command
If the mount is not supporting movements by Alt/Az coordinates APT will convert them to RA/Dec for current time and for the current Location.
Tips&Tricks To make easier the use of #GoTo in combination with Object Browser, use Shift+Click on the OK button in the browser. This will store in the clipboard ready to use #GoTo with the coordinates of the selected object.
In case you want to execute external script or a program there are some parameters that you can send:
%LastFile% - the path and file name of the last saved image
%CurrExp% - the number of the current exposure
%TotalCount% - the total count of exposures to make in a plan
%EDuration% - the expected remaining duration (00X’ or 00X”)
%ETime% - the expected time when the plan will end
%PCBat% - the PC battery percent
%CamBat% - the Camera battery percent
%CamSpace% - the free space on the camera card
%ExifT% - the temperature reported by EOS Exif or by the CCD/CMOS
%Temp% - the temperature reported by external sensor
%Hum% - the humidity reported by external sensor
%DewP% - the dew point reported by external sensor
%RA% - the right accession reported by telescope
%DEC% - the declination reported by telescope
%Obj% - the entered object name
%FocalLen% - the entered focal length
%FilterPos% - the current position of the filter wheel
%FocusPos% - the current position of the focuser
%ImageY% - the image height
%ImageX% - the image width
%Pixel% - the pixel size
%Lat% - the site Latitude
%Long% - the site Longitude
%SQM% - the Sky Quality value
%ALT% - the altitude reported by telescope
%AZ% - the azimuth reported by telescope
Example : test.vbs %LastFile% %CurrExp%
This will try to execute the script test.vbs (if there is no path the script has to be located in the APT folder) and will pass path is file name of the last take image as first parameter and the number of the exposure as second one.
Tips&Tricks If a pause is defined it will be executed after execution of the command or script.