IFTTT Pro


For years now, many of us have had a standing “Yeah, but” for IFTTT. It’s an excellent service that reliably connects things on the Internet for simple automation. BUT, it has never embraced the complexity that you start looking for about 10 minutes after you first try the service. I’ve lamented the lack of conditional logic and triggers for multiple events so many times. I’ve stated on the blog and podcasts numerous times that if only they give me more complex tools, I’d gladly pay for the service. This week IFTTT called my bluff.

IFTTT Pro has now launched with all the features I’ve been pining for:

  • Multi-step Applets

  • Queries and conditional logic

  • Multiple actions

  • Faster Applet execution

If you buy in during the next four weeks, you can even set your own price. I’m now an official IFTTT Pro subscriber, and I’ve got time blocked to play with these new tools. Expect more on this to come, but if you are interested, I recommend subscribing in the next month to get it at a price that makes sense to you.

Significant Pushcut Updates


Puschcut Images

Automators take note. Pushcut has received several updates over the past few months, improving the ability to trigger automation on iOS in creative ways. The original idea behind the app was to give folks the ability to trigger iOS automation beyond those limits Apple provides with Siri Shortcuts. With Pushcut, you can use things like webhooks and iBeacon devices as automation triggers. This is pretty impressive. We interviewed Pushcut’s developer, Simon Leeb, on the Automators a few months ago.

Since that time, Pushcut has got even more interesting with the ability to set up an iOS device as a server, and most recently, integration with IFTTT. This could allow you to trigger a shortcut from Alexa or set a HomeKit scene from Google home.

I love how third-party developers keep pushing the iOS automation envelope by giving Shortcuts even more external tools. I’ll be updating the Shortcuts Field Guide with some video examples of Pushcut, but in the meantime, I encourage you to check it out.

AppleScript to Link to Apple Mail Message

I’ve always like the way OmniFocus can create links to Apple Mail messages when saving an email as a task. With help from listener Jacob (@evansio), I’ve now got a script that can do that anywhere via a text expander snippet. Here’s the AppleScript:

(*
  Returns a link to the first selected Apple Mail message
*)
tell application "Mail"
  set _msgs to selected messages of message viewer 0
  if (_msgs is not equal to missing value) then
    set _msg to first item of _msgs
    set _msgID to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & (message id of _msg)
    return "message://%3C" & (_msgID) & "%3E"
  end if
end tell

Here is that script embedded in a TextExpander Snippet. I’m using the abbreviation “elink”


Screen Shot 2019-02-05 at 7.19.58 AM.png

That’s it. Once you’ve installed it, just type “elink” in any app that can take a URL and you create a link to the currently selected email message. I use it all the time in Notes and Calendar note fields but it really works anywhere. Here’s a short explanatory video.

Masters of Automation on Upgrade Podcast


Last week I attended the first ever CMD-D: Masters of Automation conference in San Jose. At the end of the day, Jason Snell did a live on-stage podcast with all the speakers, including yours truly. 

The show went live this week in the Upgrade feed. I though it came out great and there is a lot of good information about where we stand with automation technologies with both Mac and iOS. The CMD-D portion starts about 30 minutes into the podcast but I recommend listening to the whole thing.

The CMD-D Mac Automation Conference


When we had Sal Saghoian on the Mac Power Users a few months ago, I observed that one of the best things about him leaving Apple is that he gets to share more with us automation-loving nerds. It looks like Sal is pretty serious about that because he is putting on a conference with Paul Kent (the former conference organizer for Macworld Expo). CMD-D is a one day conference in August in Santa Clara all about Mac and iOS automation.

If you’re thinking about attending, I’d recommend it. I took a two-day AppleScript course from Sal several years ago and can attest that he’s not only very knowledgeable on the subject of automation, he’s also a great teacher. Learn more at the CMD-D website.

Automating PDF Creation from Image Files on the Mac


Recently a client sent me a contract electronically by taking a series of photos of a document. This happens to me once in a while, and usually I open the individual images in Preview, combine them, and save them as PDF. I received another such series of photos this morning and finally decided to automate this process so I don’t have to do it manually anymore. Automator to the rescue.

Why I Love Automator Services

Automator has the ability to create Services. These are little programs that reside in the contextual menu on your Mac. Right-clicking on a file gives you an option to employ Services. The nice thing about Services is that they stay out of the way until you need them, and then they are there, just a right-click away. (All screenshots in this post will get bigger on your screen if you click them.)



So I decided to make my little automation routine for combining PDF files a Service. This happens after you open the Automator App and click New in the File menu. 



In order to get to the Services menu, you’ve already selected a file. This means the Services don’t need the typical file-selection nonsense. To run the Service, you’ll first select the images you want to combine and convert to PDF. Clever, right?

Because the Service we are creating is made specifically to turn images into PDFs, we don’t want our Macs to try and use it against other types of files such as text files or music files. Therefore, we will limit the Service so that it only works when it receives image files.

Now Let’s Get Automating 

If you’ve never used Automator before, don’t sweat it. It’s easy. Automator has a series of tools on the left side that you drag into your workflow on the right side. You stack those together like LEGO bricks and at the end you’ve created a program. This Automator workflow has just two bricks. The first thing we’ll need to do is take the existing images and convert them into a single PDF.



Fortunately, Automator has a tool specifically for this job named, not surprisingly, “New PDF From Images”. Go in the Search bar for Automator and type “new PDF”, and the search gets you there. 



Drag the tool into the workflow area and we’re halfway there.



The Quartz Filter

We could really stop with just the one step and convert the images to PDF, but there is still a problem. Photos converted to PDF still make lousy documents. They have lots of color and are hard to read. 

MacOS has quartz filters built in that can change the way a PDF looks. There’s also an Automator tool to apply a quartz filter right in your workflow. So go ahead and search for “quartz”.



Drag the “Apply Quartz Filter to PDF Documents” tool into the workflow. When you do that, however, you’ll get the following dialog.



This dialogue is Automator being extra careful that you don’t override something you want to keep. For this workflow, I clicked “Don’t Add”.

After that, you’ll see the workflow with both steps.



You’ll note in the above screenshot that the quartz filter isn’t doing anything yet. Time to change that. Click on the arrow next to the filter and select “Black & White”. This converts the color image to a black-and-white image and makes the document much easier to read and edit.



That’s it. Save the script, select some images, right-click on them, and try it out from your Services menu.



“Super Important”

There’s a small tidbit at the end of John Gruber’s post about the new Mac Pros.

data-animation-override>
I asked about scripting and automation — whether Apple still sees scripting and automation as an important part of the pro market. Federighi: “We think scriptability and automation of the system remain super important.”

I’d agree. Power users and large company deployments all rely on scripting to get their work done faster. Craig Federighi’s affirmation about scriptability and automation here is re-assuring but, at the same time, Apple is sending some mixed messages:

  • Apple laid off Sal Soghoian, the biggest advocate of automation and scriptibility. Sal not only got users excited about these tools, he was also fighting the fight inside Apple to make sure automation and scriptibility got updates with the operating system and inside Apple’s own software.
  • Apple not only laid off Sal, they eliminated his position. As Sal explains, “Recently, I was informed that my position as Product Manager of Automation Technologies was eliminated for business reasons.”
  • Apple has been very slow about pushing automation forward on iOS. The current URL-scheme automation methods exist because of clever developers, not Apple. While extensions are a start, there needs to be more.
  • On the plus side, Apple purchased Workflow, a leading automation app for iOS. Some are worried that this acquisition spells doom for the future of Workflow. I think they are going to fold it into the operating system making it (possibly?) even better.

I agree with Craig Federighi that automation and scripting is “super important” but I’d also remind him that if that is the case, we need more than words right now. WWDC is just a few months away and it sure would be nice to see that Apple is moving the ball forward for automation and scripting.

Automating Invoice Processing on My Mac

When I first opened my solo law practice, one of the unanswered questions in my mind was how I would go about billing clients. This is supposed to be hard. Some law firms spends days every month on getting bills out the door. Others pay outside vendors. I decided to nerd the s%*t out of this problem and do it myself.

I use an online practice management solution, Clio, to track my time. At the end of the month, the service creates PDFs of my invoices that go into my Mac’s Downloads folder. Rather than show an actual client invoice, I’ll use this dummy invoice for my side landscaping business.


One of the tricks of this workflow is that when I push a button in Clio, the PDF is created and opens automatically on my Mac in the Preview application. The first tool to help me automate the process is Hazel. I’ve talked a lot about Hazel at this site and on the podcast over the years. One of Hazel’s many talents, is the ability to identify, name, and move files. So I’ve got Hazel constantly looking at my Downloads folder. If it sees a PDF file that has the text “Lawn Care Products and Livestock”, “PO number”, and “Gunther’s Gardening”, it will start acting on that file. My logic is that there will be no PDFs in my Downloads folder that have all of those words in that order that are not an invoice. Here’s the Hazel Rule.


Once Hazel finds a match, usually within seconds of the file downloading, Hazel renames the file with the current date, client name, and a further description of the invoice. Because the PDFs open on my desktop at the time of the download, it’s fun to watch the name change as I’m reading the invoice over. Next Hazel moves the invoice to a folder I’ve designated in the client’s Admin/Invoices folder.

So within seconds of downloading the invoice, my Mac has named and moved the invoice to its appropriate folder.


Next I click on the sharing button in the Preview App (which is diplaying the invoice). From there I click on the Mail icon and this creates a new blank email with the invoice already attached.

My next big tool is TextExpander. I manually type in the client’s name as an email recipient. Then I tab down to the s ubject line and fire off a TextExander snippet. The snippet phrase is “newbill”. The snippet first fills in the subject line with the terms “Sparks Law %B Invoice” which TextExpander fills in as “Sparks Law October Invoice”. Next month the snippet will automatically change “October” to “November”. (TextExpander recognizes the wildcard %B as the current month.)


Next, the snippet asks me to fill in the client name and let’s me choose from several frequent options. Three common issues in these cover emails are questions about whether the client wants to pay online via credit card, wants a snail mail copy of the invoice, and if there is someone else at the company that needs to get the invoice. I use TextExpander Optional Selection phrases for this. I can check or uncheck the appropriate phrases for the particular invoice.

Finally,  I have a multi-line field at the bottom where I can write or dictate in a further description of services or plans for the coming month.

Here is the finalized email from the above snippet screen.


Here is a screenshot of the snippet form TextExpander.


Here is the full text of the snippet if you want to adapt it for use use it in your copy of TextExpander at home.

Sparks Law %B Invoice
%key:tab%Hi %filltext:name=field 1%,

Attached is this month’s invoice. %fillpart:name=online pay:default=yes%I also sent you a separate email with online payment instructions if you’d prefer to pay that way via credit card.%fillpartend% %fillpart:name=optional part 3:default=yes%Also, please let me know if you’d like hard copies of these invoices in the mail.%fillpartend% %fillpart:name=someone else:default=yes%Finally, if you’d like me to direct these to someone else at the company, let me know.%fillpartend%

%fillarea:name=Message:default=Thank you for your business.%

Kind regards,

David Sparks
Sparks Law
SparksEsq.com

So this detailed explanation probably sounds like a lot but in action, the whole process is wicked fast. It takes just moments for me to approve and download a PDF invoice, at which point my Mac names and files the invoice, and I send it off to the client with a customized email. I love being a nerd.

As an aside, I have had very few clients take me up on the offer to get snail mail invoices. Almost everyone wants things in just PDF form. I have brilliant clients.

Service Sunday – Text to iTunes Audio

One of my very favorite web services is Instapaper. It allows you to clip any webpage for later reading. The trouble is, Instapaper makes it so easy to mark articles for later reading that I tend to mark many more articles than I can possibly find time to read. In effort to keep up with the deluge, I decided to start converting some of the articles to audio tracks.

Before digging in, let’s talk about what this service will do. You can highlight any selection of text, including an Instapaper article, and right click into a service that will grab the text, convert it to an audio file, rename it, and dump it into an iTunes playlist. This is remarkably easy. You just need Snow Leopard 10.6, a little patience, and about 15 minutes. So load up Automator and let’s get started.

The Automator Script

If you’ve never used Automator before, you’re going to love it. Automator lets you program your Mac without knowing how to program.

When you first load up Automator, you will be prompted to choose your workflow. For this project, choose to make a Service. This lets you to activate it contextually (right clicky). So click on Service and move along.

This service will accept text from any application. I normally use it in Safari, but it will work with Pages documents, long e-mails, RSS readers, and any other place that you have lots of text.

So Automator is kind of like programming tinker toys. You get one piece and connect it to the next. The first piece, called “Text to Audio,” converts accepts text and spits out an AIFF file. The easiest way to find it is typing “text to audio” in the search window.

Drag the action over and your screen should look like this.

This first step is the most important. It grabs text and converts it into an audio file. I save the audio file to the desktop with a temporary name “T2A”. The workflow will trash the file later.

Next, the workflow renames it with the “Rename Finder Items” action. By enabling the “Show this action when the workflow runs” option, you can type in a name when the service runs.

Next, the service imports the file to iTunes with the “Import Audio Files” action. Ticking the box, “Delete source files after encoding” cleans up your desktop for you.

Finally, the service adds the audio file to an existing playlist. I created one called, “Fascinating Text.” Here is the whole workflow.

For bonus points, set up a Smart playlist in iTunes that grabs all unplayed files from the Fascinating Text playlist and sync it to your iPhone/iPad/iPod and you are set. Wherever you go, great listening materials are a click away.

In Action

Just highlight some text and activate the service. I usually do it from the Readability view in Safari. For long articles, this can take several minutes.

Then give it a name.

Then Automator does the rest. If its a large file, this also can take awhile. Open iTunes and play.

The articles I most often convert to audio are non-techy long form pieces. So often, reading Mac and Legal stuff results in new OmniFocus tasks for me so I prefer to put in text like New Yorker or New Republic articles. Literature would work but the voice isn’t natural enough. I tried “To Kill a Mockingbird,” but listening to Alex recite Atticus Finch made me want to push an icepick in my ear.