🖥 Macro to restore window/ desktops position once external monitor is reconnected?

I use Switchresx for this, but you can probably adapt THIS MACRO to automatically save and restore your window layout, triggered by sleep/wake.