I want to update a time stamp string in ,html files on save. The following command updates the time stamp strang, but I do not see how to automate this to work on save, but only for .html files. Thanks for any help.
`import sublime, sublime_plugin, datetime
class TimeStampOnSaveCommand(sublime_plugin.TextCommand):
def run(self, edit):
content = self.view.find("", 0, sublime.LITERAL)
if content.empty(): return # no time stamp requested
content = self.view.line(content) # get whole line
timestamp = "Updated %s" % (datetime.datetime.now().strftime("%A, %B %d, %Y %I:%M:%S %p").lstrip("0").replace(" 0", " "))
self.view.replace(edit, content, "<!-- TSBegin --> " + timestamp + " <!-- TSEnd -->")
`