Shortcuts + Applescript?

So, Shortcuts is coming to macOS with the ability to import Automator actions, from day 1.

Does that suggest that Applescript and other shell things included in Automator actions can be run in Shortcuts ?

I wonder what the “multiyear transition for automation on macos” will bring…

From the Shortcuts entry on

Advanced scripting
Pro users can enable AppleScript and shell script compatibility.

2 Likes

This is so cool :slight_smile:
I’m really not a touch person, plus I use my iPhone for minimal stuff only (tethering to my mac, a few communication apps) so I never really found a use for Shortcuts but I know my kids played with it.

What’s your take generally on this announcement ? Do you have an opinion on how Shortcuts can improve the AS experience ?

I’m like you regarding my iPhone, and it’s very early days, so I can’t add much. Clearly, though, it’s good news both for Shortcuts users (and would-be users), and scripters generally.

1 Like

Thinking as I type, if it could just ease the inter-app communication part of AS (like create an event in Calendar from data I get from Mail) that would be a huge improvement to the current experience.

2 Likes

Amazing stuff :slight_smile: So, basically AS is staying but Automator is on the way out. Until Apple figures out a way to replace AS, which will probably take place in the coming years…

I am glad AppleScript & Shell Scripting are going to still be around for the long-term. Which means I will still get mileage using AppleScript. I am glad automation is improving toward a more user-friendly direction; especially for more people who aren’t as technically-inclined.

I am curious to see how automation will go beyond this change in MacOS Monterrey. Any speculation ideas for how things are developing toward that future end?

Why would Apple replace AppleScript? JXA didn’t really take off. And a lot of stuff is written in AppleScript, probably including stuff the company itself relies on.

What stuff?­­­­­­­­­

I think a more accurate statement would be that a number of Mac services are dependent on Apple Events. That doesn’t mean AppleScript will have to stay around, but so far nothing has replaced it. One thing is definitely true: Various people have been predicting the death of AppleScript for over 20 years now. Yet it lives on, despite the challenges. An amazing story, really.

3 Likes

I don’t rightly know. And I wasn’t suggesting core apps were. Just that there is tons of Applescript out there.

And I would agree with @rayrobertson that Apple Events is more central and so perhaps more secure.

Apple is aiming at consistency across the platforms. With the move to Shortcut and the push to developers, (and the ability to create iOS apps from iPads) I don’t see how they can keep the experience consistent without adopting a swifty glue to put all that together. The keynote says (from memory) that Apple will roll out new automation over the coming (5?) years. My bet is that AS will be officially deprecated (like we officially suggest you move to such and such replacement we’re creating right now) within 2 years.

A new language seems unlikely (scripting and power-use is entirely consistent with the bicycle for the mind, but not with the shopping cart for the share-holder which speaks more loudly in resource-allocation meetings).

Apple Events on iOS look out of the question.

Among existing languages, Swift seems an unlikely match for casual cross-platform scripting. The various existing uses of JSContexts (cross-platform omniJS, Scriptable etc) might be pointers to stronger possibilities.

1 Like

How do you account for the huge amount of scripting done on almost all web pages?
And that uses JavaScript, of course.

It seems to me that the problem with JXA is not JavaScript – it is how poorly Apple implemented it and how poorly they have maintained and promoted it.

No offense to AppleScript (which I still use a lot) or all of you AppleScript pros, but JavaScript is, IMO, a hundred times easier to use and much more powerful than AppleScript – for anyone who has ever programed in a real language.

Where it not for @ShaneStanley’s many ASObjC examples and script libraries, I don’t think I’d still be using AppleScript.

It is totally unclear to me how Apple makes these technology decisions, except that they have been so successful in the mobile market that that is were all of their attention and expertise is.

IAC, I don’t spend much time sweating this because I have absolutely no influence over what Apple does. In fact, it’s not clear who, outside of Apple, has any influence. So, I’m not going waste what little bit of mental energy I have on this. I just try to take advantage of what’s available.

Any my most sincere thanks to all of you who have helped me so much.

2 Likes

Sorry, I did not mean that I think cross-platform scripting will be a thing. What I mean is that considering all Apple does for Swift, including the playground that converts into an app maker, I don’t see how they can leverage that much knowledge and experience without using something that looks like Swift. Or rather, how they would not want to leverage that. Hence “swifty”. But it is just off topic speculation on my part. I’m just super happy at the moment to know that I can use Shortcut with AS, and maybe that will be a good opportunity to learn Swift (create actions and whatnot).

A huge advantage of AppleScript on Mac is that it can be seamlessly integrated into Cocoa apps (as I’m sure you know anyway).

As far as I know, nothing like this can be done with JavaScript. So JavaScript can only be used as, well, a script with rather limited UI. While AppleScript can be a part of a full blown powerful app (or the entire app can be written in AppleScript).

Although I guess it somewhat supports your complaint about Apple’s “technology decisions”.

Apple did something they have never done before. They made Swift open source there people, including Apple employees maintain. But you also have people from Google and other places. Chris Lattner approach was to make a programming language to be easy to port. And Apple have bridge support between Swift and Objective-C so I guess it would be possible to make a new scripting language more swifty to be more powerful and easier to maintain, extend and support.

1 Like

There is this project which tries to provide an AppleEvent interface within Swift:

2 Likes

Sounds and looks interesting.
Has anyone actually tried/tested it?

1 Like