This week's sponsor

iPhone Backup Extractor

Recover Lost or Deleted Messages, Photos & More

Posts tagged with "applescript"

AppleScript, the Perfect Adjunct to iTunes

Kirk McElhearn, writing for Macworld on automation in iTunes following Sal Soghoian's departure from Apple:

No application can do everything its users need, and none should offer everything they want. For this reason, AppleScript has long been the perfect adjunct to iTunes, which is already feature-rich (some say “bloated,” but I disagree), and doesn’t need more options and tools. Many of these AppleScripts are designed to tag files, edit their metadata to correct errors, improve consistency, and ensure that users can find the files they want, and help them efficiently use smart playlists.

It’s not clear whether the termination of Mr. Soghoian means the demise of AppleScript altogether, and particularly in iTunes, but many developers, iTunes users, and others are concerned by this decision.

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. Freedom to explore. Freedom to discover new ways to link applications, to interact with files, to create our own solutions. We can’t expect apps to cater to all our whims, and tools like AppleScript and Automator allow us to go a step further and discover ways to do things that Apple never even considered.

Losing AppleScript and automation features altogether would be a horrific loss for the Mac. However, I don't think that's going to be the case. Like Jason Snell, I believe today's Apple finds this stuff uninteresting and "vintage"; rather than removing it, I feel like they'll stop pretending they care about it, just as they did for Dashboard. Which isn't an ideal scenario either, but between two poisons, it's the one I'd pick.

See also: Dr. Drang back in 2013, 'When and why I automate'.


More On The AppleScript Improvements In Latest iWork Update

With yesterday's update of the iWork suite for OS X, Apple reintroduced several AppleScript functionalities that had been removed in October, and brought new scripting features to Pages, Numbers, and Keynote as well.

Ben Waldie published an overview of the changes at Macworld, noting that the AppleScript improvements aren't only focused on additions: Apple is now using a consistent AppleScript dictionary that should allow scripts to be easily reused across all iWork apps.

What’s especially interesting is that these suites are consistent from app to app. In other words, since all the apps have certain features in common, the same exact AppleScript terminology is used to script those features. This is huge: It means that if you write a script that builds a table or chart in Numbers, you can change the app name in your code to Keynote and your script should “just work” in Keynote. Want to add an image, replace some text, change the volume of every movie in a document? The code you write is the same for any of these tasks, regardless of which app you’re targeting.

When Apple relaunched iWork last year, they stressed how the apps had been rebuilt with full 64-bit support and a new unified file format. The return of AppleScript in iWork seems to highlight – as Waldie notes – a collaboration between different teams at Apple to improve consistency between apps, data exchange, and scripting features.

It took six months, but AppleScript appears to be alive and well at Apple. It may not be a priority anymore, and there's no denying that Apple put power users through a rough transition last year, but the new scripting capabilities of the iWork apps are fairly impressive and it sounds like there's still room for improvement.


Apple Updates iWork Suite with Design Tweaks, New Features, Sharing Improvements

In a series of updates rolled out today across, the App Store, and the Mac App Store, Apple updated its iWork suite of apps with design changes in the document editor, new templates, improved Retina display support, and several individual enhancements to Pages, Numbers, and Keynote.

On, the three web apps (which were last updated in January) have all received improved Retina display support and the possibility of opening documents directly from links in iCloud Mail. The document editor's design has been refreshed, and documents shared from can now be set to a view-only mode that won't allow recipients to edit them; previously, shared documents could always be edited by multiple users with access to a document's link.

Apple brought specific changes to each web app as well, such as improved popup menu support in Numbers and new templates, better text wrap, and the possibility to edit charts in imported documents in Pages. Read more

Mixed AppleScript Signals

Dr. Drang:

As for spreadsheets and presentation software, the only competition I’m aware of is Excel and PowerPoint from the MS Office suite. I’ve never used PowerPoint and haven’t used Excel in almost 20 years, but David Sparks says their AppleScript support was better than iWork’s even before the purge. Now Apple is essentially pushing its power users toward Microsoft. It’s a funny world.


AppleScript Support Effectively Gone From New iWork Apps

Clark Goble notes that, with the new iWork apps released yesterday, the AppleScript dictionary included in them has been so slimmed down it's basically gone. He has screenshots showing the regression, and he concludes:

What I suspect Apple doesn’t realize is how much small business and small shops workflow depends upon AppleScript. Casual use is fine. But a lot of people do more. It wouldn’t be so bad were there an alternative. This isn’t just like Apple not upgrading the Mac Pro. This is like Apple not upgrading the Mac Pro for four years, then announcing that the Mac Mini is the new Mac Pro. And discontinuing FCPX, Aperture, and its other pro apps and telling you to use iPhoto and iMovie.

It's baffling that the same company that brings these automation enhancements cuts AppleScript support in other Mavericks apps. Maybe the iWork team didn't have the time to rework AppleScript support for the new apps. However, as Dr. Drang notes, it's strange that AppleScript has been removed from apps that once had it.

I hope that Apple will put AppleScript back in a future update to iWork. I don't want to think that Apple just doesn't care about consumer apps also used by advanced users (with higher needs) anymore.



AppleScript, Automator, and Automation Improvements in Mavericks

I have been using Mavericks for a little while now and I have to admit that I was a little slow to get excited about this release of OS X. Once I started to sink my teeth into some of the power-user features, though, it didn’t take long for me to really get sucked into trying out every new geeky addition, specifically all of the new AppleScript features.

I will be the first to admit that AppleScript is not my favorite language and I only ever use it when I absolutely have to, but, with the release of Mavericks, Apple has added some very compelling reasons to give it another chance. I was recently discussing AppleScript with a developer friend of mine, and we agreed that since Apple had begun stripping out some script-related functionality of core apps like iTunes, it would not be surprising if the language was slowly phased out of any upcoming OS releases. However, I was wrong. In a surprising turn of events, Apple decided to breath new life into AppleScript and make it easier than ever to write clean and reusable scripts. Read more

AppleScript XML-RPC

Daniel Jalkut:

My mind was fairly well blown this morning to learn that for more than ten years, AppleScript on Mac OS X has included a built-in command for communicating with XML-RPC and SOAP endpoints on the web.

I had no idea this existed either. Following Daniel's example script, I have put together a Keyboard Maestro macro that, with a single hotkey, gets the latest post from MacStories, shortens its URL, and tweets it with Tweetbot. It's the Mac version of my Editorial workflow, and I'll share it soon.


Patrick Welker’s AppleScript and Keyboard Maestro Workflows for Lists

This is an amazing collection of workflows and tips by Patrick Welker, who explains how he automates list creation and management using AppleScript and Keyboard Maestro. The post also contains a modification of my recent Mail workflow to automate senders and signatures.

The hidden gem in the article, however, is the following sentence:

Since I’m deeply in love with Keyboard Maestro and want to preserve the just fallen in love kind of feeling in our relationship for as long as possible, I created a one-action macro to trigger the TextExpander snippet

The things you do for the apps you love.