I created an EA to tell me the last time Adobe Acrobat was used. The issue I am facing is that i have gotten a lot of results showing as NULL. From what I can tell this happens if the user has not launched Adobe Acrobat since it has been updated. Any ideas or a better way to report the last time it was used?
#!/bin/bash
# Define the path to Adobe Acrobat
acrobatPath="/Applications/Adobe Acrobat DC/Adobe Acrobat.app" # Adjust path if needed
# Check if Adobe Acrobat is installed
if > -d "$acrobatPath" ]; then
# Get the last used date using mdls
lastUsedDate=$(mdls -name kMDItemLastUsedDate -raw "$acrobatPath")
# Check if a date was returned (meaning it was opened at least once)
if o -n "$lastUsedDate" ]; then
echo "<result>$lastUsedDate</result>"
else
echo "<result>Never Opened</result>" # Or a default date like "2001-01-01"
fi
else
echo "<result>Not Present</result>"
fi