Created
September 29, 2021 13:49
-
-
Save ryanmr/c663d3442d069f0a0f33f3e6859a0c75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date | |
import random | |
import sublime_plugin | |
def callback(s): | |
print('saved: ', s) | |
class SuperSaveCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
self.view.insert(edit, 0, "saving all the files") | |
today = date.today() | |
for window in sublime.windows(): | |
name = today.strftime("%Y-%m-%d") + random.randint(10000, 99999) | |
save_dialog(callback, None, "/Users/ryan/Documents/Scratchpad", name, "txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment