What’s new with automation in Yosemite

Apple introduced a great variety of new automation features and updates in Yosemite. I've written up a quick summary below with links to more detailed information.

AppleScript

AppleScript users have been requesting a built-in progress indicator for years. In Yosemite, Apple delivers. New AppleScript properties allow script developers to show and control a traditional progress bar in applets. In Script Editor, progress is shown at the bottom of the main window. For the Scripts menu, an "Automation" menu appears to show progress.

CombinedProgressFrom left to right, how the new progress indicator displays in applets, in Script Editor and the Automation menu (run from the Scripts menu)

For more information, see this short video from the new features page at macosxautomation.com.

AppleScript users have been able to access the power of Objective-C since the introduction of AppleScriptObjC five years ago. Originally, script developers had to learn to use Xcode to take advantage of this feature. In Mavericks, AppleScriptObjC can be used directly within regular scripts, but only through the use of separate script library files saved in a special format.

In Yosemite, separate libraries are no longer needed: AppleScriptObjC can be used directly in any script. Shane Stanley has released an update to his book, Everyday AppleScriptObjC, which covers how this works. As usual, Shane's book contains a lot of powerful sample scripts with detailed explanations. In the introduction he writes, "…in Yosemite, AppleScriptObjC is available everywhere, all the time. Truly Everyday AppleScriptObjC…Welcome to the modern world of AppleScript."

For power users of AppleScript, streamlined AppleScriptObjC access is the most significant new feature. But Yosemite also brings some improvements to AppleScript handler parameters, do shell script, as well as bug fixes. See the full release notes for more information.

Automator

Otto is getting some love in Yosemite as well. Workflows can now be saved as Dictation Commands, a new feature in Yosemite which appears to be an improvement over Speakable Items. A post by Christopher Breen at MacWorld covers how to turn on Dictation Commands and then start a workflow with a spoken command. (Red Sweater developer Daniel Jalkut discovered that Dictation Commands can also launch scripts.)

Sal Soghoian has released a set of new Automator Actions for Keynote. These are not included with Yosemite, but are available as a free download. The set includes many cool actions here, including Present Slideshow with Narration and Add Charts with Numbers Table Data.

CombinedNewActions2Two of the new Keynote Actions available for download.

Automator in Yosemite has a new Run JavaScript action allowing Automator users to call custom code written in JavaScript for Automation (see below for more info). This new action works in the same way as the existing Run AppleScript action.

New scripting support in iWork applications

Pages, Numbers and Keynote now all provide scriptable access to placeholder text objects, including a tag property for specifying a custom script tag to make it easier to change objects via scripting. Pages has added the ability to assign a tag for placeholder text in the user interface with the "Script Tag" field shown below.

PagesScriptTag3
The new Script Tag field in Pages makes it possible to assign custom tags to placeholder text for easy access via script.

To demonstrate these enhancements and provide some cool mail-merge/database publishing capabilities, see the new Pages Data Merge application. A demo movie provides more information.

As an automation developer, I'm always looking for better scripting support in Apple's own applications. Even with all this news, I find the new Script Tag field in Pages one of the most encouraging automation improvements in Yosemite. It is great when Apple adds any new objects to a scripting dictionary, but to add a user interface element specifically for working with scripting automation is huge. Let's hope we see even more of this in the future.

I've examined the scripting dictionaries of all three iWork applications, and beyond placeholder text and cosmetic improvements I see one new feature: Numbers has scripting support for the new Transpose feature.

JavaScript for Automation

There is now a new choice in writing scripts: JavaScript for Automation (JXA). Every application which supports Apple Events can also be scripted via JXA, which works via the scripting bridge.

Past attempts by Apple and third-party developers to bring Apple event support to sophisticated scripting languages such as Ruby and Python have not seen widespread adoption. But JXA has two big advantages over previous efforts: 1) JavaScript itself is hugely popular, with a great number of users developing for web browsers and other purposes. 2) Apple has integrated support for JXA directly into Script Editor.

You can use Script Editor to view dictionaries detailing an application's commands and objects. Like AppleScript, JXA can access Objective-C and Cocoa frameworks. The latter feature has led to some excitement at the prospect of using JavaScript in Script Editor to develop native Mac OS X applications with rich interface elements. While the idea of avoiding Xcode to develop applications certainly has appeal, I'm interested to follow what kind of success JXA developers have with writing Mac OS X apps without Xcode.

AppleScript users have had access to this feature for years, but other than the good work by Doug Adams at Doug's AppleScripts for Itunes, I have yet to see many AppleScript users adding interfaces this way. Instead, Automated Workflows and other developers have used AppleScriptObjC in Xcode to develop full-featured applications, perhaps in part due to the availability of Shane Stanley's excellent book on the subject, AppleScript Objective C Explored. I would advise JXA users wanting to develop apps to read this book. It has an excellent summary of the most important Xcode features, and much of the information about when classes (coming via the scripting bridge) need to be coerced is applicable to JXA as well.

Resources for learning more about JXA include a new video from Sal, Apple's release notes, and the JavaScript for Automation presentation at WWDC 2014.

Extensions in Yosemite

Automation in the AppleScript world has often been about scripting multiple applications to interact with each other. For years I've been using AppleScript to build scripts which grab data from apps like Word, Excel or FileMaker, generate sophisticated charts and other graphics in Illustrator, use InDesign to combine it all together in a sophisticated page layout, create PDFs and then distribute the final product via e-mail, FTP or other means. AppleScript can make this into a one step-process.

The ability of Mac applications to interact with each other faced some new challenges with recent OS X sandboxing restrictions. In Yosemite, we are seeing a new effort by Apple to standardize how applications can interact: Extensions. Alex Guyot with MacStories has an excellent article covering Extensions in Yosemite. (He also discusses JXA.)

Currently, Extensions allow for some UI-centered interactivity between applications. Automation developers may find immediate use for FinderSync Extensions and possibly other types of Extensions. Will Extensions in the future allow new ways to automate complex workflows? I hope so, but much remains to be seen about how developers will employ Extensions, and if Apple will open up the technology to scripting.

The future of automation

With so many improvements I've only see one errant assumption made by a few people: With JXA, Apple is finally replacing AppleScript, some say. Wrong.

There are many reasons why AppleScript will continue in the future, but a single point is enough to make it clear. Note all of the improvements to AppleScript in Yosemite described above. Why bother if AppleScript was being replaced? Case closed.

Perhaps the more interesting thing to watch is whether JXA will see widespread adoption. I can see many users developing solutions with JXA in Script Editor. And a few going on to develop full-fledged applications in Xcode. But AppleScript developers have many great tools for development that go beyond using a basic editor while avoiding the challenges of Xcode: Late Night Software's Script Debugger, Satimage's Smile, and ASObjC Explorer are all useful development environments with different features. I'm interested to see what third-party editing and development tools will emerge for JXA, but often a strong user base must emerge first.

Regardless, with new features available in Yosemite, the future of Mac OS X automation is strong, and AppleScript will remain a big part of that.

-Ray Robertson
ray@automatedworkflows.com

Now on Twitter—and praise for Anne-Marie Concepción, the Vin Scully of lynda.com

Automated Workflows now has a company account on Twitter: @scriptsmatter

It's my first venture into Twitter-dom, and I owe many thanks to Anne-Marie Concepción. Her excellent Twitter for Business course at lynda.com was very helpful. I’ve viewed several of Anne-Marie’s courses over the years, and they were all outstanding.

Anyone who has followed Anne-Marie’s career at Seneca Design, InDesignSecrets and elsewhere knows that she is extremely knowledgeable about the publishing world and covers some other fields as well. I’ve seen her give conference presentations on InDesign and would rank her among the best.

Confession: I have a very critical nature. Show me an Apple keynote and I’ll list 20 things which could have been done better. I’m so critical that when I’m leading a seminar I think, “Please, please don’t let there be anyone in the audience like me.” I don’t want to see that person's feedback form.

Still, there are many top-notch presenters and trainers deserving of praise. Among lynda.com authors, Anne-Marie is the best. What makes her so special?

Then I realized…Anne-Marie as the Vin Scully of lynda.com. Yes, I love baseball. And although I’m not a fan of the Los Angeles Dodgers, frequently I will tune into a Dodgers broadcast just to listen to Scully call the game. He’s simply remarkable, broadcasting the entire game solo as opposed to the two- or three-person crews covering most other teams. The rest of the announcers have conversations with each other throughout the game. Somehow Scully manages to have a conversation with the viewer.

That’s what Anne-Marie does at lynda.com: she has a conversation with the viewer. There are some very good lynda.com authors, but it is obvious many are reading from a script. Not so with Anne-Marie. She comes across as having something to share with you—the viewer—and she wants you to know it because it is important, as if she were talking with you at a coffee shop. That's very challenging to do when it is just you and a computer in a recording room.

In general, I find lynda.com a great resource, well worth the monthly fee my business pays. Imagine all the various Mac programs which people ask me to automate. Knowing a program well is just as important as knowing a scripting language. How can I keep track of the ever-changing features?

I could turn to documentation, books and web searches, but the written word often goes to torturous lengths to describe an interface, with long descriptions and screenshots spread across multiple pages. Videos are so much better for this type of learning. What about free videos on YouTube and elsewhere? A few can help, but the lynda.com courses are far more consistent in quality, and the interface has some very helpful features, such as the complete written transcript (love it) and the new ability to save notes.

With all that being said, not everything at lynda.com is great. I can’t recommend the AppleScript course, even as an intro. And the most common problem is authors talking way too fast. As in I've-got-so-much-to-tell-you-but-want-to-keep-this-section-under-x-minutes-so-I-will-cram-in-so-much-that-you-will-retain-almost-nothing. Critical me.

Back to Anne-Marie. I've received nothing but positive feedback when I’ve recommend her courses to others. Don't think she does this well just because she is a natural. A lot of hard work goes into each video course, to say the least. At last count, she appears to have done 22 videos on social media and Adobe products. In my mind, that’s the equivalent of writing 22 technical books. Wow.

I don’t know the inner workings of lynda.com, but I would hope there is some type of internal course for first-time video authors—something every presenter must view before developing a course. If there is such an internal video, by all means it should be done by the best: Anne-Marie Concepción.

Full disclosure: I’ve met Anne-Marie three times at events, and about 10 years ago she was kind enough to make a home-cooked dinner for me and a travel-weary Australian in the land of Chicago. A memorable meal.

-Ray Robertson
ray@automatedworkflows.com

Stepping in…

Apple has made a great decision in hiring Ben Waldie.

As another consultant in the automation world, I've long admired Ben’s work at Automated Workflows. He is far more than just an expert developer. He has been a great advocate for AppleScript, Automator, and other Mac-based automation technologies. Through presentations, articles, books and app store products, Ben has shown what great things can be done with Mac automation.

I also happen to know that Ben and his wife Jen are just really nice people. I’m sure great things await the Waldie family in California. In accepting the new job, I know Ben had concerns about making sure his clients and products would continue to be supported.

That's where I step in. My main goal is to provide the same great custom-developed solutions and prompt service to existing clients. I also look forward to continuing to maintain and enhance the company's excellent products, as well as taking a larger role in serving as an advocate for automation technologies.

Filling Ben’s shoes would be a difficult task for anybody. Fortunately, we share the same commitment to quality service and much of the same technical expertise. I've been working with AppleScript and other Mac automation technologies for over twenty years, and have also worked with other languages and applications. I’ve even done some iOS programming, creating an early iPad app which was recognized as New & Noteworthy by Apple.

If any tasks are outside my area of expertise, I have a network of skilled developers and consultants. A long-time associate is Shane Stanley, who many recognize as an expert in this field. Shane wrote the book on AppleScript Objective-C programming, and more recently has branched into Objective-C development with his own application, ASObjC Explorer.

As a trainer, I organized and co-taught AppleScript Pro Sessions, a five-day in-depth training event. I've led seminars for Adobe and Apple, including a very successful European tour focused on automating InDesign, Photoshop and Illustrator with AppleScript. I enjoy teaching and sharing videos with helpful tips and techniques.

