xcrun error after MacOS High Sierra 10.13.2 Update

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have some Hazel rules that execute shell scripts to adjust dates as part of my paperless workflow.
Since updating to High Sierra last week, my Hazel rules began throwing an error.

I've tracked it down and wanted to share the solution. The solution is simply to re-install the required xcode command line tools again.

Do that by opening up a Terminal window and typing the following…

xcode-select --install

Here's the error I logged after the OS upgrade:

Code: Select all
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Here's the shell script that Hazel runs as one of the steps importing scanned documents into Eaglefiler:

Code: Select all
# Take filename, YYYY-MM-DD--New Name.pdf and
# - adjust the creation date using /usr/bin/setfile -d
# - adjust the modification date using /usr/bin/touch
# - rename the file to New Name.pdf using /bin/mv
 
filename_without_path=$(basename "$1")
extension="${filename_without_path##*.}"
filename_without_extension_or_path="${filename_without_path%.*}"

YYYY=$(echo "$filename_without_extension_or_path" | awk -F "-" '{print $1}')
MM=$(echo "$filename_without_extension_or_path" | awk -F "-" '{print $2}')
DD=$(echo "$filename_without_extension_or_path" | awk -F "-" '{print $3}')
NNAME=$(echo "$filename_without_extension_or_path" | awk -F "--" '{print $4}')

# Change creation date
/usr/bin/setfile -d "$MM/$DD/$YYYY" "$1"
# Change modification date to Today/Now
# /usr/bin/touch "$1"
# Rename file
# /bin/mv "$1" "$NNAME"


I should also mention for anyone who uses Hazel as part of a scanning paperless workflow, that my 2011 MacBook Pro also had an issue in Preview of PDFs after the upgrade. Alternate pages in PDFs scanned through Fujistu Scansnap and OCR'ed by ABBYY FineReader were displaying as totally BLACK filled pages. This was solved by resetting the display color calibration in System Preferences --> Displays --> Color --> Calibrate.

I have no idea why but some say the PDFKit Apple uses in Preview was changed and it affected other third party programs that render PDFs using PDFKit. I also have Adobe Acrobat Pro installed, and it did NOT exhibit the error that Preview did when viewing files that were processed by Scansnap and ABBYY FineReader.

Hope this helps!

-Dave Bartholomew
DaveB
 
Posts: 25
Joined: Sat Apr 02, 2016 7:56 pm

Thanks for the heads up. From what I understand, Apple did a rewrite of PDFKit (I believe it was based on a version from iOS originally). It's been a problematic transition with tons of bugs and lost features. It will probably be a while before things are back to what they were pre-rewrite.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support