tinyapps.org / blog


What keeps me on macOS #

despite apple's waning attention and nominal concern:

Footnotes:

  1. The Windows version is much clunkier. Reportedly, 2016 is the final desktop version for Mac. Still available at a discount from Intuit via this curiously-obscure page.
  2. Yes, it's available for other platforms as well, but without Sublime Text I'd be sorely tempted to jump ship.
  3. Other platforms also enjoy plenty of virtualization options, none of which run OS X / macOS guests easily and/or legally.

/mac | May 09, 2018

Resizing videos in OS X / macOS #

For years, I used Stomp for resizing videos under OS X. However, in addition to recently being retired, it has had trouble processing a number of formats of late, either hanging altogether or displaying lengthy time estimates (e.g., ~6 hours to scale a 6 minute video by half).

Happily, ffmpeg makes quick work of scaling video while preserving the aspect ratio, e.g.,

$ ffmpeg -i in.mp4 -vf scale=640:-2 out.mp4

/mac | Apr 28, 2018

Only old calendars appearing in iTunes #

This post is for the scattered few who still sync calendars between their Mac and iOS device via USB, and find deleted calendars appearing in iTunes, despite those calendars not appearing in iCal / Calendar. Backup before proceeding. The iOS calendar(s) will be overwritten.

  1. Disregarding the absence of desired calendars or presence of undesired calendars within iTunes, select Sync Calendars > All calendars, check "Replace information on this iPhone" next to Calendars, sync, then quit iTunes.
  2. Open iCal/Calendar on the Mac and delete any unwanted calendars that appeared after syncing (yes, despite having selected to overwrite the iOS device, old, deleted calendars may reappear).
  3. Even if you've never used it, open Reminders.app on the Mac and delete any old, unwanted calendars.
  4. Open iTunes and head back to Info > Sync Calendars - only current calendars should appear.

Similar reports:

Related:

/mac | Apr 08, 2018

Archiving Calendar.app events as plain text #

After 14 years of calendar events (>17,000, but still well within the recommended limit of 50,000), Calendar.app finally started acting up; a month-long period refused to sync via iTunes from an iPhone to a Mac, despite desultory remedial efforts1.

Time to archive and cleanup:

  1. Backup calendar(s) to both ICS and ICBU formats; print to PDF for good measure

  2. Recover recalcitrant events from iPhone using iExplorer

  3. Install icalBuddy2 version 1.8.10 via Homebrew3:
    brew install ical-buddy

  4. Export all events from 2003 through 2017 using a for loop4:
    $ for i in {2003..2017}; do icalBuddy --separateByDate --noCalendarNames eventsFrom:$i-01-01 to:$i-12-31 > $i.txt; done

  5. Combine all 2003–2017 txt files into one:
    awk 'FNR==1{print ""}1' *.txt > events.txt

  6. Check for duplicates:
    uniq -d events.txt
    and remove:
    uniq events.txt > events_deduped.txt

  7. Remove auto-generated URLs for events created via iMessage or Mail:
    sed '/^ url:/d' events_deduped.txt > events_urls_removed.txt

  8. Delete 2003–2017 events from Calendar via Automator5: Find Calendar Events > Date ending > is before > 1/1/2018 > Delete Calendar Events

Footnotes:

1 namely (and mainly from How To Reset Calendar, iTunes USB Sync):

2 Display iCal events on the command line or as Rich Text

3 to avoid a bug in the officially-hosted version (1.8.8) under OS X 10.10+.

4 Exporting all events from 2003 through 2017 like so: $ icalBuddy --separateByDate --noCalendarNames eventsFrom:'jan 1, 2003' to:'december 31, 2017' completed without error, but stopped in 2006, hence the for loop.

5 Calendar, Automator, and AppleScript were so recalcitrant under macOS Sierra that an OS X Mountain Lion virtual machine had to be employed for the cleanup process. More on deleting old events:

Failed attempts:

/mac | Apr 01, 2018

Very slow copying LibreOffice.app from dmg to /Applications #

Copying LibreOffice.app's 771.4MB (13,307 files) from LibreOffice_6.0.2_MacOS_x86-64.dmg (235.9MB) into /Applications took over three minutes* on a MacBook Pro with a SSD and 16GB of RAM via Finder (rsync and cp were similarly sluggish).

By way of comparison, Android Studio.app's 846.9MB (10,720 files) copied from android-studio-ide-162.3871768-mac.dmg (445.8MB) via Finder in just fifteen seconds.

However, after zipping LibreOffice.app via OS X's built-in Compress command, it could be unzipped in less than twenty seconds via the default handler (Archive Utility). Why is copying from the dmg file so much slower? Perhaps The Document Foundation could offer a zip file rather than (or in addition to) the sluggardly dmg.

* (On first launch, there was another thirty second delay while "Verifying 'LibreOffice.app'..."; clear the quarantine attribute beforehand to avoid: xattr -d com.apple.quarantine /Applications/LibreOffice.app)

Related:

Update:

/mac | Mar 05, 2018

Archiving JavaScript-laden webpages #

Saving webpage assets wrapped in heavy JavaScript (e.g., lightboxes and slideshows) for offline access can be irksome.

Recently, a particularly recalcitrant website refused to fall to the usual suspects (Wget, SiteSucker, Offline Pages Pro, Chrome, Firefox, Safari, various extensions and add-ons, etc.), but incredibly came to heel under the venerable iCab's web archiving feature - thank you Alexander Clauss!

/mac | Feb 18, 2018

Quickly verify file checksums in OS X & macOS #

with Joss Brown's Checksums. Supports a wide array of algorithms, from built-ins like MD5 and SHA-256 to Tiger and Bencode via optional installs. Requires OS X 10.8 or higher.
  1. Download and mount latest DMG
  2. Copy Checksums.workflow to ~/Library/Services/
  3. If desired, automatic update checks can be disabled by opening Checksums.workflow in Automator and removing the updater function and function call from the bash script.
  4. Rather than using the Context menu to launch Checksums (Control-click > Services > Checksums), set a keyboard shortcut: System Preferences > Keyboard > Shortcuts > Services > File & Folders > Checksums > none > add shortcut > Control-Command-C (or any other desired and available key combination)
  5. To compare a checksum with a file, copy the checksum to the clipboard, select the file, and press your keyboard shortcut:
    Checksums

/mac | Feb 18, 2018

Add a macOS recovery partition without reinstalling macOS #

If you search the web for how to restore a missing recovery partition, chances are you'll come across advice like:
"Generally the best and simplest method is to reinstall OS X entirely. This is a neat way of triggering for a second time the process whereby the recovery partition is created. It's quite a drastic and time-consuming approach, however."
-- How to create a Mac recovery partition in OS X El Capitan and Yosemite
and:
"The only way to solve this problem is to download the latest installer from App Store and re-install OS X"
-- How to re-create a missing recovery partition in OS X Yosemite (updated to OS X El Capitan)

However, thanks to davidjb's recovery.sh (detailed in his blog post Creating a macOS Recovery Partition without reinstalling OSX or re-running your installer), it is possible to add a recovery partition without reinstalling macOS.

Boot the Mac from an external drive or into Target Disk Mode*, then run:

TARGET="/Volumes/Macintosh HD"                                # Specify where to configure Recovery partition
MACOS_INSTALLER="/Applications/Install macOS Sierra.app"      # Path to your macOS installer

# Remaining paths ahead are dependent on OS version
# This *should* support 10.9 and above but is only tested on 10.12

curl http://support.apple.com/downloads/DL1464/en_US/RecoveryHDUpdate.dmg -L -o ~/Downloads/RecoveryHDUpdate.dmg

hdiutil mount -nobrowse ~/Downloads/RecoveryHDUpdate.dmg

pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /tmp/recoveryupdate

hdiutil mount -nobrowse "$MACOS_INSTALLER/Contents/SharedSupport/InstallESD.dmg"

/tmp/recoveryupdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition "$TARGET" "/Volumes/OS X Install ESD/BaseSystem.dmg" 0 0 "/Volumes/OS X Install ESD/BaseSystem.chunklist"

hdiutil eject "/Volumes/Mac OS X Lion Recovery HD Update"

hdiutil eject "/Volumes/OS X Install ESD"

Notes:

/mac | Feb 14, 2018

macOS: Export Contacts to CSV #

While Contacts.app does not include an explicit CSV export option, one can be easily effected by:
  1. highlighting desired contacts,
  2. dragging them into a new Numbers spreadsheet, and
  3. exporting the spreadsheet to CSV

/mac | Oct 16, 2017

Taking screenshots in macOS Recovery Mode or within a bootable installer #

  1. Boot into Recovery Mode (Cmd+R) or via a USB bootable install disk
  2. Utilities > Terminal
  3. If you have access to the existing macOS install, you can use the copy of screencapture located at /Volumes/Macintosh\ HD/usr/sbin/screencapture for the following. Otherwise, copy /usr/sbin/screencapture from another macOS install to a USB flash drive (e.g., SANDISK) and run from there.
  4. Open desired application(s) from the Terminal, e.g.,
  5. Open another tab in Terminal and run /Volumes/SANDISK/screencapture /Volumes/SANDISK/screenshot.png

References:

/mac | Oct 01, 2017


Subscribe or visit the archives