Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi,

We get quite a lot of AppleScript based questions here.

I know when I was learning, I had to piece things together by asking questions on forums and mailing lists, and by dismantling other people's scripts in the hope I could make sense of them. It worked (eventually), but it was time consuming, frustrating and of course I made some dreadful gaffs along the way.

At that time, I'd have loved to attended a beginner's AppleScript course but none existed. And as far as I can tell, that's still the case. There's plenty for the big topics, Obj-C, Swift etc, but little for AppleScript.

I'm wondering whether it would be worth my while trying to organise something like that either classroom based or online? If you'd be interested then let me know on this thread, and also tell me what you'd expect to be covered.

What do you think?
 
I think it would be a waste of your time and effort given the state of limbo that AppleScript or automation in general is in these days on OS X. There's some stuff to be found on macscripter.net and iTunes. Big thumbs up though if your going through with this.
 
Just testing the waters really at this stage. If there's any interest then I'll pursue it further.

The background is this: In my day job, we have a bunch of apprentices being trained up. We have a shed load of AppleScript based solutions that they'll need to support - in the short to medium term anyway. It's impossible to find them a course to go on (as it was when I learnt). I know of at least one other company in a similar situation.

So, yeah, if anyone else is interested then let me know and we'll see where it takes us.
 
I like your idea!

Personally, I prefer AppleScript as an elegant way to execute command line stuff. Mainly for executing shell scripts that mostly depend on apps that are custom compiled from source code. I think, to cover the whole topic there is a basic understanding of shells and their scripting capabilities as useful as how to get code manually compiled or installed with a package manager. Not to forget to pass variables all the way round from AppleScript to shell script to CLI app and back.

Some more suggestions on topics:

- Differences to export an AppleScript as script, script-Bundle, app or text
- Useful application libraries, that are standard or those that can be loaded
- How to transfer what you read in the library references into valid code
- Different ways to invoke AppleScript apps per drag'n drop, double click or execute on finder selection
- Dialogs like choosing files, radio buttons, drop-down menus, simple OK and Cancel buttons or enter text for execution
- POSIX paths and aliases to work with files and folders
- Read files into variables and arrays, transform and pass them around, send output to files and screen
- Give your app a nice icon, localize an app

P.S.: The last point brings up the idea, that I'll hopefully find some more spare time quite soon to PM again...
 
Hi,

We get quite a lot of AppleScript based questions here.

I know when I was learning, I had to piece things together by asking questions on forums and mailing lists, and by dismantling other people's scripts in the hope I could make sense of them. It worked (eventually), but it was time consuming, frustrating and of course I made some dreadful gaffs along the way.

At that time, I'd have loved to attended a beginner's AppleScript course but none existed. And as far as I can tell, that's still the case. There's plenty for the big topics, Obj-C, Swift etc, but little for AppleScript.

I'm wondering whether it would be worth my while trying to organise something like that either classroom based or online? If you'd be interested then let me know on this thread, and also tell me what you'd expect to be covered.

What do you think?
Write free online tutorials and make a little with advertisements or author a book. It is my understanding that AppleScript was being phased out for JXA.
 
It is my understanding that AppleScript was being phased out for JXA.
I hope not. I'm not sure what Apple was thinking, since previous Ruby and Python efforts were a lot better - that thing is really a mess to script stuff with. Looking at StackOverflow, there is very little interest in Javascript for Automation, and personally I prefer using Swift as a scripting language over JXA.
 
In the last two or three years, AppleScript has gone through many changes.
To the point that you need to know which version of Mac OS the scripter is using, before you can advise on a coding solution to a particular problem.
So writing a book would border on pointless, as the code examples you included, could be out of date before you finished the publication.
As is the case for much of the AppleScript code examples you find on the internet, which are very often out of date, and do not work on many of the later Mac OS versions.

An Active online tutorial site is a much better idea, because example code could be updated on a regular basis, and be kept relevant to the newer OS releases.
Although you may find yourself having to post more than one solution to a particular scenario, based on several of the most recent Mac OS versions, it's probably more doable with an online tutorial site, than with a book.

As another poster has already pointed out, there is a big question mark hanging over AppleScript's future.
Apple seems to have fallen out of love with AppleScript, because it does not play nicely with the Gatekeeper and sandboxing rules.
So again a book could be irrelevant in a very short period of time, should Apple decide to eliminate AppleScript in future OS versions.

My own opinion is that Apple will probably eliminate AppleScript at some point in the not to distant future.
Which for myself will be a sad loss, as I do many of my projects in AppleScript, in preference to ObjectiveC or Swift.
Or at the very least, cut it's inter application scripting abilities, as Apple has slowly tried to achieve this more in recent times.

I understand Apple not wanting to release any secrets about it's future devices and technology, but I cant beleive that letting us know about future scripting plans on Mac OS, is of any major interest to Apple's competitors.
But that's where we are at present, so until a future for AppleScript has been decided, I would make sure a Mac OS scripting tutorial site, is able to activley change and develop, based on Mac scripting in general, and not just AppleScript.

But good luck with it.
And I'm sure you will find many contributors to help out, should you require it.

Regards Mark
 
