I working on a plugin which will generate some file and I need to prompt the user somehow so that he selects a folder where these files will be generated.
Is there a way to do this with Sublime Text 3 API?
I working on a plugin which will generate some file and I need to prompt the user somehow so that he selects a folder where these files will be generated.
Is there a way to do this with Sublime Text 3 API?
Probably the most straightforward way would be to open an input box (
sublime.show_input_panel()
) with a default value and allow the user to enter their own path if desired.If you were using the standard Python 3 distribution from python.org, you could always use something like
tkinter.tix.DirSelectDialog()
ortkinter.filedialog
, but the stripped-down version of Python 3.3.3 shipped with Sublime Text 3 does not include several modules, includingtkinter
. If a graphical interface is important to you, you may want to consider including a small GUI toolkit like easygui with your plugin.