Hello,
Apologies in advance for such a newbie question. I have searched the Forum and have tried numerous approaches, but I can’t seem to get the Window open_file function to open a file! I have a TextCommand plugin with the following code that does not work, I get the error from Sublime: “Unable to open /home/public_html/asciidoc/functions/sys_init.txt”. Help greatly appreciated! I am on a Windows computer. Note: the call to os.path.exists is successful.
filepath = '/home/public_html/asciidoc/functions/'
filename = 'sys_init.txt'
if os.path.exists(filepath+filename):
v = sublime.active_window().open_file(filepath+filename)
else:
print('Oops!')
return 0