Re: close all programs
Re: close all programs
- Subject: Re: close all programs
- From: Andrew Oliver <email@hidden>
- Date: Fri, 28 Mar 2003 13:14:31 -0800
On 3/28/03 12:46 PM, "Rob Jorgensen" <email@hidden> wrote:
>
It might be in the legacy suite (I think it just hands the commands
>
off to System Events) but I just ran a script to quit Finder and then
>
ran Marc's script successfully. As soon as Marc's script called the
>
Finder, it launched and went on about its business. Tested with OS X
>
10.2.4.
>
>
I know that it is probably advisable to use System Events for the
>
sake of forward compatibility but I don't think that it's a deal
>
killer just yet. <shrug>
Sure, it will work under that situation, except launching the Finder may or
may not be what you want to do, but consider alternative environments:
For example, what if this script was being run periodically via cron or
other similar task scheduler, and there was no user logged in at the time?
You can't launch the Finder at that point, and your script will fail (of
course, quitting all apps in this situation might not make much sense, but
there are plenty of other times when you might want to schedule
system-related tasks when the Finder isn't available).
Also, although I haven't tested this, what happens if you run the script as
a different user? Mac OS X is a multi-user system at heart and it's entirely
possible for User B to log into the system remotely and run scripts while
User A is using the GUI/Finder. Again, you probably wouldn't be quitting
apps in this scenario, but using System Events overcomes this potential
flashpoint.
It's also a good practice/mindset to get into. Gone are the days when we can
be sure the Finder is around to do system-related tasks.
Andrew
:)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.