23. Draft and save

Edits live in three places: in the tab’s memory, in the draft on your machine

and on the server. The difference between them is the topic of this chapter.

==Draft

Everything you changed, the editor writes to the browser memory in about a second after the last action. It happens on its own, there is nothing to turn on.

Closed the tab, reloaded the page, dropped the browser - the next time

When you open this script, a question will appear.

Question about the found draft
Figure 1. Local copy found
Local copy

Continue where you left off.

Version from the server

take what is on the server and forget the draft.

They ask once per script: the rejected draft will not come up again,

and new edits will be written on top.

Draft is not saving. It lies on your car and is visible only to you. Until you clicked Save, nothing has changed on the server, and your colleague

will not see your edits.

Drafts take up space in the browser, and this space is not unlimited: when

the budget is exhausted, the oldest ones are being forced out. Currently open script

is never superseded. How much is occupied can be seen in the diagnostic window.

==Save

Button Save in the header or Ctrl+S. Dot next to cancel buttons

means “there are unsaved edits”; After saving it disappears.

Saving is a common operation and should be done frequently. Separate "save"

and check” is not necessary: the editor itself checks the metadata version after each successful conservation.

Other actions

Save action menu
Figure 2. Menu under the checkbox next to the “Save” button

===Save As

Save As window
Figure 3. Creating a copy

Creates a new script with your edits, leaving the original one untouched.

The name is offered with the mark “copy”; you need to specify your own code.

Useful before a major rework: if it doesn’t work out, the original is still there.

History

Opens the list of versions - the next chapter is about it.

Discard changes

Discard changes window
Figure 4. Confirmation of cancellation of changes

Returns the script to what is on the server. All unsaved

edits are lost, and Ctrl+Z will not bring them back: the script is re-read

again.

Delete

Removes the script from the server. Asks for confirmation and is irreversible. It will be possible to restore a deleted script only manually - from history

changes, if it is maintained and preserved.

What prevents you from saving

No connection

the button will report an error. Wait until the connection is restored.

The version on the server is newer: someone saved the script while you were working. Understands xref:scripts:scripteditor/troubles.adoc[chapter on non-standard

situations].

Attachments are not fixed: the editor will name the files by name and ask

save again.

A habit that saves nerves: save after each completed piece of work, not at the end of the day. Then the version history turns out

meaningful - it shows what changed and when.

◀ 22. When something goes wrong

24. Version history and comparison ▶