Re: Restarting OSX through applescript
Re: Restarting OSX through applescript
- Subject: Re: Restarting OSX through applescript
- From: Christopher Nebel <email@hidden>
- Date: Sat, 6 Apr 2002 14:08:04 -0800
On Friday, April 5, 2002, at 05:58 PM, Sander Tekelenburg wrote:
Why does "shutdown" compile as a Finder keyword (clearly indicated as
such
by Script Editor's syntax colouring) if it isn't understood by the
Finder in
the first place? And why doesn't the Finder return an error, if it
doesn't
understand what it is being told?
Might this be... a bug? ;)
Not exactly. "shutdown" is a constant defined by, of all things, "path
to" -- it's a synonym for "shutdown items" and "shutdown items folder".
Most of the "path to" constants have a short form (e.g., "preferences")
in addition to a long form ("preferences folder"). Three-word ones have
an even shorter form that leaves off the "items"; I guess they were just
being consistent with "shutdown", but it's dangerously close to "shut
down".
As for why the Finder doesn't error, that's because it isn't being told
to do anything. AppleScript realizes that it doesn't need the Finder
just to evaluate a constant, so it doesn't even bother sending an event.
In other words, everything is working as designed, but part of the
design (defining "shutdown" as a constant) isn't very good. We've
really got to update those folder constants...
--Chris Nebel
AppleScript Engineering
_______________________________________________
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.