I have a script that I'm using for computer renaming...but one part of it where it looks at whether the model name is MacBook (and then assigning ML) or not (assigning MD) - the results are saying everything is not a MacBook (assigning MD).
#!/bin/bash
ModelType=$(system_profiler SPHardwareDataType | grep 'Model Name:' | awk '{ print $3 }')
if [ "$ModelType" = "MacBook" ]; then
TT=ML
else
TT=MD
fi
As a side note, further down in the script, it pops up a prompt for user input via osascript - which is all working fine, but if the user isn't fast enough typing in it goes to the next prompt .... can someone advise how to have it wait for the input before skipping to the next portion?
BB=$(/usr/bin/osascript -e 'tell application "System Events" to set BRAND to text returned of (display dialog "Please input the brand - AF , AI, AU" default answer "" with icon 2)')