• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
I wish Apple would follow its own advice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I wish Apple would follow its own advice


  • Subject: I wish Apple would follow its own advice
  • From: Michelle Steiner <email@hidden>
  • Date: Sun, 2 Oct 2005 08:52:16 -0700

A while back, Christopher Nebel gave us a link to guidelines for writing scriptable applications.

<http://developer.apple.com/technotes/tn2002/tn2106.html>

I wish that Apple's software designers would follow those guidelines.

For instance:
Scripting the Selection

The selection, in scripting terms, refers only to selected model objects. Do not attempt to represent the selection in dialog boxes. Not all applications need to support scripting the selection – for some very simple ones, such as control panel-‌like applications, it may not be meaningful.

<snip>

The selection property

<snip>

Multiple selections in one window

Some applications have multiple views in one window, each with its own selection. For example, viewer windows in Mail can have as many as three selections: the selected mailboxes, the selected messages within that mailbox, and the selected text within a message. Only one of them should have focus, and this determines the value of the selection property for the application and the window as a whole. (If you have trouble determining where the focus is, think of it as “if I select Cut or Copy, what data will go onto the clipboard?”) In such cases, you should add additional “selected thing” elements to get at the various sub-‌selections. For example, Mail would define the element types selected mailbox, selected message, and selected text.

another example:

Provide good error messages.

Cocoa Scripting’s default error messages are written in generic programmerese (such as “NSReceiverEvaluationScriptError: 4”) rather than specific English (such as “Can’t get window 17”). As of Mac OS X 10.3 (Panther), you can set your own error numbers and messages by calling [NSScriptCommand currentCommand] and then calling -setScriptErrorNumber: and -setScriptErrorString: on the returned object. See the NSScriptCommand documentation for further details.

Admittedly, this is only for Panther and beyond, but when they rewrote applications for Panther, they could have implemented this suggestion too.

-- Michelle

--
The problem with political jokes is that too many of them get elected.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: I wish Apple would follow its own advice
      • From: "John C. Welch" <email@hidden>
  • Prev by Date: Re: Problems saving applet with custom icon--icon gets stripped by PackageMaker
  • Next by Date: Re: scripting Apple Mail.app
  • Previous by thread: Re: Find and replace space by the Terminal equivalent
  • Next by thread: Re: I wish Apple would follow its own advice
  • Index(es):
    • Date
    • Thread