PSCAD provides the facilities to write scripts for you, through a script record feature:
First either create a new script or add an existing Python script (*.py) file. Invoke and display it in the Scripts pane.
Press the Record button.

Perform the steps to be recorded.
Press the Stop button in the Scripts pane to stop the recording.
That's it! You should be able to save and run your script immediately. Note that you may continue recording again at anytime.
For more information on automation via Python scripting, see Application Automation with Python.