Need Scripting Assistance, 101:123: execution error: An error of type -610 has occurred. (-610)

mhuang19
New Contributor

Hello! I have been trying to automate signature import into Outlook and have been mostly successful, but have run into a few cases where the following script errors with: 101:123: execution error: An error of type -610 has occurred. (-610)

Anyone have any idea why this is happening? It seems to only happen on select machines. Thanks in advance!

#!/bin/sh

USERNAME=`stat -f%Su /dev/console`

FIRSTNAME=`dscl . -read "/Users/$USERNAME" FirstName | cut -d':' -f2 | xargs`
LASTNAME=`dscl . -read "/Users/$USERNAME" LastName | cut -d':' -f2 | xargs`
JOBTITLE=`dscl . -read "/Users/$USERNAME" JobTitle | cut -d':' -f2 | xargs`
PHONENUM=`dscl . -read "/Users/$USERNAME" PhoneNumber | cut -d':' -f2 | xargs`
EMAIL=`dscl . -read "/Users/$USERNAME" EMailAddress | cut -d':' -f2 | xargs`

HTML="
<font face="Arial" font size="2" color="FF4500"><strong>$FIRSTNAME $LASTNAME</strong></font><br/>
<font face="Arial" font size="2" color=”#46484a”>
$JOBTITLE<br/>
<img src='test.jpg'><br/>
T: $PHONENUM<br/>
</font>
<br/>
<br/>
<p><font face="Arial" font size="1" color=”#46484a”>
Our Privacy Policy can be found here:<br/>
"
osascript <<EOD

--Opens Microsoft Outlook
tell application "Microsoft Outlook"

    --Deletes Current Signature
    delete every signature

end tell

tell application "Microsoft Outlook"
    make new signature with properties {name:"$FIRSTNAME $LASTNAME", content:"$HTML"}
end tell

EOD
2 REPLIES 2

Mauricio
Contributor III

What is the macOS of those selected machines you are having issues with?
In which context are you running this script? Via Jamf policy, local app, self-service?
Jamf runs as root and some permissions will have to be managed.
The screenshot is an example of you script running locally (not root) on macOS 10.14.6

83b9e2ef5caa427698e4bedd8d960ce1

Until a "decision" is made the script just waits....

Mauricio
Contributor III

To add a further example.
Using the script to read my Outlook signature name (all local).
(In /System Preferences/Security & Privacy/Privacy/Automation)

Permission OFF
d291b67f8afd4449a884a4acdfbcec69

Permission ON
2a3852d11dca4a37844cc057244aa5ac