What I… (September 2016)

… Did

Released ScreenFloat 1.5.13 (mac app store, website, blog post)
Just in time for macOS Sierra I was able to release a compatibility update for my picture-in-picture productivity-app ScreenFloat.
As I previously mentioned, macOS Sierra introduces a new sandbox entitlement which prevented ScreenFloat from working correctly, because it prohibited launching an interactive screencapture section using NSTask.
Version 1.5.13 adds that entitlement and fixes a couple of minor bugs along the way, as a good bugfix- and compatibility update should 🙂

Blogged about Re-Implementing macOS’ screencapture CLI (blog post)
When I first learned macOS Sierra broke ScreenFloat, I immediately switched into my worst-case-scenario-mode and started working on my own implementation of macOS’ screencapture utility – at that point, there was no way to be sure Apple would make that sandbox entitlement public and let developers use it.
The in-depth blog post details what I found poking around in macOS’ screencapture command line utility and how I went about implementing my own solution making it look and work almost exactly like Apple’s solution.

Worked on Transloader 3.0 (mac app store, app store, website)
One of my goals for Transloader 3.0 is to support a multi-Mac environment.
In order to do that, I had to transfer the app’s inner workings from iCloud Key-Value Storage to CloudKit.
The reason is pretty straight forward: Up until now, Transloader sent a URL the user entered for download on a Mac to iCloud, associated with a unique key, something like ‘14225b23-fafb-41cd-be35-461acc583084’.
I would prefix that key with the current state of the download, as to be able to show it in the iOS Transloader UI:

  • no prefix – the download has not yet been received on the Mac
  • dwnld – the URL has been received on the Mac and is downloading
  • dlfin – the download has finished on the Mac
  • faild – the download failed on the Mac
  • –del– – the download was deleted on the iOS device and is to be cancelled and deleted on the Mac

Mind you, this was before I had CloudKit and I had to get the most out of what I was handed. And it worked pretty well, if I may say so. But it was already pretty complex. And when it comes to a multi-Mac environment, it’s not very extensible.
Sure, I could add yet another prefix to specify the Mac, but that’s got head-ache written all over it. Plus, if I’d like to extend the system even further, I’d be in trouble.
Having two prefixes, one to specify the Mac, one for the download state, isn’t something you can easily wrap your mind around, and it’s a nightmare to debug (believe me, I had an internal build of this working). Along with other pitfalls, it just wasn’t worth proceeding with this method.
The beauty of iCloud’s Key-Value Storage is that it syncs “transparently”. You use it like NSUserDefaults (where you might store users’ preference settings) and the OS would sync it in the background, whenever it would see fit. If sync failed, the system would try again at a later point. Beautiful.
With CloudKit, you have to take care of all the syncing (and errors) yourself. But you have so much more possibilities when it comes to your data model.
I now have two record types: ‘Mac’ and ‘Download’. A download record references a Mac record, which lets Transloader know which Mac(s) a download belongs to, and the Mac would take according actions (i.e., start the download).
Furthermore, the download record contains the current download state and additional metadata used internally in Transloader. It’s clean and understandable.
However, what had to happen, happened. In a frenzy of keeping everything in sync, I forgot to put the user first.
The beauty of Transloader is that you could add a URL if you had an internet connection or not and it would sync as soon as an internet connection would be available.
In my first version of CloudKit-based Transloader, I made the user wait for a successful sync: You’d add a URL and instead of adding it to your downloads-list right away, the app would wait to hear back from iCloud’s servers to see if it worked.
That might be (it’s not) OK if you always had a good, working internet connection. But what if you didn’t? Then you couldn’t add the URL, because CloudKit would return an error and tell the user to try again later.
That’s unacceptable. So I refactored the system in an important way:
I separated the sync from the data model. That was my error in thinking.
I thought – sync right away and you won’t run into any trouble, you’ll always be in sync.
But the proper way to handle it is this: Know that the data the user enters is always “right” and worry about the sync in the background. That definitely takes the pressure off.
Syncing should happen instantly, of course, but if it doesn’t because of an error, I don’t make the user wait and the user doesn’t lose the URL. Sync is just retried at a later time.
I also had trouble debugging push notifications. Not because of my code, but because Xcode 7 and/or macOS El Capitan couldn’t cope with maintaining code signing in regards to the Apple Push Service over restarts / logouts of the Mac, so push notifications would arrive at the Mac, but they wouldn’t be forwarded to my app. I even had a system of getting it to work again, after hours of experimentation – Reset to “Don’t Code Sign”, clean and build, Set to “Code Sign Automatically”, clean and build. Tada, it worked again (until the next restart or logout).
In macOS Sierra and Xcode 8, this is a thing of the past and everything is working perfectly. I can finally restart whenever I feel like it.

… Downloaded

Instead of doing my usual round-up of multiple apps I’ve downloaded over the month, I decided to do away with that for good and talk about just one app I’ve tried during the month.
I’m starting with the excellent time-tracking Mac app Timing, by Daniel Alm (@daniel_a_a on twitter).

Timing Mac App IconTiming (mac app store, website)
I’m not doing much time tracking. Maybe because I haven’t done much work for other people I could bill my hours to. Maybe because I like working for a flat-rate.
Or maybe it’s because I haven’t found the right tool for the job. To be frank, I haven’t looked around much, but having found Timing, I doubt there’s any need to look much further.
Timing automatically tracks almost anything you do on your Mac.

Timing in Action

Timing in Action, with color-coded activities and hopefully many billable hours. (Screenshot taken from the app’s website)

When you have the app running, it will unobtrusively track the apps (and its windows and documents) you use as well as the time you spend there – something that can come in handy even if you don’t have the need to bill hours to someone, as it gives you insights into what documents and projects you work on the longest (and where you might be able to optimize your time).
Apps (and their windows or documents) can be assigned to projects or activities so you have a nice group of apps that belong together.
If you’re a software developer, I suggest you check out this page, which will list some of the advantages you get out of tracking your time with Timing – something I plan on doing in the future for sure, even if only to see where I can improve my productivity or fix some (extremely rare) procrastination.
A free trial of Timing is available here, and it’s available for purchase on the Mac App Store.

… Read

Austria: The up-and-coming early-stage investment capital of Europe (techcrunch)
“With Germany to the north and the high-tech Netherlands beyond that, few have paid attention to the rapid changes taking place on the other side of the Alps.”

Providing the Best Possible App Store Experience (omni)
“All of these limitations stem from a single underlying problem: they’re all due to the fixed cost of the original download of the app.”

… Listened To

Steve Jobs at NeXT Introduction Press Conference (youtube)

… Watched

The Adventures of Indiana Jones by Patrick Schoenmaker (youtube)
A beautifully animated short film of my favorite archaeologist.

Mohenjo Daro Movie Mp3 Songs Pk Free DownloadMohenjo Daro (imdb)
An entertaining and thrilling story about Mohenjo Daro’s rise and fall.

Beatles eight days a weekThe Beatles: Eight Days A Week – The Touring Years (itunes)
The movie of the year for me. Granted, I’m a huge The Beatles fan, but even if you aren’t, I think this is a more than worthwhile picture.

Lights out movie poster 2016 by johnyisthedevil da5g865Lights Out (itunes)
A good horror flick with a new concept (“lights out”).

… Ate

Köttbullar

Köttbullar. No, not at IKEA. In Stockholm, at “Restaurang Tradition“. Very good food. Very pricey, too.

… Went to See

Me at Drottningholm, Sweden

Drottningholm Palace, Sweden

Stockholm from Stadshuset Tower

Stockholm, as seen from Stadshuset Tower

Eternal Storms Software Logo

– – – Do you enjoy my blog and/or my software? – – –
Stay up-to-date on all things Eternal Storms Software and join my low-frequency newsletter (one mail a month at most).
Thank you 🙂

Comments are closed.