stop ij.imagej batch process from stealing focus in OSX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

stop ij.imagej batch process from stealing focus in OSX

todicus
I am running a macro in batch mode on OSX 10.6, and I'd like to stop it from bringing the process "ij.imagej" into focus on every cycle.  In Ubuntu, this same macro runs fully in the background, so I can continue using the computer without being interrupted every 10 seconds.  Is there a "hide" command I can insert into the macro code, or some setting in the operating system?

      thank you very much --

                  -- Todd
Reply | Threaded
Open this post in threaded view
|

Re: stop ij.imagej batch process from stealing focus in OSX

ctrueden
Hi Todd,

I am running a macro in batch mode on OSX 10.6, and I'd like to stop it from
> bringing the process "ij.imagej" into focus on every cycle.


If the macro is completely non-interactive, you could try running the macro
from the command line in headless mode. The easiest way I know to do this is
with Fiji. See this page for details:


http://pacific.mpi-cbg.de/wiki/index.php/Scripting_Help#Running_Scripts_in_Headless_Mode

Unfortunately, I don't know a way to stop the ImageJ GUI from stealing the
focus in general. One option would be to do your batch processing in a VM
(e.g., VirtualBox) running a guest OS. Then the focus of the guest OS would
get stolen, but you wouldn't care because you would be busy working in the
host OS.

-Curtis

On Tue, Jul 20, 2010 at 3:46 PM, todicus <[hidden email]> wrote:

> I am running a macro in batch mode on OSX 10.6, and I'd like to stop it
> from
> bringing the process "ij.imagej" into focus on every cycle.  In Ubuntu,
> this
> same macro runs fully in the background, so I can continue using the
> computer without being interrupted every 10 seconds.  Is there a "hide"
> command I can insert into the macro code, or some setting in the operating
> system?
>
>      thank you very much --
>
>                  -- Todd
> --
> View this message in context:
> http://imagej.588099.n2.nabble.com/stop-ij-imagej-batch-process-from-stealing-focus-in-OSX-tp5318458p5318458.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: stop ij.imagej batch process from stealing focus in OSX

marshall2k
In reply to this post by todicus
todicus wrote
I am running a macro in batch mode on OSX 10.6, and I'd like to stop it from bringing the process "ij.imagej" into focus on every cycle.
Adding the flag -Dapple.awt.UIElement="true" should stop the process stealing focus. It also stops the coffee cup appearing the dock every cycle.

Example command:

java  -Dapple.awt.UIElement="true" -Xmx1024m -jar Applications/ImageJ/ImageJ.app/Contents/Resources/Java/ij.jar -batch ./macro.ijm


Apologies if this breaks a rule regarding resurrecting old posts but I searched for a long time to find an answer and I hope this saves other people time!
Reply | Threaded
Open this post in threaded view
|

Re: stop ij.imagej batch process from stealing focus in OSX

ctrueden
Hi Marshall,

> Adding the flag -Dapple.awt.UIElement="true" should stop the process
> stealing focus. It also stops the coffee cup appearing the dock every
> cycle.

That is fantastic! Thanks very much for that tip.

> Apologies if this breaks a rule regarding resurrecting old posts

Personally I hate those rules, and everyone who "enforces" them. So thanks
again for following up!

Regards,
Curtis


On Fri, Jul 19, 2013 at 4:48 AM, marshall2k <
[hidden email]> wrote:

> todicus wrote
> > I am running a macro in batch mode on OSX 10.6, and I'd like to stop it
> > from bringing the process "ij.imagej" into focus on every cycle.
>
> Adding the flag -Dapple.awt.UIElement="true" should stop the process
> stealing focus. It also stops the coffee cup appearing the dock every
> cycle.
>
> Example command:
>
> java  -Dapple.awt.UIElement="true" -Xmx1024m -jar
> Applications/ImageJ/ImageJ.app/Contents/Resources/Java/ij.jar -batch
> ./macro.ijm
>
>
> Apologies if this breaks a rule regarding resurrecting old posts but I
> searched for a long time to find an answer and I hope this saves other
> people time!
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/stop-ij-imagej-batch-process-from-stealing-focus-in-OSX-tp3687432p5004030.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: stop ij.imagej batch process from stealing focus in OSX

dscho
In reply to this post by marshall2k
Hi,

On Fri, 19 Jul 2013, marshall2k wrote:

> Adding the flag -Dapple.awt.UIElement="true" should stop the process
> stealing focus. It also stops the coffee cup appearing the dock every
> cycle.

Thank you very much! This was an annoying issue for me for a long time
when developing software on a Mac: unit tests were constantly interfering
with the tasks I wanted to perform while they're running.

I use that flag in ImageJ2 and SciJava-common now.

> Apologies if this breaks a rule regarding resurrecting old posts but I
> searched for a long time to find an answer and I hope this saves other
> people time!

Personally, I have little sympathy for people who think old posts should
not be resurrected, *especially* when somebody spent an effort to add new
information to it.

So: thank you very, very much!
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html