So what i planed to do, is:
1. create a new file with a random name
2. send some text into the new file
3. if i close the file (on_close(view) ?) delete the file from the drive
I managed to do 1) and 3). Anyone can help me out with 2) ?
- Code: Select all
import sublime, sublime_plugin, random, os, re
rand = random.randrange(1,1000000)
path = "N:/ahk work/" + str(rand) + ".ahk"
v = self.window.open_file(path)
def on_close(self, view):
fullpath = view.file_name()
match = re.match('.+\\d+.ahk$', fullpath)