yoink

Yoink for Mac Usage Tip #8

The following explains how to add attachments directly from Mail.app into Yoink.
For more Usage Tips like this, click here.

Today, I received an eMail from Sandro G. asking me if there was a way to quickly add mail attachments from selected mails in Mail.app to Yoink.

The Problem

Sandro frequently adds attachments from mail messages in Mail.app to Yoink but says it can be cumbersome with lots of mails with a couple of attachments each.
I agree, having to select each mail message with an attachment, scrolling down and dragging each attachment to Yoink can take a lot of time.
Instead, he says, he’d like a way to just select the mail messages that contain the attachments, ideally press a keyboard shortcut and let Yoink do the rest, saving nerves and, most importantly of all, time.

The Solution

As with the “capture screenshots to Yoink”-problem, where Bogdan V. wanted to be able to take screenshots that automatically end up in Yoink, Automator seemed like a good solution for this.

I launched Automator and created a System Service – easily accomplished by creating a new project and selecting Service in the resulting dialog.
A system service is something you can either access through a contextual menu or by the applications Application menu -> Services, containing context-aware services, for example “Look up in Dictionary” or “New Email with Selection”.

Automator - New Project DialogAutomator’s New Project Dialog. Select Service and click on Choose.

The Automator Workflow

Automator - Finished workflowThe finished workflow.

Let’s go through it from the top. Specify the service to receive no input (as the other possible values don’t apply) and select Mail as the target application the Service should be available in.
Now we need three actions:

  1. Get Selected Mail Messages – creates a reference to the currently selected mails in Mail.app
  2. Get Attachments from Mail Messages – uses the references created before and saves their attachments to a folder, in this case the Default Mail downloads folder
  3. Open Finder Items – Action 2 passes the attachment files to this action, where we ask Yoink to open those files, resulting in them being added to Yoink’s files

Installation and Keyboard Shortcut

Once you save it, it should be automatically saved into your Services folder. If not, double-click the saved file and it should prompt you with this dialog – click Install and it should be installed correctly:
Automator - Service Installation
If you’d like a keyboard shortcut, it’s quickly done. Launch System Preferences, select Keyboard -> Shortcuts -> Services, scroll to find the service and set up your shortcut:
Service - Keyboard Shortcut
Now you can access the service either through this keyboard shortcut or the Services menu in Mail.app’s Mail menu:
Service Installed in Mail

Automator Workflow Download

For your convenience, here’s the workflow ready for download.
Unzip, double-click to install. Set up the optional keyboard shortcut – done 🙂
If you have any feedback, questions or improvements, please be sure to get in touch – by mail or twitter – I’m looking forward to hearing from you!
Read more

With yet another month behind us (time flies recently, doesn’t it?), it’s time for another entry in my “What I…” series of blog posts. This time, somehow dental care made its way into it.

… Worked On

Website Update (click)
I felt the need to update my website again. On the landing page, you used to have to scroll to see all the applications available. I didn’t particularly like that. Also, the buttons just didn’t look good. Have a look:

eternalstorms.at before updateeternalstorms.at before its recent update

With the recent update, I moved everything around, chose a nicer, easier to read font (Helvetica Neue Ultra Light probably wasn’t the best choice) and removed the buttons:

eternalstorms.at after recent updateeternalstorms.at after the recent update

You can see how much space I saved solely by scaling the Eternal Storms Software logo and moving it off to the side (which makes it less obvious, sure, but a lot nicer to look at). What’s always important to me on a website is a way to contact the people in charge. I cannot say how much I hate (and I use that word with all its meaning) websites where I have to dig through to get some contact information. So at the top left, you have a button to contact me by mail or twitter and visit my Facebook group. At the right hand side, you can reach my blog, the press page and About/Legal information.
I also hate contact forms. Why hide your mail? From spammers? They’ll get to you anyway. Just give me your email and I can write you from within the comfort zone of my preferred email client. Nothing better than that.

A click onto an app icon or the app’s description will take you to the app’s page, of course:

Yoink's website after the updateYoink’s website after the update

I don’t want to overwhelm browsers with too much information up front. A page filled with text can easily scare people away.
So what you see at first is the icon, a short tagline and a Download and Purchase button. Below that, I thought it’d be a nice idea to feature some customer and press reviews to let potential buyers see what people who have used the app thought about it.
Below that, you’ll be greeted by a short screencast and the app’s full description and functionality. If you decide to skip the screencast, there’s a quick GIF of Yoink in action to give you the gist of it.

It took me a couple of days to settle on the colors of the buttons. I started with green and blue, then tried a light shade of purple and blue:

Screenshot of iWeb 25 08 2015 22 44 30
Screenshot of iWeb 25 08 2015 22 37 34

It’s nice, but taking the #ESSPurple background into account, neither the green, grey-ish purple or blue worked that well.
The buttons are much more identifiable as such than the previously used chalk-outline ones (see first screenshot).

