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