This Week's Sponsor:

Notify

Monitor Websites & RSS Feeds. Private. Simple. No Servers Required.


Posts tagged with "automation"

Check Dev Center Status From iOS with Pythonista

A great idea by reader Nicolas Hoibian, which uses BeautifulSoup to fetch the source code of Apple’s System Status page, parse it, and print it with custom fonts and colors in Pythonista’s console.

Here’s my modified version that uses Pythonista’s notification module to re-run the script every 6 hours by firing a local iOS notification on your iPhone or iPad (it assumes the script is named “DevCenter” in Pythonista).

Permalink

Resolve Short URLs with Pythonista on iOS

Clean URLs

Clean URLs

I don’t like it when third-party apps or services force me to share links to articles or webpages using their own custom shortened links. I understand the appeal of personalized short domains – after all, we tweet mcstr.net links with the @macstoriesnet account – as they can provide analytics to track clicks, can save characters, and, at least in theory, they “look cool”. However, I’ve been long considering the idea of dropping our mcstr.net links, but I think the issue is worse (and more annoying) for apps and services that don’t tweet links to their own content (like we do) but that override others’ links with different domains. An example is Pocket, which gives you the clean, original URL when you choose the “Copy Link” action from the sharing menu, but that instead returns pocket.co links when sending text to Drafts (which I do often). I’ve grown tired of this practice (in Pocket and other services), and I’ve put together a workflow based on a Python script that allows me to easily resolve short links without having to open the browser and tap on multiple menus. Read more


Editorial for iPad

Ole Zorn is finally talking about his upcoming new app, Editorial, publicly on his website:

I tweeted earlier today that I’ve registered the name for a new app in iTunes Connect. It’s called Editorial, and I’ve actually been working on this for over a year now.

At its core, it’s a Markdown editor for iPad, but you can also think of it as a Pythonista spinoff, or a workflow automation tool, not unlike Automator.

I say “finally” because I have been testing Editorial since November 2012. All my reviews have been written and edited with Editorial; I have built workflows that, for me, make working with text on the iPad better than using Sublime Text 2 on my MacBook Air. When I’m on my Mac, I miss Editorial’s automation and editing features. And if I haven’t posted a screenshot of my iPad’s Home screen in a while, it’s because I had Editorial in my dock and I couldn’t share it.

Ole Zorn is the developer of Pythonista, which I have written extensively about. I can’t wait to share more about Editorial.

Permalink

IFTTT for iPhone: A Different Kind of iOS Automation

IFTTT for iPhone

IFTTT for iPhone

I used to heavily rely on IFTTT for my daily automation workflows that involved appending bits of text to files in my Dropbox, forwarding tweets to my OmniFocus inbox, generating PDFs, or archiving Instagram photos to my Dropbox account. IFTTT, acronym of If This Then That, is a web service that lets you connect other web services together to create automated workflows that run every time a piece of data is triggered: by leveraging a variety of APIs from compatible channels (such as Facebook, Dropbox, Evernote, Feedly, and more), IFTTT lets you automate the web in powerful (and sometimes unexpected) ways. Browsing Popular recipes on the IFTTT website can give you an idea of the scope of web automation that’s made possible by the service, and we’ve covered IFTTT in the past on MacStories as well.[1]

However, I stopped depending on IFTTT because, once I got more comfortable with my own Mac mini server as a remote automation assistant, I wanted to control the pipes of my personal data. I’m still using IFTTT for things like receiving an email if it’s going to rain tomorrow or a new SMS for press releases published by Apple (just an example of the power of IFTTT channels and recipes), but it’s not the primary system that I rely upon for automating daily tasks. The new IFTTT app for iPhone, which I have been testing and has been released today on the App Store, may make me (partially) reconsider my decision. Read more


Getting Safari’s Selection on iPad As HTML With A JavaScript Bookmarklet

I modified this bookmarklet posted by “Tim Down” on StackOverflow to send selected text from Safari to Drafts as HTML. The result is the following code:

javascript:(function(){var%20h="",s,g,c,i;if(window.getSelection){s=window.getSelection();if(s.rangeCount){c=document.createElement("div");for(i=0;i<s.rangeCount;++i){c.appendChild(s.getRangeAt(i).cloneContents());}h=c.innerHTML}}else%20if((s=document.selection)&&s.type=="Text"){h=s.createRange().htmlText;}window.location='drafts://x-callback-url/create?text='+(h);})()

So let’s say you want to grab the first paragraph in this post. Normally, in Safari for iPad you’d end up with the plain text fetched by window.getSelection:

This is a fantastic report with lots of data points for any developer trying to get their apps featured by Apple. Dave Addey’s highly interactive regional graphs and notes are very well done. Be sure to check out Dave Addey’s other works on his main blog.

As you can see, formatting and hyperlinks have been removed. With the bookmarklet above, you’ll receive the HTML version of the selection – which looks like this. But what’s the point?

My idea was that I wanted to be able to automate the process of capturing rich text from iOS’ Safari; I wanted to achieve the same kind of functionality I have on the Mac, where rich text can be dragged from Safari or Chrome and dropped into Evernote, preserving styles, hyperlinks, and images. I thought that combining HTML output with an Evernote Append action (with the “Send as Markdown HTML” option turned on) would let me receive valid HTML content in Evernote starting from an iOS workflow. And, for the most part, I was right, because the workflow does mostly work.

As it turns out, Evernote is extremely cautious with the HTML tags they accept, and the ones that are supported follow the XHTML guidelines as ENML is a superset of XHTML. This means that my bookmarklet will work for something as simple as selecting a single paragraph, but may easily fail with multiple selections, inline images, complex styles, and so forth. When that will happen, Drafts will return an error when trying to append HTML to Evernote; obviously, this will work just fine with Dropbox, which doesn’t care about the kind of text you’re using in your actions. Even better, this should work very well with Textastic’s just-released update that supports x-callback-url.

I guess the solution would be to build a Pythonista-based converter for Evernote-approved XHTML tags and place it between Safari and Drafts, converting HTML tags Evernote won’t like to compatible ones. If you’re interested, my birthday is August 10.

Permalink

Enhancing Reminders with AppleScript and Macros

As The Omni Group keeps working on OmniFocus 2 for Mac and Apple continues seeding new betas of iOS 7 and OS X Mavericks to developers, I have been reconsidering Reminders’ simplicity and enjoying the built-in iCloud sync, which, unlike other types of iCloud, is working fine for me. However, two things I miss from OmniFocus are the possibility to integrate the app with a web browser through bookmarklets and the system-wide Quick Entry panel; I use both tools on a daily basis to easily save a browser’s tab into OmniFocus’ Inbox, or to bring up a text field where I can jot down an idea and know that, no matter the app I’m using, it’ll be saved into OmniFocus. Luckily for me, Apple’s Reminders app comes with a good AppleScript Dictionary, which is likely something that Reminders’ core mainstream audience won’t ever care about, but that we can leverage to extend the app’s capabilities and input areas beyond Mountain Lion’s leather-and-paper window.

Read more


Automating Mail Signatures and Senders with AppleScript and Keyboard Maestro

Mail Keyboard Maestro

Mail Keyboard Maestro

I’m aware of the fact that it’s a common trend to call email a “nightmare” these days, but the truth is – email works for me. I have multiple addresses set up, I have my filters and smart folders to automate the process of filing and finding emails, and I’m enjoying the renewed interest of iOS developers in building email apps that solve old problems in new ways. But there is one thing I don’t like: Apple’s Mail app and how many clicks it takes to switch between configured accounts and signatures. As you can guess, I came up with a way to automate the process using AppleScript and (optionally) Keyboard Maestro.

I receive several messages every day to different email addresses, but I always want to reply with the same address and the same signature. Apple’s Mail app makes it easy to see all messages sent to all accounts with the unified Inbox, but it makes it surprisingly hard to set default accounts and signatures that should always be treated as, well, default ones. I don’t want to click on menus for accounts and signatures: I want to hit ⌘R and receive a new Reply window with the account and signature I want already set. Read more



Search For Rdio Lyrics with Keyboard Maestro

Macro

Macro

In spite of the existence of various Mac apps to display lyrics of a song that’s currently playing in iTunes or Rdio, I often find myself having to manually look them up through a web browser. It’s not uncommon to see a dedicated lyrics app being unable to fetch lyrics for a certain song, and, unsurprisingly, that always seems to happen when I’m in the mood for learning new lyrics. Having to Google lyrics and type a song’s name is a tedious process that ought to be automated, so that’s what I did. Read more