Sure.
Here is my code, in this example only the 2nd show_input_panel is working (skip on the first one)
import sublime, sublime_plugin, ntpath, os
view = sublime.Window.active_view(sublime.active_window())
filename = ntpath.basename(view.file_name())
command = "bash script.sh " + filename
class RunplCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.show_input_panel("Please enter the directory name:", "something", self.on_done1, None, None)
self.window.show_input_panel("Please enter the desired examples photo range, ex: 40-250", "", self.on_done1, None, None)
def on_done1(self, user_input):
global command
command = command + " " + user_input
print (command)
And, as you suggested, I can call it from a callback, and it’s working! but it’s a bit ugly - especially when I have 5 agrvs
for example:
mport sublime, sublime_plugin, ntpath, os
import subprocess as sub
view = sublime.Window.active_view(sublime.active_window())
filename = ntpath.basename(view.file_name())
command = "ssh script.sh " + filename
class RunplCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.show_input_panel("Please enter the directory name:", "something", self.on_done1, None, None)
def on_done1(self, user_input):
global command
command = command + " " + user_input
self.window.show_input_panel("Please enter the desired examples photo range, ex: 40-250", "", self.on_done2, None, None)
#print (command)
def on_done2 ...
Is there any other way to do it? and why the first code skips to the last user input?