active-window
                                
                                
                                
                                    active-window copied to clipboard
                            
                            
                            
                        Random crashes in OSX
Hey i've been giving this a good test and found it randomly crashes when switching windows. I can't seem to find a culprit it just appears to be random.
This is the error I see:
/usr/local/lib/node_modules/time-tracker/node_modules/active-window/index.js:42 throw stderr.toString(); ^ /usr/local/lib/node_modules/time-tracker/node_modules/active-window/scripts/mac.scpt:314:319:
For anyone else experiencing the same issues, I did some googling and found a post on stack-overflow that had a slightly altered version of the scpt file which so far has been much more stable...
global frontApp, frontAppName, windowTitle
set windowTitle to ""
tell application "System Events"
    set frontApp to first application process whose frontmost is true
    set frontAppName to name of frontApp
    set windowTitle to "no window"
    tell process frontAppName
        if exists (1st window whose value of attribute "AXMain" is true) then
            tell (1st window whose value of attribute "AXMain" is true)
                set windowTitle to value of attribute "AXTitle"
            end tell
        end if
    end tell
end tell
return {frontAppName,windowTitle}
Source: http://stackoverflow.com/a/40370228
Same issue as you on Sierra 10.12.4. Not sure it's due to the OS...
I am getting the same error. Any workaround?
您的邮件,已经正确投递至youheng。
Me to