For Yoink, I also started a new Quick Tips website, showcasing some lesser-known features.

Yoink Quick Tips Website (click)
It’s kind of a FAQ section. I often got eMails asking how to easily select all files inside Yoink or how to copy files out of Yoink instead of moving them.
Yoink’s Quick Tips website displays simple tricks like copying and selection, but more complex ones, too, like using Automator in conjunction with Yoink or adding files to Yoink from the Terminal/Shell.

Yoink 3.1 (to be released on September 3rd 2015)
I’ve been working on an update for Yoink which, most importantly, is now localized into additional great languages, like Japanese, Simplified Chinese and Korean (you can find the complete list in the release notes or on Yoink’s website).
Some localizations were “donations” by awesome users of Yoink (Korean, Portuguese (Portugal) and Italian), the others were done by professional localizers via iCanLocalize and BRlingo, which I can both highly recommend.
Besides being localized into new languages, the update provides a cleaner, less cluttered interface, many improvements and bugfixes.

Transloader 2.2.2 (iOS) (click)
Transloader for iOS received a bugfix update, fixing some minor stuff in its Today Widget and Action Extension and URL schemes. The Mac app hasn’t received an update yet.

Reach ZEN – Update (click)
I worked on an update for my cousin’s iPhone and iPad game Reach ZEN, fixing a couple of bugs and interface issues. Most importantly, In-App Purchases are working now 😛
In the game, you turn a cube with random numbers on it, selecting sides that add up to ten in under ten seconds. It’s thrilling and peaceful at the same time – go check it out 🙂

… Didn’t Work On

Swift Language
At some point, I’d like to get into Swift programming. But I don’t see the point in re-writing my apps to use Swift – it doesn’t really provide any use to users, other than knowing that something was built with the “new shiny”.
Hearing stories about how code stops working after an update to the Swift language doesn’t help things, either. When I write something, I want to be sure it works with the next release of the language it was written in.
That is not to say I’m not going to develop apps using Swift – but for now, I’m waiting for a release where I know that from that point on, things don’t change fundamentally and code keeps working over releases.

… Did

My girlfriend and I went to the dentist. For me, it was the first time in 15 years, easy (I know, I’m an idiot). But it went far better than I thought, considering the time span.
Three cavities (one has already been taken care of with two kind of drills and a filling) and one wisdom tooth that’s coming out the wrong way and needs to be surgically removed at some point (that X-Ray was quite shocking, to be honest).
Still, I’ve never had such a pleasant dentist visit. She was very comforting, careful and explaining what she did all the way through. The next appointment is in two weeks where the next tooth is getting fixed (by drilling, I hope).

… Downloaded

Angry Birds 2 icon, RovioAngry Birds 2 (click)
A worthy successor to the game that started it all. It’s entertaining and fun and pretty much sticks to what made the first game great.
I’m not very far into it due to lack of time, but it is a nice way to relax a little.

Pac-Man 256 IconPac-Man 256 (click)
I didn’t play much of it yet, but it’s Pac-Man – what can go wrong? 😛
I did get to the “Glitch” stage and died pretty soon afterwards and haven’t played it since – to be honest, I’d rather play Crossy Roads.

… Read

Swift – The Genius of Protocols (click)
This article provides a nice look into Protocols in Swift.
I’m not using Swift for anything yet and have only put my pinky toes into the vast sea that is this new programming language, but I do enjoy reading about what it has to offer.

Intro To GCD (Grand Central Dispatch) (click)
I’m familiar with how GCD works and I make extensive use of it, but it never hurts to read up on something you think you know. This is a multi-part series about GCD and if you’re a Mac / iOS developer, I suggest you check it out.

The increasingly long lives of old Macs (click)
Something I’m very thankful for, working on a retina MacBook Pro from 2012 and a 20’’ Apple Cinema Display from ca. 2004.
And OS X El Capitan will give it at least one more year of usage – including the new Metal framework (Macs starting from 2012 are supported, so my rMBP barely made it).

How Runic Games was Reborn After Torchlight: The Story Behind Hob (click)
The story behind a new game from Runic Games and how it deviates from previous games they made while having to deal with key people leaving the company.

… Listened To

Liftoff Podcast (click)
“Liftoff is a fortnightly podcast about space, the universe, and everything.”
I’m kind of into Astronomy, it’s a “hobby” of mine, if you can call it a hobby.
The podcast just started, they’re at episode 2 (episode 3 if you count the intro episode) and it’s been very interesting.

… Watched

Why CG Sucks (Except It Doesn’t) (click)
A short video about why we think CG in movies sucks, but it really doesn’t.

… Ate

Tomato PizzaSelf-Made Tomato Pizza with Garlic

… Went to See

My girlfriend and I were at quite a few places this month 😉

Schallaburg, Viking ExhibitionViking Exhibition at Schallaburg

Setagayapark in Doebling, ViennaSetagayapark in Vienna, Döbling.
Between Doebling, a district of Vienna and Setagaya in Tokio, there has been a year-long friendship and cultural agreement.
Out of that, this park was created. Planned by Ken Nkajima.

Haus des Meeres (House of the Sea)Haus des Meeres / House of the Sea, Vienna.

Aninite Convention SchwecahtAniNite Convention, Schwechat
Way more people (and cosplayers) than last year.

Read more

It was a bug I’ve been carrying along for quite some time in Yoink. But I finally found the culprit: I’m looking at you, OS X sandbox.

Webarchive opened after bug occurredA webarchive created with Safari, after a security-scoped NSURL bookmark was created for it.

The Bug and its Detection

As it happens (sadly), not I discovered the bug, but a customer and user of my app Yoink encountered it. The reason being, I rarely handle .webarchive files (if at all) – webarchive files are created when saving a website in Safari, for example – but one of Yoink’s users, Christoph, appears to have to deal with them regularly.

The bug itself is described fairly easily. You have a .webarchive file you’d like to move using Yoink. So you drag it onto the app and then move it from Yoink to the actual destination. Business as usual.
Only that now, instead of opening the webarchive in your standard browser when double-clicked, above’s warning is shown.

There’s two baffling things about this warning:

  1. It looks like you’re trying to launch an application instead of just a file (“from an unidentified developer”)
  2. The creator of the file seems to have changed. Instead of Safari, it now says “BugReport-WebArchivesAndNSURLBookmarks” (the app I submitted to Apple to demonstrate this issue)

Highly concerning, to say the least. To some people, it might even look like something fishy is going on.

Hunting Down the Bug

Seeing as .webarchive files are binary property lists (thank you, Michael Tsai (@mjtsai on twitter) for the correction), I tried other property list files (for example, .plist files), but none exhibited the same behavior.

Reproducing it was fairly easy. There’s one pre-requisite for it to appear: that in System Preferences -> Security & Privacy -> Allow apps downloaded from, either ‘Mac App Store’ or ‘Mac App Store and identified developers’ be selected.
Otherwise, Gatekeeper isn’t active and doesn’t react to the issue.

System Preferences - Security and Privacy Settings

At first I thought it happened when moving the file out of Yoink, since that’s where Yoink actually does something to a file – it moves it from one location to another – who knows what goes on behind the scenes there.

Going through the move-code line by line, commenting out stuff I thought could cause this, made no difference what so ever. Create a new webarchive, move it using Yoink, and get the warning again. Rinse and repeat.
With stuff like this, I get annoyed easily, so my patience usually goes out the window after a couple of alterations to the code.

It was only after the billionth time that I considered it might happen when a file was added to Yoink, not moved from Yoink.

Going through the same process as before, I went through the code line by line, trying different things.

With a recent update to Yoink, the app knows when a file is renamed or deleted in Finder, using GCD (Grand Central Dispatch) and its dispatch sources.
I believed the issue lay there, but after commenting out all of that code as well, it became clear it wasn’t the culprit.

In a fit of anger and a severe feeling of incompetence, I randomly picked at the code (I know, highly professional. But I’m using version control – all is well, right?).

To my surprise, when I removed the code responsible for saving Yoinks files over relaunches of the app, the issue went away.

Security-Scoped NSURL Bookmarks

For a sandbox’ed app to keep a reference to a file added by the user beyond relaunches, it has to use what is called a security-scoped NSURL bookmark.

Sandbox entitlements necessary for security-scoped bookmarks

They can be used if the corresponding entitlement (see above) is added to the app’s sandbox entitlements file.

There are two ways a security-scoped bookmark can be created – either with read and write access, or read-access only (NSURLBookmarkCreationWithSecurityScope or it plus NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess).

I don’t know why this causes the issue, but changing the bookmark creation options from read and write access to read-access only fixed the issue (and moving the file is still possible with Yoink). It definitely looks like a sandbox bug to me.

Why should an app-internal bookmark (mind you, it’s only a reference to a file, not the file itself, created from an NSURL object) write to and change the webarchive’s file so that it a) can’t be opened anymore and b) shows the bookmark-creating-app as its creator?

Bug Reporting to Apple

I reported this bug to Apple (rdar://21765077) with an example project you can download here, if you’d like to see for yourself. Feel free to dupe the bug with Apple’s Bug Reporter Tool – I’d appreciate it 🙂

Now all that’s left to say is thank you for your patience, Christoph. You reported this issue at the beginning of March 2015 and had to wait until now for it to be fixed (and still a little longer because I have to submit the update to Apple for release on the Mac App Store as well). I really appreciate your continued feedback on the app!

Correction

Thanks to Michael Tsai for pointing out on his blog that .webarchive files aren’t bundles, as I falsely stated, but binary property lists.

Read more