PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.
Run the script by either "File > Run script..." in the GUI menu bar, or via the command