Re: Shutdown folder or similar
Re: Shutdown folder or similar
- Subject: Re: Shutdown folder or similar
- From: kai <email@hidden>
- Date: Mon, 06 Oct 2003 01:34:09 +0100
on Tue, 30 Sep 2003 22:03:51 +0200, Peter Mathiessen wrote:
>
In the old days running the MacOS 9 there was a folder called shutdowns
>
items or something like that. Is there something similar in the MacOS X?
Apparently not, Peter.
>
I want a script to be executed when I turn off my computer. Anyone who knows
>
if such a folder exist or if there is a other way to achive this?
There are a few caveats about what you're trying to do, which you should be
aware of.
In OS X, events that occur at startup and shutdown are outside the context
of any particular user - so login and logout may be more appropriate.
It's probably easier to initiate routines at login than at logout - so,
where possible, I'd use system preferences to add login items.
If your exit routines take too long (45+ seconds here), or if they involve
telling an application to do something, there's a chance you might interrupt
the logout process.
That said, you could always try using a stay-open script application that
contains a quit handler to carry out any essential exit routines - something
like this:
-------
on quit
tell application "Finder"
display dialog "Goodbye" buttons {"Goodbye"}
-- or do something a bit more useful
end tell
continue quit
end quit
-------
By adding the applet to your login items, it will launch automatically at
login. If you want to conceal its presence, you could modify it with a
resource editor, such as ResEdit:
http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Eng
lish-North_American/Macintosh/Utilities/
(Set the 'Only background' value of the 'SIZE' resource to 1. Take care when
using a resource editor and always work on a copy. Also, remember that
faceless apps don't provide a user interface, so dialogs, etc. need to be
handled by one which does - hence the Finder tell block above.)
All a bit of a fiddle. You could always consider a keystroke utility to
trigger a script that ends with a shutdown command - and use the assigned
key/combination to shutdown instead...
---
kai
_______________________________________________
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.