Re: Starting out with adding Applescript support to my Cocoa app (basic question about the best script interface)
Re: Starting out with adding Applescript support to my Cocoa app (basic question about the best script interface)
- Subject: Re: Starting out with adding Applescript support to my Cocoa app (basic question about the best script interface)
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 22 Jul 2005 12:20:44 -0400
on 2005-07-22 11:09 AM, Adam Holt at email@hidden wrote:
> 2. Create a new command with two parameters, so from script I would call it
> like:
>
> tell application "MyApp"
> sendmsg to "192.168.123.1:4444" message "This is the message"
> end tell
This one. Given your description of how it would be used, this is the
easiest and most intuitive way for your users to write it. If they want to
set parameters for the message, they will still be able to do so:
tell application "MyApp"
set myMessage to "This is the message"
set myURL to "192.168.123.1:4444"
sendmsg myMessage to myURL
end tell
But please don't call an AppleScript command something geeky like 'sendmsg'.
There is a strong tradition in AppleScript to write script statements so
that they sound like a plain-English sentence. It should be something like
this:
send message "This is the message" to URL "192.168.123.1:4444"
And try to support all the various ways in which URLs can be written, if
that is possible using your application.
Also, look around to see if other applications (particularly e-mail
applications) have settled on some standard terminology for a command like
this, then imitate that standard terminology exactly. There is also a
tradition in AppleScript of trying to make one's commands read the same as
they do in other applications that support similar functions. This helps
your users to remember the correct terminology, and it makes it easier for
them to migrate their scripts from your competitors to you.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden