Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Add contact birthdays to calendars.scpt
Created September 11, 2011 20:16
Add Outlook for Mac contact birthdays to calendar
tell application "Microsoft Outlook"
set contactList to every contact
set theYear to text returned of (display dialog "Enter the calendar year for new birthday reminders." default answer year of (current date) with title "Which year?" with icon 1)
if theYear as integer ≤ 1904 or theYear as integer ≥ 2039 then
display dialog "You must specify a year between 1904 and 2039." with icon stop with title "Error!" buttons {"Cancel"}
end if
repeat with aContact in contactList
@talkingmoose
talkingmoose / pvt.talkingmoose.LaunchTextEdit.plist
Last active May 17, 2023 22:41
Example: How to launch a GUI application using launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>pvt.talkingmoose.LaunchTextEdit</string>
<key>ProgramArguments</key>
<array>
@talkingmoose
talkingmoose / deleteOutlookMessages.scpt
Created November 6, 2011 16:21
Permanently delete Outlook for Mac messages
tell application "Microsoft Outlook"
set theMessages to the selection
permanently delete theMessages
end tell
@talkingmoose
talkingmoose / dittoPayloadToUsers.sh
Created February 20, 2012 15:52
Shell script to ditto Apple package payload to user home folders and user template
#!/bin/sh
## postflight
copyPayloadToAllUsers() {
# Enter a path to a logfile.
LOGFILE="/path/to/file.log"
# Copy the payload file(s) to all existing user folders.
@talkingmoose
talkingmoose / CommunicatorSetup-1.0.sh
Created March 7, 2012 22:52
Shell script to configure Microsoft Communicator user name and email address
#!/bin/sh
########################### About this script ##########################
# #
# Purpose: Populates user name and email address settings #
# for Communicator 2011 for Mac. This script resides #
# in /Library/talkingmoose/Scripts and is launched #
# by launch agent net.talkingmoose.CommunicatorSetup.plist. #
# #
# Created by William Smith #
@talkingmoose
talkingmoose / net.talkingmoose.CommunicatorSetup.plist
Created March 8, 2012 15:37
Launch agent for CommunicatorSetup-1.0.sh script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.talkingmoose.CommunicatorSetup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>/Library/talkingmoose/Scripts/CommunicatorSetup-1.0.sh</string>
@talkingmoose
talkingmoose / LyncSetup-1.0.sh
Created March 9, 2012 16:49
Shell script to configure Microsoft Lync user name and email address
#!/bin/sh
########################### About this script ##########################
# #
# Purpose: Populates user name and email address settings #
# for Lync for Mac. This script resides #
# in /Library/talkingmoose/Scripts and is launched #
# by launch agent net.talkingmoose.LyncSetup.plist. #
# #
# Created by William Smith #
@talkingmoose
talkingmoose / net.talkingmoose.LyncSetup.plist
Created March 9, 2012 16:56
Launch agent for LyncSetup-1.0.sh script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.talkingmoose.LyncSetup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>/Library/talkingmoose/Scripts/LyncSetup-1.0.sh</string>
@talkingmoose
talkingmoose / LyncSetup-1.2.sh
Created March 9, 2012 23:26
Shell script to configure Microsoft Lync user name and email address
#!/bin/sh
########################### About this script ##########################
# #
# Purpose: Populates user name and email address settings #
# for Lync for Mac. This script resides #
# in /Library/talkingmoose/Scripts and is launched #
# by launch agent net.talkingmoose.LyncSetup.plist. #
# #
# Created by William Smith #
@talkingmoose
talkingmoose / net.talkingmoose.LyncSetup.plist
Created March 9, 2012 23:55
Launch agent for LyncSetup-1.2.sh script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.talkingmoose.LyncSetup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>/Library/talkingmoose/Scripts/LyncSetup-1.2.sh</string>