Rather than writing a script by hand, we can record the commands we execute to make a script, called a Macro.
To do this, open the script page (shortcut F12) and click Start in the Macros frame. You can then perform normal actions, usually starting with closing the scripts page by retyping the F12 key.
The different actions performed are written into the macro. When finished, click the Stop button in the Macros frame.
We can then edit the resulting script, to remove duplicates or correct some points. For example in the macro displayed above, you can remove all setOptions that will not be useful to change the settings. Moreover the command Fix is not necessary because the command Enchainer(True) has been executed, and it enforces the Fix command after the openfile command. Once the script is correct, it can be relaunched (by the Execute button) or saved in a text file (Save button).
Note that the command to open or close the scripts page is not saved in the macro. If necessary, you can add manually with the command Script or the setScript(False) or setScript(True) syntax.