-
Notifications
You must be signed in to change notification settings - Fork 6
/
outlook-mac.sh
executable file
·51 lines (37 loc) · 1.42 KB
/
outlook-mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
download_signature() {
echo "downloading signature..."
echo "enter url:"
exec 3<>/dev/tty
read -u 3 SIGNATURE_URL
if [[ -z "$SIGNATURE_URL" ]]; then
echo "missing url"
exit 1
fi
SIGNATURE_HTML=`curl -s "$SIGNATURE_URL"`
if [[ -z "$SIGNATURE_HTML" ]]; then
echo "empty signature url response"
exit 1
fi
echo "done."
}
setup_signature() {
echo "setting up signature..."
SIGNATURE_HTML_ESCAPED=`echo "$SIGNATURE_HTML" | sed -e 's/"/\\\"/g'`
osascript <<END
tell application id "com.microsoft.Outlook"
make new signature with properties {name:"signature", content:"$SIGNATURE_HTML_ESCAPED"}
end tell
END
if [ -f "$HOME/Library/Preferences/com.microsoft.Outlook.plist" ]; then
defaults write "$HOME/Library/Preferences/com.microsoft.Outlook.plist" "AutomaticallyDownloadExternalContent" -int 2
defaults write "$HOME/Library/Preferences/com.microsoft.Outlook.plist" "Send Pictures With Document" -int 0
fi
if [ -f "$HOME/Library/Containers/com.microsoft.Outlook/Data/Library/Preferences/com.microsoft.Outlook.plist" ]; then
defaults write "$HOME/Library/Containers/com.microsoft.Outlook/Data/Library/Preferences/com.microsoft.Outlook.plist" "AutomaticallyDownloadExternalContent" -int 2
defaults write "$HOME/Library/Containers/com.microsoft.Outlook/Data/Library/Preferences/com.microsoft.Outlook.plist" "Send Pictures With Document" -int 0
fi
echo "done."
}
download_signature
setup_signature