Quitting all foreground applications during install
Quitting all foreground applications during install
- Subject: Quitting all foreground applications during install
- From: "Robert Simutis" <email@hidden>
- Date: Thu, 12 Jan 2006 16:44:10 -0800
- Thread-topic: Quitting all foreground applications during install
Hi
all,
I need to produce
installers via PackageMaker which are capable of closing all open foreground
applications (aside from the Finder, the Dock, and the Installer.app itself, of
course), similar to the option available in Installer VISE. The
applications should all prompt the user to save and come to the foreground in
succession. (I have a stopgap measure which uses the
<installer-check> to look for open apps via the _javascript_ functions
available in 10.4 installers, and if any are open it blocks the install, but
this really isn't good for the user experience.)
Is there a reliable
way to close open applications with a relatively low amount of code, or is
there a flag in the .dist scripts that I've missed in the docs that can do
this?
I've taken a look at
using AppleScript to do this, but "activate" doesn't seem to reliably switch to
the next open application, the script will hang, and it's a confusing user
experience (code below):
prooperty no_kill :
{"Finder", "Dock", "Installer"}
set applist to {}
tell application "System
Events"
set applist to the name of every application process where it is not background
only
end tell
repeat with currentApp in applist
if (currentApp as string) is not in no_kill
then
tell application (currentApp
as string)
activate
quit saving ask
end
tell
end if
end repeat
If this is better
handled in calls from the Installer Plug-In via Objective-C, could anybody point
me to appropriate docs on which system component to talk to for getting info or
dictionaries on the currently-open applications and sending them appropriate
AppleEvents?
Thanks in advance
for any help,
-Rob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden