Menu function / shortcut to void take snapshot of changed documents on manual save

Hi.

I use the function to automatically take a snapshot of changed documents on manual saves a lot.
It is an important part of my workflow.

But… there are times when I made little changes here and there since the last manual save and DON’T want a snapshot to be taken on the next manual save, as those changes are not worth the size increase in the project.
Right now what I do in those situations is that I close and reopen Scrivener. It works, but it requires an interruption in my work, just at the moment where I am about to make some changes that I know I’ll want to snapshot.

It would be nice if there was a shortcut I could hit that would do what it does when I close and relaunch Scrivener. A function that would reset the “changed since” status of the documents (all of them) of my project, so that they are no longer eligible for the auto-snapshot on manual save.

The same reset that happens when I hit Ctrl-S and it takes a snapshot, but without the snapshot.

Thanks.

The variable that marks a section as “dirty” is probably not accessible from the UI for good reasons.

An AutoHotKey-script toggling the setting might work, so I had some fun creating it… :smiley:

ToggleSaveWithSnapshots.zip (441 Bytes)

You can update the keystroke to start it if you want. Now it’s Ctrl + Alt + S.
When it works as expected, remove or comment out the MsgBox lines.
It doesn’t report the last state of the toggle, so it could be improved upon. :wink:

2 Likes

Hi Antoni.

I haven’t got to try it as I am not currently on a machine with AHK installed, but I’ve read the script.
If I understand right, this toggles the setting on and off.
That’s a great start.

Could you make it so that it runs that (toggles the setting in the options) then does a manual save, then runs the script sequence as it is again ?

So, switch off the auto-snapshot, do a manual save (which resets the documents – “dirty”, as you put it), then sets the auto-snapshot on again.

Thanks M8 – Most appreciated. (Already, even without further tweaks.)

(I think the options panel could stay open between pass one and two. Could simply use “apply” rather than “ok” with a Ctrl-S (manual save) in-between the two options panel manipulations, then close the options, this time using “ok”.)

I could.

ToggleSaveWithSnapshots 2.0.zip (491 Bytes)

Note that the starting position of the setting will also be the ending position.
It’s still a toggle, but changed twice. :smiley:

1 Like

That’s the idea.
With a manual save in-between the two runs, that then causes no snapshot to be taken (because run 1 switched off this option), and resets the “changed since last manual save” status of the concerned documents.

Thanks, will try that new version shortly.

Issue :
The first toggle of the setting doesn’t work. (Everything is fine, but comes the time to uncheck the option, it doesn’t and moves on to the next step.)
The second one (second run) does.
(At the end, at the very end, the option is unchecked instead of being checked again [Because it worked the second time but not the first], and a snapshot of changed since document was taken.)

. . . . . . . . . .

image

TAB 3 … TAB 4 (Could that be the issue ?)

I changed the TAB 3 for 4 like it is in the second run, but that didn’t work either.

(I saved the script, then double-clicked it to replace the current running version. But do not trust me with that. Test it yourself. :melting_face: )

Works on my machine. :smiley:

The first set of Tabs is the way to select the option from the menu, the second set to select the same option but from the Apply botton, so that won’t work.

I’m on my end-of-year party now, so don’t expect updates soon. :wink:

Have a good one.
image

And thanks. I’ll fiddle around. Figure out what’s different with my computer.

It works. :slight_smile:

I installed AHK on my second computer, but the script was doing the same thing again.

And then I copied the pause underneath the line where it hits spacebar to toggle the setting and now it works.

I did this on a hunch after noticing that the setting was flinching, as if toggled off and on super fast. (Don’t trust me with radioactive components, but this works.)

A million thanks, Antoni.

…I’ll have a couple of questions, probably, but they can wait 'til next year.

1 Like

Oh no…
It works (the script does), but now that it goes all the way properly, I realized that it doesn’t void the subsequent snapshot.

:face_with_spiral_eyes:

. . . . . . . . .
It is the app that is not doing what it says it would. (Somewhat.)

It seems that the only way it’d work would be to shutdown / restart Scrivener, or if the devs implement it, or if someone can figure out another way. (Not sure I’d be fond of automating something that would alter the project as a file… ← Just joking, I am not. Definitely not.)

So saving isn’t going to work for you, but restarting would. I have a script that does that. I created it for building Themes. Used that in following update:

ToggleRestartWithSnapshots.zip (539 Bytes)

I noticed this script doesn’t work when you’ve selected another page than General. I have no solution yet, unless someone knows a way to select the icon for General at the top of the Options window using Keys. Maybe a mouse click on a certain position from the Option Window’s top left corner? I will have to investigate, done it before…

Hi Antoni.
I read the script. I am afraid I wasn’t clear enough and made you work too much for nothing.
The script doesn’t need to toggle the saving options in this context. The option to take a snapshot on manual saves can be left untouched (on).
All that is needed is for Scrivener to shutdown and then restart/reload the previous project. That’s all it takes for documents to forget their “changed since last manual save” state. (It would be nice if the script could work even if there are more than one project open at the time. Close the active one, then somehow fetch it back from the recent projects list. So that having only one project running isn’t a condition.)

Thanks for the time you put in this.