Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Created September 29, 2021 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmr/c663d3442d069f0a0f33f3e6859a0c75 to your computer and use it in GitHub Desktop.
Save ryanmr/c663d3442d069f0a0f33f3e6859a0c75 to your computer and use it in GitHub Desktop.
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