active-window icon indicating copy to clipboard operation
active-window copied to clipboard

Random crashes in OSX

Open sebszocinski opened this issue 8 years ago • 5 comments

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:

sebszocinski avatar Feb 02 '17 06:02 sebszocinski

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

sebszocinski avatar Feb 06 '17 04:02 sebszocinski

Same issue as you on Sierra 10.12.4. Not sure it's due to the OS...

joeybronner avatar Apr 11 '17 21:04 joeybronner

I am getting the same error. Any workaround?

techjewel avatar Oct 04 '17 06:10 techjewel

您的邮件,已经正确投递至youheng。

youhengchan avatar Jan 13 '24 07:01 youhengchan

Me to

Yokymia32 avatar Jan 31 '24 05:01 Yokymia32