I was working on a long script and was interupted and I left it without saving. When I returned to drafts I was presented a new blank draft and when I went to edit the script reverted to the old version.
Two questions
I know about focus mode - would it have preserved my work?
Could an unsaved script be saved by default if the environment refers to a new draft?
Correct me if I’m wrong, but it sounds like you were editing your script in the script editor inside the action not in a draft. In that case, focus mode wouldn’t have helped, I’m afraid. If you don’t specifically save an action and leave Drafts, it tends to vanish without trace.
I’d say with a long script you’d be better off editing it in a draft and then pasting it into your action.
I’m not really sure what Drafts should actually do in this case. Saving the action automatically would cause major chaos. Maybe something like how Mail handles unfinished emails?
Yes that’s exactly what I was doing. I will take your advice and script in a draft in future. It would be good if the draft editor could be used as the default for scripts I think.