Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const key = Script.name() + " last run";
- /**/
- if (Keychain.contains(key)) {
- const lastRunMs = Number(Keychain.get(key));
- const lastRun = new Date(lastRunMs);
- log("Last run: " + lastRun.toString());
- } else {
- log("Script has not been run yet");
- }
- const now = String(Date.now());
- Keychain.set(key, now);
- log("Saved last run date");
- /**
- Keychain.remove(key);
- log("Removed key from keychain")
- /**/
Advertisement
Add Comment
Please, Sign In to add comment