# Getting started - Scripting
Simplygon will start the optimization once the sgsdk_RunPipelineOnSelection
function is executed in combination with a Pipeline object or a Pipeline file-path.
To execute a script in Max we need to open up a new script window, go to Utility panel -> MaxScript -> New script. In the new window, go to language and select MaxScript or Python. Now, copy either the MaxScript or the Python script below into the new script window. To start the script, go to the Tools-menu and select Evaluate All or simply press press CTRL + E. The optimized result will be returned to Max automatically once the processing has completed. If an error occurred it will show up in the MaxScript Listener.
# Next steps
Get to know how to use the Simplygon Max plug-in: