Blog This Shortcut for iOS or macOS

Blog This shortcut button image I’ve been working for the past few days on constructing a Shortcut to use for quickly sending a link and block of text to whatever blogging software I’m using on whichever device I’m on at the moment. As of today, I’ve hit a point where it does everything I wanted it to when I started playing, so I’m designating this an official “version one” release (for posterity’s sake, I suppose I can refer to the prior two versions as the alpha and beta releases).

The Shortcut is now cross-platform, with many thanks to Jason Snell for giving me exactly the final pieces I needed.

Selecting some text on a webpage and then using the Share Sheet on iOS or the Services menu on macOS will grab the webpage link and the selected text, convert it to Markdown format, convert any relative URLs in the selected text to absolute URLs, and then place the final text into a new Ulysses sheet on iOS or MarsEdit post on macOS, all ready for any final edits before publishing to your blog.

If this shortcut might be of use to you, either as-is or with some modifications for your particular needs, download, tweak if necessary, use, and (hopefully) enjoy!

Blog This service menu item on macOS MarsEdit window with shortcut output text

Figured out how to create an iOS shortcut that grabs a webpage URL, title, and any selected text from Safari, formats it into a Markdown link and block quote, and then sends it to Ulysses as a new post to be published to my blog. Pretty happy with the result!

Repairing my Music library after Apple Music Library Sync destroyed the metadata

Today I finally finished repairing my Music (iTunes) library after it got mangled when I signed up for Apple Music (the service) a few months ago.

Apple Music has its benefits, but apparently signing up automatically activated the library sync feature, which started overwriting my local metadata with data from the cloud. I caught it before it got all the way through and figured out how to turn it off, but a large chunk of my music library lost a lot of the edits I’d made over the years. From song titles to artist names to custom artwork, covering tracks that I’d purchased from the iTunes Music Store, purchased from Bandcamp, ripped from my own CDs, or even imported from my vinyl collection. Titles and names were changes, artwork was either replaced or removed…probably somewhere between a third and a half of my 37,416 item, 285 GB music library was affected.

The only reason I was even able to repair it all was that, well, Music (and iTunes before it) has been historically tweaky for long enough that I’ve gotten into the habit of making a manual backup of my music library every so often, separate from the Time Machine backup that’s done automatically, just because I don’t trust Music not to screw something up at some point.

I also discovered that Music reads metadata from two places: the metadata embedded in the individual files, and in the “Music Library” file stored within the /user/Music/ folder. Much of the bad data that was being displayed in Music was actually being read from the “Music Library” file; apparently that was where the data from the cloud had been written. When I opened the info window on a track to fix it, Music would then read the embedded metadata from the actual track file, and the data (some of it, at least) would switch back to the correct information.

Of course, manually going through and loading every one of my 37,416 tracks wasn’t at all realistic — but the Refresh a track from its file’s metadata script from Doug’s Applescrpts allowed me to select a chunk (I was able to do as many as 600 tracks at at time without it timing out) and let the script repair the metadata in the background. There were still some final corrections that needed to be made (this trick didn’t fix the artwork that got lost or replaced, and many of the “Album Artist” fields still needed to be corrected manually), but those were easier to do once the script handled the bulk of the work.

So, a few months after signing up for Apple Music, I finally have my local library back to a useable state.

Hey, Apple? Local data should NEVER be replaced by cloud data without warning, without explanation, and without active affirmative confirmation by the user. That was years of work I could have lost, and months of work repairing it. Get this bit of your system fixed, please. This sucked.

Also, trying to write a post about my music, the application Music, the service Apple Music, and Apple the company, and make it all coherent, is not an easy thing to do. I get that iTunes was a bloated beast and needed to be split up — though, really, Music isn’t that much better, is still missing a lot of features (like a usable in-app search feature) — but did it have to be renamed so generically?

DVD/Blu-Ray conversion with text soft subtitles on macOS (2021 Update)

Saved here for my own reference, and possibly others’ if they should stumble across it: the easiest workflow I’ve found yet for converting DVDs or Blu-Rays for personal use on macOS, including conversion of subtitles from either Closed Captions, VobSub (DVD), or PGS (Blu-Ray) format to text-based .srt files suitable for use as soft subtitles, either as a sidecar file or included in the final movie file. (Updated from my original 2015 post to account for software and process changes).

Rip the System Disk

DVD Subtitle Workflow 1

Use MakeMKV to rip the DVD or BluRay disc to .mkv files.

Since I’m archiving special features as well as the main program, I simply rip every title on the disk longer than 30 seconds, and then trash any that I don’t need (such as menus, studio promos, etc.). I do check to make sure that all English-language audio or subtitle tracks are selected; usually they are by default, but I’ve seen rare situations where they need to be manually checked.

Once all the .mkv files have been created, I go through and rename each one to be something more descriptive than title_t03.mkv.

Extract the Subtitles

DVD Subtitle Workflow 2

For each .mkv file, use Subler to extract the subtitles. This takes two passes through Subler to complete.

  1. First, drag the .mkv file onto Subler, and deselect everything but the subtitle track(s) that you want to convert.

    Subler Import

    Subler’s “Info” column will describe the subtitles as either VobSub, PGS, or Text. I used to convert them all so that I could choose which gave me the best results; now, I’ll ignore VobSub/PGS if Text is available (but it’s less common).

    VobSub or PGS: These are the most common subtitle types. They’re actually a series of image files (.png, I think) with attached timing information that media players layer over the video stream. The advantage is that font, color, size, placement, and even fancier graphics (sometimes used for “pop up trivia” style tracks) are all at the creator’s discretion; the disadvantage is that because they’re image files, the text has to be extracted through an OCR (optical character recognition) process that frequently leads to typos and garbage characters.

    Text: These are Closed Caption files. I’m not sure how they’re stored on the physical disks, but current versions of MakeMKV convert them to text during the process of ripping to .mkv. I’ve generally found these to have far fewer typos and oddities than OCR’d VobSub or PGS subtitles. However, it’s often a toss-up as to whether the captions are presented using standard captalization or in ALL CAPITALS, and they use varying numbers of space characters to manually place text centered or off-centered. Depending on how picky you are about the output, these factors can affect how much post-processing is needed.

    After choosing the subtitle tracks and clicking “Add” to create a new Subler document, you can either save the Subler document (fine if you’re only doing a single file) or use File > Send to Queue to create a batch queue (best if you’re converting multiple files). When the file is saved or the queue is run and all queued files are saved, Subler will either extract the Closed Caption text or OCR the subtitle images and output a small .mp4 file.

  2. Second run; drag the new .mp4 file back onto Subler, click on the subtitle track(s), and choose File > Export… to save the .srt file(s). The tiny .mp4 file can then be deleted.

    Subler Export

Correct the Subtitles

DVD Subtitle Workflow 3

As noted above, the exported .srt file(s) are virtually guaranteed to have some oddities; how many and how intrusive they are depends on the source. Caption files are often in ALL CAPS and have weird spacing used to force the text to a desired on-screen position. Subtitle files will contain OCR errors, but BluRay (PGS) subs seem to come out better than DVD (VobSub) subs (likely due to the higher resolution of the format giving better quality text for the OCR process to scan). Accuracy is also affected by the chosen font and whether or not italics were used.

For correction, I use a couple methods.

  1. For a quick-and-dirty “good enough most of the time” run, I use BBEdit (but just about any other text editor would work) to do a quick spellcheck, identifying common errors and using search-and-replace to fix them in batches.

    I’ve actually set up a few scripts to automate the most common search-and-replace steps to help with this process.

  2. For a real quality fix–or if I have the time to create subtitles from scratch for a file that doesn’t have any–I use Subtitle Edit Pro to go through line-by-line, comparing the text to the original audio, adding italics when appropriate, and so on. (I used to recommend Aegisub, but that project appears to have been abandoned a few years back. There doesn’t seem to be a big market for subtitle editing on macOS; Subtitle Edit Pro is the best option I’ve found since Aegisub stopped working consistently.)

Of course, these two processes can be combined, done at different times, or skipped entirely; if I don’t have time or energy to do the error correction, I can always go back and use Subler to extract the .srt files for cleanup later.

Embed the Subtitles

DVD Subtitle Workflow 4

Use HandBrake to re-encode and convert the .mkv file (which at this point will be fairly large, straight off the source media) to a smaller .m4v file. Include the subtitle file by choosing Tracks > Add External Subtitles Track… in HandBrake’s Subtitles tab.

Handbrake Subtitles

Or, if you’re already working with an .m4v file, you can use Subler to add .srt files to into the .m4v: Drag the .m4v file from HandBrake on to Subler, drag the .srt file(s) into the window that opens, and then save the file.

Finito!

And that’s it. Now, you should have a .m4v file with embedded text-based soft subtitles.

TWOK Subtitles Example

You can also just store the .srt file(s) in the same directory and with the same name as the .m4v file for apps that don’t read embedded .srt files but will read sidecar files.

The two top things I want from Apple’s Music (formerly iTunes) app:

  1. Functional search. The drastic decrease in functionality in the iTunes to Music transition is incredibly frustrating.

  2. Either a ‘tag’ field, or for the ‘Genre’ field to be tags, rather than single-value.

🎶

On This Day: Dec 31

Since I hit 20 years of blogging this November, this year I’m posting a daily list of anything I published on this day in the past.

There are 31 posts previously published on December 31st

  • 2024
    • 2024 Reading Round-Up Every year, I set myself a goal of reading at least 52 books over the course of the year; this year I read 76. Here's a quick (?) overview…
  • 2023
    • Year 50 Day 243 Happy New Year, everyone. I even dressed up for the occasion.
    • 2023 Reading Round-Up 📚 Every year, I set myself a goal of reading at least 52 books over the course of the year; this year I read 74. Here’s a quick (?) overview…
  • 2022
  • 2021
  • 2020
  • 2019
    • 📚 sixty-two of 2019: Enterprise, by Vonda N. McIntyre. ⭐️⭐️⭐️ An earlier look at Kirk’s first mission after talking command of the Enterprise. Very different characterizations of the crew—and the Klingons—than what we now know…but then, it was 1986. 🖖
    • No Comparison: Remembering “Star Trek: The Motion Picture” on its 40th Anniversary: “For those of us who get it, Star Trek: The Motion Picture is a spectacular swing for the fences. And for those of you who don’t get it, it’s your frakkin’ loss.” 🖖
    • Cyberdyne Systems | Speculative Identities: A deep dive into the Terminator universe’s Cyberdyne Systems from a graphic design/branding/iconography point of view.
    • 2019 Reading Round-Up 📚 A look back at the books I've read this year
    • Ramones Time 2020, 24 hours to go
  • 2018
    • 2018 Reading Round-Up Every year, I set myself a goal of reading at least 52 books over the course of the year — an average of one a week. This year I made it to 60 (plus getting started on what will be my first book of 2019). Here's a quick overview…
    • I’m not closing my account, and will likely keep checking in on occasion to see what my friends post. But I think it’s time for me to stop uploading to Instagram.
  • 2016
    • Good Riddance, 2016 2016 is done. 2017 is here. Let's make it ours.
    • My #2016bestnine – very #Lego-centric! Let’s see…me in my #geek #coexist shirt, me in my little #goth Lego boy costume, my Lego goth couple, my @cardsagainsthumanity Trump bug-out bag (which was funnier pre-election), Lego minifigs, the Lego #StarWars carbon freezing chamber, another shot of my costume, my mother-in-law using a real paper map, and the ... Read more
    • Book sixty of 2016: Ancillary Mercy, by Ann Leckie. ⭐️⭐️⭐️⭐️ (366/366) This also marks the culmination of my silly little selfie-a-day project for the year! I considered trying to come up with something particularly creative or silly for the final photo, but in the end, decided that just another of the usual photos would be ... Read more
  • 2015
    • It got cold last night – depending on which source we check, Eburg is somewhere between 5° and -3° this morning. The hoarfrost on everything is really pretty, though.
  • 2014
    • The Interview Thanks to the world's weirdest advertising campaign, we watched a dumb comedy that we'd otherwise have had no interest in. And in the end? Yes, dumb, but we've definitely seen far worse, and there were some laughs to be had.
    • MLK on “inconvenient” protests I have almost reached the regrettable conclusion that the Negro’s great stumbling block in his stride toward freedom is not the White Citizen’s Counciler or the Ku Klux Klanner, but the white moderate, who is more devoted to 'order' than to justice…
  • 2012
    • End of 2012 Well, a fair amount went on in my life this year...not that you'd know from this blog.
  • 2008
    • Happy New Year! However you are celebrating (or have celebrated) the new year, enjoy it, and here's hoping we all have a good 2009!
  • 2007
    • Wrapping up 2007 A little under eight hours left to go in the year, and as I look back, most of what stands out in my mind is just how incredibly _busy_ this past year has been, for Prairie and for myself. That's not to say it's been a bad year, but we just _never_ seemed to stop moving.
  • 2005
    • Happy New Years Eve Looks like the plan is for Prairie and I to have dinner and rest for a bit, grab showers, and then head downtown to hit the Noc No along with gracesine, rainfromheaven...and whoever else may show up.
  • 2003
    • eWeek best and worst of 2003 Forget about all this selling your soul to the devil crap -- he's so incompetent, he couldn't even get a wish to be 'famous' right, and I ended up with 'infamous' instead. Can I get a refund on this deal?
    • Trouble in Georgetown As I got off the bus and started walking down the street, I heard a little commotion in one of the alleyways to my left. Looking over, I saw a young lady frantically running down the alleyway, coat open, trying to keep her footing in the fresh snow.
  • 2002
    • Exhausted Ugh...this sucks. I was supposed to be at work early today, so I could leave early (all that New Years stuff), so I set my alarm for 8:30am and went to bed.
    • Oh yeah All in all, a very enjoyable trip. Except for the 15 degree below zero weather. Ugh. I am so not moving back to Alaska. Ever.
    • Weblog publishing systems Just a quick test here — the new beta version of NetNewsWire Pro has a weblog editor built in. Not bad, seems to handle things alright, and it is handy having the weblog editor built into the newsreader.

On This Day: Dec 30

Since I hit 20 years of blogging this November, this year I’m posting a daily list of anything I published on this day in the past.

There are 21 posts previously published on December 30th

  • 2024
  • 2023
  • 2022
  • 2020
  • 2019
    • The Rise of Skywalker In the end, as I noted just after seeing it, it is an entertaining film, and an acceptable, though not incredible, end to the Skywalker saga. But it's definitely the weakest of the three new films (with _The Last Jedi_ being the strongest).
  • 2016
    • A bath and a book…not a bad way to spend some time in the afternoon. Trying to see if I can get one more book finished by the end of the year! (365/366)
  • 2013
    • Sounds From the Lost Abbey 11 Back in February, I took up a challenge from one of my friends to create a mix based around songs that I'd have played at the Lost Abbey, during the mid- to late-1990s. Here's the eleventh (and, at this point, last) in the series!
  • 2010
  • 2009
  • 2008
    • Minor Weblog Redesign A new year is (almost) here, and along with that, it was time for a bit of a refresh to the design. It's not a huge change -- generally speaking, all the bits are in the same basic places -- just a little fine-tuned and tweaked.
  • 2007
    • The Ratings Game #1 Every so often, I'll post the MPAA rating and rationalization. _Your_ goal is to try to guess the film, based solely on the MPAA's rating and their description of its faults. I'll post the answer either after someone guesses it correctly, or later on if it has remained a mystery.
  • 2006
    • We’re Back! We're loopy as all get-outs, due to a delayed connecting flight pushing our arrival back in Seattle from 5:00am to 6:30am and sending both of us _far_ into the realms of sleep deprivation, plus having to battle the head cold that I picked up midway through the week...but we're back.
  • 2005
    • Tag Intersections A little bit more work on improving the tags.app implementation here: tag intersection searches from the search results page.
    • This is a test… ...this is only a test. Even better, it's a test that worked -- there's now a tag search field available.
  • 2004
    • Gallimaufry 2 Same as before, ten songs that iTunes chooses at random. Not quite as interesting a selection as I got last week. Maybe we'll do better next time…
  • 2003
    • Sky Captain and the World of Tomorrow Oh. My. God. Have you seen the trailer for Sky Captain and the World of Tomorrow yet? If not, run, do not walk, do not pass Go, do not collect $200, over and watch it now.
  • 2002
    • Neighbors That's what you get when you do a 'related' Google search to find which sites Google considers to be similar to mine. Definitely makes me wish I knew the criteria.
    • Nightclubbing, we’re nightclubbing… So this guy wants to go into a nightclub, but the bouncer says, 'Sorry, bud, you need a tie for this place.' He goes back to his car and rummages around, but there's no necktie to be found.
  • 2000