Last edited:
Yeah, I always take the "AppleScript is on its last legs" with a pinch of salt. People have been saying that since I first started learning it, nearly 15 years ago now. One day, of course, they'll be right - but that's true of nearly anything! So I'll believe it when I see it.

I agree that writing a book is definitely not the way to go. And there are some decent online resources already. I was more thinking about people like our poor apprentices who will have to support legacy AppleScript based solutions, at least in the short term, and need to get up to speed fast.
 
I think your company apprentices would very much appreciate tuition on the legacy AppleScript automation solutions they are potentially going to need.
As a lot of the online AppleScript resources are not always usable for all situations, but tend to be more general Applescript language and syntax tutorials, or forum question posts about particular scripting problems on very particular projects.
For sure any learning materials that may help your colleagues and others, can only be a good thing.

And Yeah your right, AppleScript's demise has been touted for a long time, and in that time it's gone through many welcomed changes, and improvements.
The AppleScriptObjC framework springs to mind, and the introduction of Script Library bundles was also a good addition.

But I do think it's at a crossroad right now, and only Apple ultimately knows it's plans for AppleScript's future.
I kind of wish they would just come out and let us no the good news or the bad, I can't see any positives in leaving it's users guessing.
I currently have a couple of projects that I'm starting shortly, and would like to know if I'm wasting my time doing them in AppleScript, if they won't run on newer OS's.

Maybe the future is SwiftScript, a cut down subset version of the Swift programming language, without all that optional declaration, and optional unwrapping nonsense, with just the required basic AppleScript like data types, and access to the Cocoa framework classes.
That would work!

Regards Mark
 
Last edited:
  • Like
Reactions: 0002378
I used to freelance for a training company, about 20 years ago, I can only recall ever doing one AppleScript course for them - there didn't seem to be much demand.

Although we did try evangelising it in various ways, we never really got much positive feedback - despite the impressive things we could show people involving variously Filemaker, XPress and HTML authoring.

I think the general problem is that designers are designers and operators are operators, and they don't really want to step outside their safe zone.
 
Maybe the future is SwiftScript, a cut down subset version of the Swift programming language, without all that optional declaration, and optional unwrapping nonsense, with just the required basic AppleScript like data types, and access to the Cocoa framework classes.

Personally, I think that's sort of the way things will go in the longer term.

At the risk of veering off topic here, I'm relieved to hear someone else is massively frustrated by the continual optional unwrapping in Swift. I remember seeing optionals for the first time and thinking, "Seriously?". I've made a couple of half-hearted attempts to get into Swift but optionals are one of the things that start the downward spiral that ends with me thinking, "Y'know what, I'll stick with Obj-C for now". I'm sure one day my hand will be forced, and I'll have to make a more serious effort to learn it, but until then...
 
  • Like
Reactions: 0002378
superscape said:
At the risk of veering off topic here, I'm relieved to hear someone else is massively frustrated by the continual optional unwrapping in Swift. I remember seeing optionals for the first time and thinking, "Seriously?". I've made a couple of half-hearted attempts to get into Swift but optionals are one of the things that start the downward spiral that ends with me thinking, "Y'know what, I'll stick with Obj-C for now". I'm sure one day my hand will be forced, and I'll have to make a more serious effort to learn it, but until then...

Yeah, I was not bashing Swift.
I think it is a modern powerful object orientated language, and I can understand why the serious programmers and profesional software developers like it, in fact I kind of like it myself.
But my god!, it feels like such hard work trying to quickly knock up a little utility app.
So I don't think it's for the hobbyists, with very little spare time for coding.

I can see how the optional declaration and unwrapping feature makes the compiler engineers job easier, but does nothing to make the coders job any easier.
And I can also see how the compiler can be optimised for speed and performance with this mechanism in place.

But like you, I shall be resisting the change to Swift as long as I can, mainly because I just plain don't like the syntax.
And although I've coded for many years in various languages and operating systems, most of my projects these days are hobby projects, and I just don't have the time to devote to them as much as I have in the past, and Swift feels like such hard work, as opposed to something like AppleScript, where you can achieve almost as much as you can with ObjectiveC, but in half the time, while having twice as much fun doing it.

If AppleScript is to become a thing of the past, then something like the SwiftScript alternative I described is an idea I could get excited about.
And I beleive the casual or hobbyist coding community would also be grateful for it's creation.

I've long beleived that programming language syntax should NOT be designed by expert programmers, and the most clever compiler engineers, but SHOULD be designed by kids with rudimentary reading and writing skills, and then implemented and made to work by the clever experts and engineers.
That way everyone from 5 to 95 years of age could read and write code.
That's the way it should be!

Regards Mark
 
Last edited:
  • Like
Reactions: 0002378
without all that optional declaration, and optional unwrapping nonsense

YES !!! Glad to hear I'm not the only one who feels like smashing my computer against the edges of the neighborhood dumpster when I get a bunch of optional compiler errors !
[doublepost=1513464196][/doublepost]
I'm relieved to hear someone else is massively frustrated by the continual optional unwrapping in Swift. I remember seeing optionals for the first time and thinking, "Seriously?". I've made a couple of half-hearted attempts to get into Swift but optionals are one of the things that start the downward spiral

Yes ... just ... yes :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.