Writing an automated GUI to rename files by user input.
When I go to popopen the file in subprocess, the tkinter window loses focus, meaning I can't set focus on an entry.
I have tried time.sleep(), to see if I can give the GUI time to load. I have tried to force focus on the GUI.
def load(self):
if self.main_counter >= len(list_of_files):
self.close()
return
filepath = list_of_files[self.main_counter]
filename = os.path.basename(filepath)
filename_no_ext, ext = os.path.splitext(filename)
self.process = subprocess.Popen(
[exts_to_index[ext.lower()]] + [filepath],
stdout=subprocess.PIPE
)
root.title(filename)
self.entries[0].focus_set()
I need the Tkinter window not to lose focus, and the 1st entry remains selected, when opening adobe alongside.