Re: what's in a standard library? [Re: Forward movement vs Tilting at windmills]
Re: what's in a standard library? [Re: Forward movement vs Tilting at windmills]
- Subject: Re: what's in a standard library? [Re: Forward movement vs Tilting at windmills]
- From: has <email@hidden>
- Date: Wed, 23 Nov 2016 23:03:26 +0000
On 23/11/2016 19:58, Stockly, Ed wrote:
It seems you wish to replace AppleScript with something different
that's more suited to programmers and developers without regard to
language.
SwiftAutomation is NOT an AppleScript replacement. It is an AppleScript
ALTERNATIVE, marketed specifically to a major, highly influential
audience—programmers—that AppleScript 1. does not and _cannot_ serve (as
25 years of programmer hatred of the language has proven), and 2. cannot
survive without (cos who d'you think writes all the scriptable apps that
make AS useful to you?).
SwiftAutomation has one goal: To make *automating Mac applications* easy
and attractive to programmers. They will _still_ hate AppleScript, but
that doesn't matter, because they will LOVE scriptable apps, and they
will both use them and create them, which benefits BOTH THEM AND YOU.
Please tell me if that explanation is clear to you or not? If not, which
part? Teach me, so I can do a better job of communicating to everyone in
future, and I will be immensely grateful to you (and no doubt everyone
else too!).
...
I've seen these before, and I wouldn't want them on my system, and if Apple ever decided to offer a standard library it
wouldn't be this.It seems you've disregarded the English-like syntax in
Scripts that AppleScript has used from the start, and that has always
been a selling point.
Eh, are you sure you're looking at the right libraries? The libraries
I've linked all use SDEFs to provide human-readable command syntax and
allow you to import library commands globally using AppleScript's `use
script "NAME"` statement. Examples:
uppercase text "foø bår" → "FOØ BÅR"
split text "Bob,Joe,Mary,Sue" at "," → {"Bob", "Joe", "Mary", "Sue"}
format date (date "Thursday, 7 January 2016 at 01:41:34") ¬
using {medium date format, medium time format} ¬
for locale "fr_FR" time zone "Africa/Addis_Ababa"
→ "7 janv. 2016 à 04:41:34"
sort list {2, 7, 4, 1, 9, 4} → {1, 2, 4, 4, 7, 9}
split path "/Users/jsmith/Documents/ReadMe.txt" at file extension
→ {"/Users/jsmith/Documents/ReadMe", "txt"}
Occasionally it's not flawless English, e.g.:
split path (POSIX file "/Users/jsmith/Documents/ReadMe.txt") at all
components
→ {"/", "Users", "jsmith", "Documents", "ReadMe.txt"}
would read better as:
split path (POSIX file "/Users/jsmith/Documents/ReadMe.txt") at each
component
→ {"/", "Users", "jsmith", "Documents", "ReadMe.txt"}
or it has to fall back to traditional user-defined identifiers when it
reaches the limits of what library SDEFs can do, e.g.
set obj to dictionary collection
-- add some key-value pairs
obj's addItem("red", {255, 0, 0})
obj's addItem("yellow", {255, 255, 0})
obj's addItem("green", {0, 255, 0})
obj's addItem("blue", {0, 0, 255})
-- get the value that is currently stored under the key "green"
log obj's getItem("green") --> {0, 255, 0}
or the order of the parameters makes the diction a little odd, e.g.:
delete from list {1, 2, 3, 4, 5} item 1→ {2, 3, 4, 5}
rather than:
delete item 1 from list {1, 2, 3, 4, 5}
but you actually sit down and design half a dozen dictionaries that can
be imported globally into an AppleScript without serious risk of
conflicting either with each other, or with all the other AppleScript-,
application-, and osax-defined keyworks also imported into that script,
and then you get back to me and tell me why I had to do it one way and
not the other. Hell, I'm the guy who pointed out how many potential
keyword conflicts and other problems library SDEFs would caused, and
even I got schooled when they caused several more problems on top that
not even I knew existed—and I've been studying AS dictionaries, learning
precisely how they work, and what their benefits and flaws are for more
than a decade.
So show me a better set of standard libraries that YOU propose for
inclusion in 10.13, over even just make helpful patches to the ones
we've got, or shut-up. 'Cos you've had three damn years to step up and
do the job right, to help both yourself and your community, and you've
not done squat—'cept moan when someone else does.
Frankly, I think someone's ego's feeling a little upset that his spot at
the top of the hill is not perfectly secure. Don't you worry, I have no
interest in usurping your king-hood; I have other goals. I am, however,
trying to save your damned hill from iOS-led extinction the best way I
know how, so if you've any better ideas on how to keep Apple from
quietly dumping it completely a few years from now, I'm sure everyone
here is all hears—certainly me most of all.
has
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden