Welcome to the lab.

nvALT 2.2.8, because I got High (Sierra)

[Tweet : nvALT]

So any and all users who’ve upgraded to the High Sierra preview has had issues with the nvALT. I know this because of the number of emails and tweets and various other means of complaining that are absolutely not the GitHub Issues page I try so hard to point people to for such communication. Also, because I’m running High Sierra, too.

I had almost given up on a fix. Notational Velocity’s code uses low-level file APIs, and it looked like there was no way I was going to get them all updated and working with the APFS filesystem in High Sierra. Turned out it was just an incorrect volume capabilities check (credit to Jacob Bandes-Storch). A couple of other fixes (credit to Vivek Gani) and it’s running fine.

If you’re already on High Sierra, you’ll have to download directly (below), and for everyone else you should see the automatic update and I highly recommend using it.

Here’s to nvALT’s survival until BitWriter gets back on track!

Brett (and David, who is in no way responsible for the contents of this post.)

nvALT v2.2.8 (128)

A fork of Notational Velocity with MultiMarkdown preview and advanced Markdown editing capabilities. Other good stuff.

Updated Tue Sep 19 2017.

DonateMore info…

P.S. I accidentally found this “positive” remix of the song referenced in the title. Funny.

Web Excursions for September 18, 2017

[Tweet : nvALT]

Web excursions brought to you by MightyDeals.com, featuring great deals on software, training, and design resources.

Paste for Mac 25% off
If you don’t have a clipboard manager yet, Paste is great. Unlimited clipboard history, pinboard views with previews, and a lot more. 25% off right now.
Sublime Text 3
So Sublime 3 is finally official. I’ve been using it in beta for long enough that this isn’t a huge deal, but despite Atom having a larger developer community, I’ve stuck with Sublime primarily because it’s stable, it has every package I need, and it’s not an Electron app.
A really nice version of Monokai for Sublime Text 3. I found a link in the description to ColorSchemeUnit which looks like a great unit testing tool for those publishing Sublime themes.
0k/shyaml: YAML for command line
Probably because of my Jekyll usage and Ruby in general, I’ve taken to creating most configuration files in YAML instead of JSON. Parsing it from a bash script has always been a pain, though…
This will only be of interest to VW and Audi owners who happen to enjoy saving a ton of money by getting their hands dirty. But seriously, with cheap replacement parts and detailed tutorial videos, I’ve already saved over $1000 over taking my aging TT to a mechanic. (And that’s not even including the money that Harold Kachelmyer helped me save on a clutch replacement…)
FLAC to MP3 Mac - Convert FLAC to MP3 Format on Mac OS
A macOS app for speedy conversion of FLAC to MP3 and other audio formats.

Add favicons to Safari tabs with Faviconographer

[Tweet : nvALT]

Last month John Gruber mentioned a widespread complaint about Safari’s lack of favicons in tabs. I agree. So did Daniel Alm (developer of Timing), so he put together a helper app to do it.

Released today, Faviconographer is a “hack,” of course, but one that does a great job of serving the single purpose of adding those icons to your tabs. It’s not as clean as Chrome’s built in solution, but if the lack of favicons is one of few things keeping you from using Safari, it’s a good solution.

The app runs in the background and uses the macOS Accessibility API. It sends no data about your browsing (it doesn’t even save it to disk). It just waits for tabs to load, grabs the favicon, and applies it to the tab in the tab bar. There are a few limitations, but it works.

Faviconographer is free. You can read a bit more about the backstory and motivation, as well as grab the download at faviconographer.com.

It’s the last day of the Learn Ulysses sale

[Tweet : nvALT]

I just wanted to mention that today is the last day of the Learn Ulysses intro sale. Starting tomorrow the price will go up to $29, but you can still get the intro price of $23 for a few more hours.

On the launch day for the video course the Systematic episode with Shawn Blanc wasn’t published yet, but it is now. There’s a good discussion of Ulysses, this video course, and a good talk about Ulysses’ change to a subscription model.

If you’re a Ulysses user, or someone who wants be, this series is a polished and highly useful resource from some trusted content creators. Go take advantage of the intro price while it lasts!

Don’t forget Ulysses is available on Setapp!

Sideshow (Sidecar 3.0) for Simplify

[Tweet : nvALT]

You may or may not recall my Sidecar jacket for Simplify, the macOS controller for Spotify and iTunes (and others). Sidecar is my “Minimalist Yet Huge” version, and I still use it every day.

I just released a new version. It’s now called Sideshow, mostly because I ran into trouble making the existing version update in Simplify. So this is technically Sidecar 3.0. It adds one major change: adaptive sizing. Previously I’d needed to have a version for a 13” display and another for a 15” retina display, but I figured out how to have adapt itself based on the current screen size (I think, let me know if you find otherwise). The width of the player, font sizes, etc. will all adjust to provide a fairly uniform experience across display sizes and types.

It also measures and updates the length of the text for the artist and title displays, adapting the placements to show as much of possible of both.

When hovering over the jacket, controls appear for previous track, play/pause, and next track. You can still Command-click anywhere along the progress meter to set the play position. Clicking anywhere on the jacket will still toggle play/pause, and shift-click skips to the next track (because double click stopped working).

Check it out on the project page, or just download below.

Sideshow v3.0

An adaptive full-screen jacket for Simplify 3.0+.

Updated Tue Aug 29 2017.

DonateMore info…

The Learn Ulysses video course

[Tweet : nvALT]

If you like Ulysses, the powerful writing app for Mac and iOS, or even if you’re trying to figure out why you should like it, there’s good news today. Shawn Blanc and The Sweet Setup have released a new video series called Learn Ulysses.

It’s a series of 7 video tutorials to walk through all of Ulysses’ features (both Mac and iOS), as well as tips and tricks, hidden gems, and interviews with users who are making the most of the writing app.

I would be remiss not to acknowledge the recent uproar over Ulysses’ switch to a subscription-only model. I got a chance to talk to Shawn about his thoughts on the change, and that interview will be up on Systematic on Thursday. For the record, Shawn isn’t affiliated with the Soulmen (makers of Ulysses), and this video series was in editing phase by the time the switch was officially made. Just in case you were wondering.

The course is $29 US, but the intro price is $23. If you’re looking to ramp up your Ulysses skills, go check it out.

Tagging files from the macOS command line

[Tweet : nvALT]

Let’s address the headline first. This post is about the tags on files that Apple started supporting in Mavericks. Up until iOS 11, they didn’t work on iOS devices, so they eventually became “Finder tags.” I think “Apple Tags” is going to have to be the nomenclature moving forward (now that they’re starting to work on iOS as well), but I don’t think it’s a widely accepted phrase yet. So I’ll use “Finder tags” for a little while longer.

I have a handful of scripts for manipulating tags from the command line, including the most complete (and useful to me) one, vitag. There’s an excellent CLI from James Berry called “tag” that I use frequently, but I sometimes implement more “down and dirty” techniques in scripts.1 If you’re just looking for a ready-to-go tool, grab tag and skip the rest of this.

Last weekend I wrote a script to handle cleaning up my system’s tags, merging synonymous tags, fixing spacing and punctuation, making casing and pluralization consistent, and various other nitpicks that have gotten messy in my taxonomy over time. It used the same basic Ruby classes that I used in vitag, which you can reference on GitHub for a more full-fledged version of these tips. I’m not ready to publish this last script yet, but I thought I’d point out a few simple tricks for those working on their own solutions.

Reading tags on a file

Tags are stored in extended attributes on the files, in a metadata attribute with the key kMDItemUserTags.

Not ideal:

Trying to view them using the xattr tool almost always results in a hex dump, and converting it results in a binary plist, and converting that gives you messy results.

$ xattr -px com.apple.metadata:_kMDItemUserTags "2015-04-01-intrepid-command-line-directory-traversal.md" | perl -wane 'print chr hex for @F'| plutil -p -
  0 => "bash
  1 => "terminal
  2 => "unix

More ideal:

I’ve found it better to just get the raw output from mdls:

$ mdls -raw -name kMDItemUserTags "2015-04-01-intrepid-command-line-directory-traversal.md"

I can parse that response, split lines, remove commas, etc., and turn it into an array of tags I can work with.

Writing tags to a file

Tags are written to files using xattr. They need to be passed to xattr in Plist format (XML) with an array of string elements containing the tags.

When you write tags to the file using xattr, it will obliterate any existing tags, so note that if you want to add tags instead of replacing them, you need to read the tags into an array as shown above, modify and update the array, then write the whole thing back to the file.

The command for doing this is:

xattr -w com.apple.metadata:_kMDItemUserTags '[plist data]' [file]

The xml string you need looks like this (line breaks for display, easiest to pass as one long string:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

So the command for writing “tag1” and “tag2” to /file/path would be:

xattr -w com.apple.metadata:_kMDItemUserTags '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><string>tag1</string><string>tag2</string></array></plist>' /file/path

Here’s a Ruby snippet showing the building of the XML string and shelling out to write it to the file:

# File to operate on
path = "~/Dropbox/nvALT2.2/ruby shellwords module.md"

# Test array of tag strings
tags_xml = [':snippet:ruby', 'shell']

# begin valid PLIST XML string
plist = %Q{<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">}
# array of tag names to array of xml string

tags_xml.map! {|tag|

# Join the array strings and append to the plist
plist += %Q{<plist version="1.0"><array>#{tags_xml.join()}</array></plist>}

# Shell out and run xattr to write the plist to the file's attributes
%x{xattr -w com.apple.metadata:_kMDItemUserTags '#{plist}' '#{File.expand_path(path)}'}

Color labels

The colors associated with tags like “Blue” and “Orange” (default label names) are stored in a different attribute (com.apple.FinderInfo). This dates back a ways, and there’s really no point in directly writing to this attribute anymore. It’s easiest just to change the tags. Remove “Blue” and add “Orange.”

Writing a color to a file, e.g.:

xattr -wx com.apple.FinderInfo "0000000000000000000900000000000000000000000000000000000000000000" filename

…will simply apply the Blue tag to the file automatically. So just apply the Blue tag and skip the hex strings.

In closing

I’ll stop there because I know this isn’t all of widespread interest. If you are looking into scripting any of this directly, I do recommend checking out the vitag code and James Berry’s tag project.

  1. Often just for the sake of not having any external dependencies…

Web Excursions for August 21, 2017

[Tweet : nvALT]

Web excursions brought to you by CleanMyMac 3, all the tools to speed up your Mac, in one app.

Sketch for Designrs
Not a huge repository, yet, but another resource site to add to your Sketch bookmarks collection.
I love Sketch plugins to the extent that a plugin manager is a necessity. Sketch Toolbox hasn’t been updated for a while, and this new one is pretty sweet.
Ok, so there’s not been any shortage of email clients in recent years, nor am I interested in replacing MailMate or Spark. I do try everything out, though, and this one looks great. Currently just in advance signup mode, but if you’re curious, get your name on the list.
I’m not switching away from Pinboard, but I am impressed with this as a bookmarking/read later tool. Imports from Pocket, Readability, and Instapaper so you can try it out easily.
I really like the way Spotify analyzes my playlist data. Just the facts, but with some interesting notes. I am apparently high energy, with 79% of my played tracks categorizing as “energetic,” and zero “chill” tracks in my playlists. And I’m only drinking one cup of coffee in the morning these days…

CleanMyMac 2