Created
February 27, 2020 22:49
-
-
Save soundsnw/ba6e0b1b7c6a495b188a49483f3c53c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
# Check if Preview.app is the default PDF reader | |
loggedInUser=$(scutil <<<"show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }') | |
if [[ ! $(/usr/bin/sudo -u "$loggedInUser" /usr/local/orgutils/swda getUTIs | grep com.adobe.pdf | grep Preview) ]]; then | |
echo "<result>No</result>" | |
else | |
echo "<result>Yes</result>" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment