Re: more focus loss issue
Re: more focus loss issue
- Subject: Re: more focus loss issue
- From: Cameron Simpson <email@hidden>
- Date: Fri, 07 Mar 2014 07:51:58 +1100
On 06Mar2014 11:01, Kevin Layer <email@hidden> wrote:
> I ready the previous thread about focus loss. I downloaded and
> modified watch_activations.py, but in my case, it shows this:
>
> Python[27581:1107] activated osascript ((null)) pid:27606 (null)
> Python[27581:1107] activated X11 (org.macosforge.xquartz.X11) pid:223 file:///Applications/Utilities/XQuartz.app/Contents/MacOS/X11.bin
>
> The thing that steals the focus is "osascript" and I cannot figure
> out, for the life of me, where this is coming from. [...]
> Any ideas how to track this down? It's driving me mad. Thanks.
[...]
Maybe something set up with Automator? Just a blind guess.
Anyway, while someone may well have a better suggestion, since
osascript is an executable you can intercept its invocation. That
should let you see what it is doing when the focus change occurs.
Create a log file to receive the tracing information:
>>$HOME/oascript.log
chmod a+w $HOME/oascript.log
and tail it:
tail -F $HOME/oascript.log &
Make a small wrapper shell script to write tracing information (and
error messages) to the log file. Save it as $HOME/bin/tracer.sh or
something (I will assume that path in instructions below, adjust
to suit).
#!/bin/sh
exec 2>>/Users/your-login-name-here/oascript.log
set -x
exec "$0-REAL" ${1+"$@"}
and make it publicly executable:
chmod a+rx $HOME/bin/tracer.sh
Get a root shell with "sudo $SHELL". (Assumes your account is an
admin account.) Insert the tracer into the osascript path:
cd /usr/bin
mv osascript osascript-REAL && ln -i -s $HOME/bin/tracer.sh osascript
As yourself again, test it by invoking osascript by hand in another terminal:
osascript -z
The error message should show up in the terminal running your tail command.
These instructions may contain typos. Be sure they make sense to
you before hacking! Feel free to ask questions.
Cheers,
--
Cameron Simpson <email@hidden>
The best way to rob a bank is to own one. - Roberto Calvi
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden