So I threw this together.
example to show path of all open explorer windows:
import sublime_plugin
import Pywin32.setup
from win32com.client.gencache import EnsureDispatch
def run():
for w in EnsureDispatch("Shell.Application").Windows():
print(w.LocationName + "=" + w.LocationURL)
run()
Output:
- Code: Select all
User=
A Test Plugin=
Downloads=
Notice, you just need to call import Pywin32.setup once before your plugin accesses any win32api, win32com, etc. calls. Technically it only needs to be called once when Sublime starts, but there is no guarantee your plugin will start after Pywin32 gets loaded. That is why your plugin just needs to make sure by manually including it.
- This is only for ST3
- Not everything may work. I have only tested what I needed to use.
Good luck! And I am not responsible if something breaks
repo: