XClose
List Archives : http://void.nothingness.org
List Archives

XTension Discussion

Re: Bringing XTension Applicatin To The Front

From: "Petitgrand" <petitg-AT-llb.saclay.cea.fr>
Date: 13 Apr 2000 19:09:44 UTC   (03:09:44 PM in author's locale)
To: "XTension Discussion" <XTension_Discussion-AT-lists.bzzzzzz.com>
Joe Sonne wrote on Wed, 12 Apr 2000 11:50:34 -0500:

>I've been trying a couple of different scripts to get XTension to come to
>the front after a restart and they're not working. My problem is that
>there's a couple of programs loading on startup and one of them takes fairly
>long to come up.

Here is a solution I have experimented myself.
I know that Dean Davis has proposed another solution which involves an XTension
Start Up script .
But this solution has the drawback to postpone the 'bring to front' effect to
a (not well known) large time delay needed to launch other applications.
The one I propose work in real time

I have an Applet in the Start Up folder of the System folder. This stay-open
Applet is run at startup (no matter when) and watches periodically what are the
processes which are currently running. It compares them to a reference list and
when the two lists contain the same processes names it asks XTension to activate,
afterwards it quits.

on idle
set EndLoading to true
-- Replace below by your own Reference list of Applications
set ListApp to {"CameraManª Extension", "KQ Apple Events", "Finder", "Claris Home Page", "Eye On The Clock", "XTension"}
repeat with i from 1 to the count of ListApp
-- replace below (list processes)-->(list application) if needed
if item i of ListApp is not in (list processes) then
set EndLoading to false
end if
end repeat
if EndLoading is true then
tell application "XTension" to activate
quit -- quit the Applet
end if
return 2 -- Idle Period
end idle

The script is included in an Idle handler, which has two advantages:
- It lets most of the processor time for the launching process (on the contrary
to a repeat loop) : this prevents to inhibit or slow down the launching process.
- though it has a short idle period, the script is not run so often because the Mac
is quite busy with the launching process.

Additional Notes:
* The script uses a command "list processes" which belongs to an OSAX "Processes"
from Late Night Software . You could use instead the "list application" OSAX
from the GTQ Programming Suite.
* The reference list (called ListApp) needs some care. It must contains all processes
that are running after start up. But some of them do not appear in the App Menu.
(As an example, I have two of them in mine: "CameraManª Extension" and "KQ Apple Events").
The best way to get all of them is to run the command "list processes" in a Script
Editor window. But in that case you wil get "Script Editor" in the result list.
So you will have either to remove "Script Editor" from the reference list "ListApp"
before pasting it in the script, or to add an alias of the Script Editor in the Start
up folder.

Works well for me

Daniel Petitgrand

* List Archives

IMC GeneralRA-LThe Graphics ListThe Situationist ListXTension Discussion
 

This site made manifest by Manifesto software