sourcegraph/thyme

Constant popups asking "Where is X?"

dangelov opened this issue · 17 comments

Hi,

Thanks for creating this app, been using it since yesterday on macOS 10.11 and it mostly works well. But some apps seem to trigger many of the "Where is X?" popups. I've had to select "Where is firefox" about 10-15 times now (using Firefox Developer Edition).

Screenshot is attached.

dew-57b48fabf25375 08736047

See #6, #29

Sorry, only glanced at those issue titles and seemed like they were more specific. Feel free to close/delete this one.

The maintainer can probably close the issue, but I think you can also close the issue in your github interface.

Using this as the canonical issue because it has the nice screenshot :)

Haven't been able to repro yet. Could you post system details from "About This Mac"?

image

alright :)

Sure, here it goes

screen shot 2016-08-18 at 07 10 07

Interesting, this is what my "Choose Application" dialog box looks like when I trigger it manually:

image

Notice the difference? All the names in @dangelov's window have ".app" at the end.

@dangelov I wonder if you replaced lines like this

  set procName to (name of proc)

with lines like this

  set procName to (name of proc) & ".app"

in https://github.com/sourcegraph/thyme/blob/master/darwin.go, maybe it will magically work?

Still unsure what's causing the difference. Anyone have any ideas?

I'd give that a try, but I have no experience with Go at all. How would I run/compile the modified program?

Here are my system details:
image

I tried this change

diff --git a/darwin.go b/darwin.go
index f7e5e6c..91dc1ec 100644
--- a/darwin.go
+++ b/darwin.go
@@ -42,7 +42,7 @@ repeat with proc in listOfProcesses
   log "PROCESS " & procID & ":" & procName
   -- Attempt to list windows if the process is scriptable
   try
-    tell application procName
+    tell application procID
       repeat with i from 1 to (count windows)
         log "WINDOW " & (id of window i) & ":" & (name of window i) as string
       end repeat

Which works in the sense that the window no longer pops up. However it does seem to break window name detection for some reason.
Output before change: http://pastebin.com/w70654cR
Output after change: http://pastebin.com/wpkKYna2

I also tried @beyang's suggested change

set procName to (name of proc) & ".app"

However that still gave the same popup. Seemingly the only difference is that now all names in the output json file now have '.app' as a suffix.

I see the same pop-up asking for mono on the 10.12 beta, too.

dmgig commented

I am also seeing this, mine requests "Where is applet?" and "Where is app_module_loader?". I'm using OS X 10.11.6 (15G31)

Cancelling the popup produces the following messages in the terminal:

me@mymac:~/thyme$ while true; do thyme track -o thyme.json; sleep 30s; done;
strconv.ParseInt: parsing "6.77651994E+8": invalid syntax
2016/08/19 14:07:05 strconv.ParseInt: parsing "6.77651994E+8": invalid syntax
strconv.ParseInt: parsing "6.77651994E+8": invalid syntax
2016/08/19 14:07:42 strconv.ParseInt: parsing "6.77651994E+8": invalid syntax
strconv.ParseInt: parsing "6.77651994E+8": invalid syntax
2016/08/19 14:08:16 strconv.ParseInt: parsing "6.77651994E+8": invalid syntax

I am experiencing this issue as well, it happens with Steam, Dota2, Electron apps (HyperTerm, VSCode), NW.js apps (PopcornTime).

Surprisingly it does not happen with Atom, which is Electron based

I have tried to select the binary file for the app for it is unclickeable in the file browser.

As a workaround just move the dialog elsewhere, it will not show up again.

Also, I get a console error with steam_osx windows, I will try to reproduce it and will update this comment.

Update:

Error in the terminal:

PROCESS 15515339:steam_osx
183:187: execution error: System Events got an error: Can’t get application process "dota2". (-1728)

2016/08/22 11:36:14 AppleScript error: exit status 1, output was:
PROCESS 57358:Finder
PROCESS 5633375:Google Chrome
WINDOW 44:DK Demo 🔊
PROCESS 12106635:Slack
PROCESS 12393425:iTerm2
WINDOW 2059:1. sleep
PROCESS 14618096:Atom
WINDOW 2168:Settings — /Users/montogeek/sdk
PROCESS 15515339:steam_osx

My system:
macOS Sierra 10.12 Beta (16A286a)

This has been driving me nuts for the past hour trying to trace the issue. I started using thyme earlier today, and now in the evening whenever I had Visual Studio Code open, a new Electron process would open up any time thyme was run. It would open up Electron.app from any npm project with electron-prebuilt installed.

So in my case, there was no "Choose Application"-dialogue, since it could locate a Electron app.

These steps might work to reproduce what I'm seeing:

  1. Make sure you have Electron (see code below)
  2. Start thyme loop
  3. Open an Electron based app (e.g. Visual Studio Code)
mkdir testapp &&
cd testapp &&
npm init -y &&
npm install electron-prebuilt &&
open node_modules/electron-prebuilt/dist/Electron.app # by launching here we make sure the app is found
# quit Electron

any solution?

This repository is currently unmaintained. Sorry, I may revisit at some point in the future, but feel free to fork!