Save and close cleanly
Job.Save writes the active job to a .sg file. The filePath works
like Save As — pass any path you want; the file is created (or
overwritten) at that location. Wrap the work in try / finally so
Job.Close runs even if a step in the middle throws, otherwise the
service is left holding an active job and the next Open will
return 409.
The snippet below opens the Portal Frame.SG sample, saves it as a
new file on the desktop, and closes the job — useful as a template
for any "open something, save it as something else" workflow.
If you want to save to the path the job was originally opened from,
omit filePath — the API saves over the original. (Sample projects
opened with Job.OpenSample are unsaved and have no original path,
so you must supply one.)
See also
- File Handling — open, save, force-open, status, and the full set of file lifecycle endpoints.
- Concepts — The Active Job