Like Ben, I've been able to create some very sophisticated custom solutions for a wide range of purposes, helping individuals, small businesses, and Fortune 500 companies. I look forward to continuing this role through Automated Workflows. I've told students and clients that automation is often only limited by the imagination. I have years of experience in coming up with creative solutions to some difficult workflows.

Contact me today about saving time and money through automation, and let’s get to work!

-Ray Robertson
ray@automatedworkflows.com

 

 

Introducing Ray Robertson

Ben and Jen Waldie

Ben and Jen Waldie - Point Reyes National Seashore, CA

Dear Clients, Colleagues, and Friends:

It’s our pleasure to introduce Ray Robertson as the new owner of Automated Workflows. Ben has accepted a position with Apple Inc., and we are relocating to sunny Cupertino, CA this August.

You may know Ray from Scripting Matters and Scripting Events, LLC, where he has provided professional AppleScript consulting services and the wildly popular AppleScript Pro in-depth training sessions. Ray is an extremely talented Mac developer and industry expert, and we have complete confidence in his ability to continue providing top-notch productivity services and workflow solutions long into the future. He’s an outstanding guy, and we can’t think of anyone we’d trust more with our business.

Thank you to all those in the Mac community who have supported us these past 11 years, purchased our products, hired us as consultants, read our articles and books, attended our presentations, and so on. We appreciate your confidence and support. Stay productive and best of luck with your workflows! Now, please lend us a hand in welcoming Ray!

Sincerely,

-Ben and Jen Waldie

----------------------------------------------------
Ben Waldie
applescriptguru@mac.com
https://twitter.com/applescriptguru
https://linkedin.com/in/applescriptguru

Jen Waldie
jenwaldie@mac.com
----------------------------------------------------

Macworld Article > Power tools: Make events on your Mac trigger iOS notifications

automator-icon_580-100036496-large

Let’s say you’ve got a really cool Automator workflow that saves you tons of time but takes a while to run. Do you really have to sit around, twiddling your thumbs while waiting for it to finish? Wouldn’t it be nicer if you could go get a latte instead and get an alert on your iPhone when the workflow is finished? That’s just one example of the kind of thing possible with the latest version of If This Then That (IFTTT). [Read more on Macworld.com...]

Client Success Story – Valspar’s Image and Color Swatch Automation

valspar_logo

Automated Workflows worked closely with Valspar to develop and deliver a suite of custom software utilities that help designers quickly and accurately organize and visualize colors for the web and print.  As a result, Valspar’s designers are now able to keep up with growing partner demand, while continuing to devote time and attention to creativity and color. [Learn how Valspar uses automation...]

Send Keynote 6.2 Presenter Notes to Evernote with AppleScript

A while back, I wrote an article for TUAW that demonstrated how to send presenter notes from a Keynote presentation to Evernote. This week, Apple released Keynote 6.2, and it contains some updated terminology. Here's an updated version of the script, which works with Keynote 6.2.

NOTE: You can download an example presentation containing presenter notes here.  You can download the completed AppleScript here.

MacVoices Interview > Road to Macworld – Ben Waldie Will Automate The Web

2014-03_MacVoices

Chuck Joiner's Road to Macworld series continues with AppleScript guru Ben Waldie, who will deliver a session that you will want to attend if you’re interested in getting more out of your Internet activities. In Automating The Web, Ben will discuss making your workflow faster and more efficient by integrating your online workflow with your Mac and other web-enabled devices and services. He gives us preview, and also updates us on the state of AppleScript in iWork and beyond.

[Listen in iTunes]

[Listen or Download Online]

Macworld Show Discount Until March 14th

mwiw-logo-header_2014

I'll be speaking at Macworld again this year. If you're thinking of going and haven't registered yet, you can save $100 on your registration via this link until March 14.  I hope to see you there!

January 28, 1986 – 28 Years

"The crew of the space shuttle Challenger honored us by the manner in which they lived their lives. We will never forget them, nor the last time we saw them, this morning, as they prepared for their journey and waved goodbye and 'slipped the surly bonds of earth' to touch the face of God." - Ronald Reagan

Challenger_flight_51-l_crew