Code Monkey home page Code Monkey logo

devonthink-3-snapshot-mechanism's Introduction

GitHub Last Commit GitHub Issues

A Snapshots Mechanism for DEVONthink 3

Warning

  1. Do not use this as a backup mechanism. These snapshots should be considered a convenience. It was not intended to protect from loss of data. There is no safety net here.
  2. These are potentially destructive scripts. You cannot โŒ˜Z your way out of changes made by scripts.
  3. Finally, this is intended for markdown and/or plain text only.

The first script: Save Snapshot

The idea is very simple. I created custom metadata fields to store snapshots of the text (v1-v9) and the modification time (d1-d9). The first script is for storing the text. It will store the current text in v1 and throw what was in v1 to v2, what was in v2 to v3 and so on. What was in v9 says goodbye.

I keep it at the bottom, so I don't see it if I don't want to.


The second script: Compare/Restore Snapshot

The second script is for restoring a snapshot. When it is activated, it will ask whether you want to compare snapshots using BBEdit (could have used filemerge or something else, but I like BBEdit and you can install it for free) or simply restore to one of the previous snapshots.

The next dialog will prompt for the desired snapshot to be compared or restored.

If you chose to restore, that's it. The script will do so by replacing the text of the record by the stored snapshot and it will log the change in DEVONthink (I like how discrete the log is and prefer it over the notification function). If you chose to compare instead, you can make the changes you want and then save.

Here is the compare window open in BBEdit.


A third little script - Restore Directly to v0

Side-note: I am also keeping a v0, which is sort of a template for the note and which won't be touched by the first script. I also set up a special shortcut to restore directly to this snapshot without any prompts. This will be the third script.

#Applescript #DEVONthink

devonthink-3-snapshot-mechanism's People

Contributors

bcdavasconcelos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.