
AppleScript, the perfect adjunct to iTunes: An open letter to Apple CEO Tim Cook - davidbarker
http://www.macworld.com/article/3142462/macs/applescript-the-perfect-adjunct-to-itunes.html
======
todd8
Next year I will have been programming for half a century; in this time I've
used a few dozen languages (counting things like awk, m4, and SQL in addition
to ordinary programming languages). AppleScript has to be near my least
favorite language. It's so called natural language syntax is verbose,
unintuitive, and ambiguous to me. Almost any real programming language would
be better: bash, python, Lua, JavaScript, tcl, ruby, whatever.

AppleScript seems to be a valiant effort to design a language for non-
programmers, but the English like syntax just adds complexity to writing even
simple programs.

See Dijkstra's take on "natural language" programming[1].

[1]
[https://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/E...](https://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD667.html)

~~~
tedmiston
You're also not the audience that AppleScript's natural language programming
was designed for (similar with Automator). Don't get me wrong, I feel the same
pain points, but AppleScript never was a programming language for developers.

~~~
CountSessine
I think its a lot worse than this though; it isn't realistically a language
for _anyone_.

 _Anyone_ working on almost any task in Applescript is going to be frustrated.
In particular, just the ambiguities in the language for doing simple queries
on containers makes writing even simple scripts needlessly painful.

~~~
__jal
This.

I can't remember what it was like before I learned a programming language. I
do vividly recall my fights with compilers, however, and imagining trying to
guess what Applescript wants in a particular context without reasonable
notions of what was going on under the hood, and I would have become a plumber
instead.

Applescript is horrid. Seriously, every time I try to write something in it,
it devolves into Googling for whatever weird, stilted 'natural language'
variant is needed in a given context in the best case. The worst case is me
wracking my brain for odd ways to write subordinate clauses that might make it
happier.

Applescript should be used as the definition of a write-only language. People
like to bag on Perl, but even if you hate everything about Perl, it is still a
vastly more human language than Applescript.

~~~
function_seven
> Applescript should be used as the definition of a write-only language.

It’s the opposite. Applescript is a _read-only_ language. Very difficult to
write, but easy to read code that’s already done. Whereas Perl is easy(?) to
write, difficult to read. So it’s a “write-only language”.

------
Osmium
All we can do is guess, but maybe they're retiring AppleScript specifically,
rather than automation support generally?

Yosemite added JavaScript for Automation (JXA)[1]. Very few people actually
enjoy writing AppleScript, I think most see it as a noble but failed
experiment in human-language syntax. Perhaps this is just a sign that Apple's
removing AppleScript altogether in favour of JavaScript?

[1]
[https://news.ycombinator.com/item?id=7862973](https://news.ycombinator.com/item?id=7862973)

~~~
mmastrac
I'd be very happy to see AppleScript retired in favour of JavaScript. The
pseudo-english syntax has always been painful. It might have been reasonable
with a good IDE, but I have never found one that can tell me how to write what
I want to write.

~~~
peterburkimsher
JavaScript is not AppleScript.

JavaScript is only useful with dozens of libraries imported, and they
introduce their own quirky syntax (I'm looking at you, JQuery).

JavaScript can't "do shell script" (even PHP can do exec).

JavaScript can't read and write files.

JavaScript can't read the selection in one program, pull data from another
program, and merge it in with something on the clipboard to piece together
what you're actually wanting.

JavaScript can't handle unicode to my satisfaction. Even escaping strings is a
pain. AppleScript's string manipulation is so clean. Regex that would be very
complicated to put together without a trip to StackOverflow is translated into
something super easy ("every word of last paragraph").

~~~
adrianmalacoda
JavaScript can do whatever the environment lets it do. Obviously browser based
JavaScript is extremely limited but JavaScript running outside of a browser
(e.g. on a server, or in a desktop application) can and does do all of those
things you say it can't do.

It's been a long time since I've ever done any AppleScript so I can't really
compare, but it does seem like the JXA environment can do any of those things,
since it has an Objective-C bridge[0].

[0]
[https://developer.apple.com/library/content/releasenotes/Int...](https://developer.apple.com/library/content/releasenotes/InterapplicationCommunication/RN-
JavaScriptForAutomation/Articles/OSX10-10.html#//apple_ref/doc/uid/TP40014508-CH109-SW1)

------
lostgame
Literally the only thing I'd improve about this article is that I wish they'd
not be so 'iTunes-specific'.

AppleScript is beyond useful for just iTunes - back in the 10.4/10.5 days, I
used to use AppleScript for some pretty interesting things, including
modifying the 'Extras.rsrc' file to perform some interesting functions like
colouring windows and changing font files that OS X simply didn't support at
the time.

I also recall making an AppleScript that did some other OS/GUI-level
modification, such as choosing to have my icons at the left side rather than
the right on the desktop (coming from Windows this was rather annoying)...it's
an incredibly powerful and useful tool when utilized correctly and I sincerely
hope Apple keeps it around.

EDIT: Damn, I looked around to find that old 'Cloak' program but it looks like
macthemes.net has been gone for a long time...makes sense since there's no
real 'scene' for that anymore as it's all dynamically-generated now :/

~~~
duckarmada
Hell, at my last gig, we used AppleScript to build custom DMGs. No doubt there
are probably easier ways to go about it, but we didn't need a GUI and the end
result was consistent.

------
dangero
Part of how Microsoft got into a bad spot was refusing to end-of-life
anything. The hardest choice in making products is what not to build and what
to take away. Apple cannot maintain an infinite number of components, so I
find this type of argument unconvincing. If this feature is so important I
need to see numbers. How many people are using it? The thing is, Apple
probably already knows this from system analytics and they know that they are
better off putting 50 engineers on facetime and zero on this. If you want to
argue a feature is important, show me numbers. They cannot please everyone.

~~~
ddebernardy
But they can please the right type of people. You know, the users who talk
about your product all day long to anyone you asks and end up bringing all of
their relatives onboard. You want those too, and raw numbers won't let you
know who they are.

~~~
dangero
It's a fair point. Not all users are equal but I'm very unconvinced by this
user's issue because there are a million little oddball use cases out there
and Apple does not solve those for everyone. The only issue here is that they
used to solve this issue for this user and now they are maybe taking it away.

~~~
foobarian
If they can mess with swipe to unlock and make my kid cry then really anything
is on the table and we just have to adapt.

~~~
Ar-Curunir
"Have to adapt"?

There's choice in the market, you know? I'm pretty happy with my Nexus 6P, for
instance.

~~~
foobarian
My kid is now very happy with my 6P too :-)

------
nemo
So long as OSA sticks around, it'd be hard to shed a tear over AppleScript -
you can use saner languages to do everything Applescript does through OSA.
AppleScript is a complete abomination of a language. Killing OSA would be a
terrible idea though. Not enough information to really know what's happening,
regardless.

------
ethanpil
LOL. He writes "You see, it’s all about freedom. Freedom to do things we want
that Apple doesn’t think we need to be able to do."

Apple was never about freedom. Apple has always been about control. They take
freedom and control away from consumers to deliver a "better experience" and
charge a premium for it. If you don't align with Apple's vision, you are
always SOL.

Their whole business model is built on a gamble that they know better then
everyone else. no Floppy, iPhone, iPad, no headphone jack... (although the
headphone jack is probably a bust)

~~~
fossuser
Yep - and this model generally works because when it comes down to it choice
sucks.

I'd rather have a high quality thing with good defaults than a thousand
different things to choose from. Ultimately the best would be a combination
where you have high quality software with sane defaults that also allows a
power user to make changes when necessary, but in practice it's hard to do
both without tradeoffs that cause you to end up with neither.

This doesn't mean I don't like playing around with linux or that everything
Apple does is high quality (looking at you Apple Music), but generally
reducing choices a user is required to make is a good thing.

~~~
ProAm
> I'd rather have a high quality thing with good defaults than a thousand
> different things to choose from

You're a one off edge case though. There is a line between flexibility and
lack of control.

~~~
simonh
Are all Apple's customers one off edge cases? That's an awful lot of one offs.

~~~
ProAm
He was complaining about an odd one off edge case of debating that quality
must come at the cost of flexibility....

------
jkaptur
I'm not an expert, but it seems like there's at least some separation between
AppleScript (the programming language), Automator (the visual IDE), and the
Open Scripting Architecture (the language-agnostic framework that actually
interacts with the OS and applications).

Does anyone know if it's possible to either build open-source clones of
Applescript and Automator? I can see why Apple would be leery of supporting a
team of people to support those, but maintaining and supporting the OSA seems
to bring a broad set of benefits.

------
qwertyuiop924
Apple, can you sink no lower? Even MS has this one figured out.

I guess I'm just pissed because Apple's stuff used to be so good, in so many
ways. Heck, I was raised on OS9, and later OSX (both PPC and Intel): I
couldn't stand Windows, and was an Apple fanatic for years, viewing even Linux
is a worse alternative. I only fell into the Linux thing because I was
building my own computer, and no way in hell was I installing Windows on it
(Yes, really: And what a faithful decision it was).

And now... Jeez. What a mess. Seriously, Apple. Up your game.

~~~
CalChris
I don't think Apple needs to up its game. I think it needs to put some of the
gray hairs out to pasture. If I see another video of Jony Ive looking
soulfully into the camera telling me that I really really don't need USB and
MagSafe because the future ...

Love my SE. Love my Mid 2014 MBP. Don't need a watch.

~~~
qwertyuiop924
Oh yes.

Speaking of which, have you seen CH's videos mocking this? They're quite
funny, especially the one on the iPhone 7:

    
    
      Apple: Johnny giveth, and Johnny taketh away.

~~~
DashRattlesnake
Here's the link:

[https://www.youtube.com/watch?v=RgBDdDdSqNE](https://www.youtube.com/watch?v=RgBDdDdSqNE)

------
chiph
I would think that if they're getting ready to introduce a replacement
technology ("SwiftScript" maybe?) they wouldn't let go their expert on the old
tech just yet.

~~~
spdegabrielle
Just Swift I hope. I'd guess it more likely that scripting was dropped
alltogether as the number of users of AppleScript is probably under 1%.

------
peterburkimsher
AppleScript is my first language. When I was 7 years old I learned a little
bit of Logo, but I stopped using it. When I was 13, half my life ago, I taught
myself AppleScript. Many of my scripts were for iTunes, but I also expanded to
scripting my whole OS. I still use it daily.

If there are any comparable programs for Linux, I really want to know. I don't
trust Apple's direction, and AppleScript is a killer feature tying me to this
platform for now.

------
vbezhenar
AppleScript just needs nice IDE with code snippets, etc. Script Editor is just
a bit more than TextEdit and it's not enough.

It's interesting language, but it's not used widely, so when you have to use
it, you need to remember syntax, etc, and that's much easier with good IDE. I
doubt that I would be happier to use Python, because I used it once or twice
in my life and I would google for every bit of language anyway.

------
based2
Bring us back another HyperWebCard with a born again ResEdit.

~~~
kkylin
Second that! Like many (almost all?) others, I find AppleScript the language
really painful to use. As I recall HyperTalk was similarly laden with
unnecessary syntactic sugar, but the HyperCard environment was so much fun to
use that I really did not mind the language.

~~~
watersb
I really enjoyed working in HyperCard, HyperTalk 2.0 -- but never felt that
way about AppleScript.

I don't know why, exactly. Perhaps it was that HyperCard defined a domain.
Applying the same primitives to every app could get clumsy.

A hand-waving example: making every useful procedure a function hanging off of
a single Window object. Except for the two functions that are actually in the
Application object...

(I don't have specific example at the moment but this sort of thing was
discouraging for me.)

~~~
kkylin
I think what was fun about HyperCard was that it was not purely textual -- a
lot of the work (and fun) in building a stack was graphical. AppleScript seems
more like a traditional programming language, but with syntax I have a hard
time remembering (only use it very occasionally) and a lot of extra typing.

------
hhas01
Please help us get SwiftAutomation into 10.13 by taking a moment to duplicate
the two following Radar tickets (include their rdar:// numbers to help Radar
maintainers determine they're dupes), and telling everyone you know to do
likewise, and so on:

[http://openradar.appspot.com/29329704](http://openradar.appspot.com/29329704)
[http://openradar.appspot.com/29363517](http://openradar.appspot.com/29363517)

More duplicate requests = more likely to get Apple's attention.

See also:

[http://lists.apple.com/archives/applescript-
users/2016/Nov/m...](http://lists.apple.com/archives/applescript-
users/2016/Nov/msg00182.html)

------
guelo
The concept of a general computer is under attack by Apple, Google and
Microsoft because consumers don't care and would ultimately prefer an
appliance over a general computer. I think it means that the future of general
computers will increasingly be relegated to open systems, namely Linux.

~~~
simonh
They're not attacking anything, they're just presenting an alternative. Nobody
is trying to take away your Linux distribution.

~~~
guelo
Maybe attacking was the wrong word. Apple and Microsoft, at least, have
historically produced general computers but they're moving away from that as
computers move more and more from the domain of us nerds to an everyday
appliance involved in all aspects of our lives.

------
tedmiston
> It’s not clear whether the termination of Mr. Soghoian means the demise of
> AppleScript altogether

It's _not_? It's pretty clear to me…

Unfortunately the effectiveness of this argument is lost in the times. The
author gets really caught up in metadata, bur we're in a year where Apple just
wants you to subscribe to Apple Music and stop managing music files manually.
To be clear, I'm not disagreeing with the author, just echoing why I think the
argument wasn't effective.

------
dahdum
AppleScript and other user automation are pro features. They've steadily moved
away from that market so I think it's unsurprising if it were retired /
abandoned.

~~~
aikah
AppleScript certainly doesn't feel like a language for "pro". It feels like a
language for people that can't learn regular computer languages. The irony is
a language with a small syntax is easier to learn than something that tries to
mimic real languages.

------
Animats
You want to script iTunes? That's such a niche usage that it's surprising
Apple allows it at all. ITunes is for content consumption.

~~~
adiabatty
I was going to say what I use Automator for in iTunes, but then I read the
article and what the author does is pretty much the same thing as what I do.

------
hashkb
OP understands the argument is about user freedom and wants Apple to act to
preserve it? Really? #wrongtree

------
graublau
Scripting iTunes metadata made sense when Apple wasn't pushing a streaming
service.

------
Jimmie_Rustle
|You see, it’s all about freedom. I think Apple would disagree with you

------
toyg
They have also just killed wifi routers, which likely means Time Machine is
also living on borrowed time (clearly it's all going to iCloud very soon).

At least this should free them to focus on their real revenue generators:
dongles and "jet white" phones.

