Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 12, 2013, 03:12 PM   #1
sitryd
macrumors newbie
 
Join Date: Sep 2006
Scripting Outlook

Hello all,

I'm trying to script what I thought would be a pretty simple event in Outlook, to accept meeting requests, but the syntax doesn't appear to be doing anything. Anyone have a brilliant solution?

Code:
tell application "Microsoft Outlook"
	set selectedMessages to current messages
	if selectedMessages is {} then
		display dialog "Please select a message first and then run this script." with icon 1
		return
	end if
	
	accept meeting sending response none
	
end tell
It's not returning an error code, nor is it actually processing the selected message and accepted the invitation.
sitryd is offline   0 Reply With Quote
Old Mar 12, 2013, 03:53 PM   #2
sitryd
Thread Starter
macrumors newbie
 
Join Date: Sep 2006
Think I solved my own question... The following seems to work, though only from the event email (and not from a calendar event itself):

Code:
tell application "Microsoft Outlook"
	set selectedMessages to selected objects
	if selectedMessages is {} then
		--display dialog "Please select a message first and then run this script." with icon 1
		return
		
		
	end if
	
	if (count of selectedMessages) is greater than 1 then
		display dialog "Please select one meeting event for acceptance."
	else
		
		repeat with theMessage in selectedMessages
			
			try
				accept invite of theMessage sending response none
			end try
			try
				accept meeting of theMessage sending response none
			end try
		end repeat
		
	end if
end tell

Last edited by sitryd; Mar 14, 2013 at 12:28 PM. Reason: Changed code to only handle selected objects instead of all objects in a folder... oops.
sitryd is offline   0 Reply With Quote
Old Mar 14, 2013, 12:28 PM   #3
sitryd
Thread Starter
macrumors newbie
 
Join Date: Sep 2006
(Edit 2: now works with events selected in the calendar view as well as meeting invite messages)
sitryd is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
I need help with some scripting flash1996 Mac Basics and Help 0 Mar 30, 2014 09:01 PM
need help on bash scripting tonkpils Mac Programming 6 Dec 10, 2013 08:37 AM
Import Mails from Outlook for MAC to Outlook for Windows xpmrz Mac Basics and Help 1 Oct 19, 2013 06:36 PM
Keynote scripting activate Mac Programming 2 Nov 1, 2012 02:33 AM
Transferring folders from Outlook Express to iMail or Outlook for Mac rogercorke Mac Basics and Help 2 Oct 8, 2012 09:25 AM

Forum Jump

All times are GMT -5. The time now is 03:25 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC