improve currentDocument
improve currentDocument

now it works if a different window is key

schriftgestalt/GlyphsSDK,simoncozens/GlyphsSDK,schriftgestalt/GlyphsSDK,schriftgestalt/GlyphsSDK,simoncozens/GlyphsSDK,simoncozens/GlyphsSDK,simoncozens/GlyphsSDK