How to switch to previously active document of same app?

Hey there nikivi, this is along the same lines as your initial question but only applies to Safari, it's a macro I made a while ago that will toggle between the last used tab is Safari, it's very useful but unfortunately is only useable within Safari (or Chrome, but this macro is only designed for Safari).