Monday, December 11, 2017

#1 2017-11-23 06:09:35 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 187

Outlook 2011 script stopped working

I am using 14.7.7 version.  The script below all of a sudden stopped working.  it is designed to do a 'Send and Receive all'.  I can not figure out why and maybe someone here has an idea. 

The error I get is:

error "System Events got an error: AppleEvent timed out." number -1712

Applescript:


tell application "System Events"
   tell application "Microsoft Outlook" to activate
   tell application "Microsoft Outlook"
       if it is running then
           activate
       end if
       tell application "System Events"
           keystroke (ASCII character 107) using command down
       end tell
   end tell
end tell

Thanks in advance for your help.

Offline

 

#2 2017-11-24 10:42:53 am

EHCB
Member
From:: UK
Registered: 2017-11-23
Posts: 3
Website

Re: Outlook 2011 script stopped working

I don't know if this will fix your problem (there could be some other underlying issues that's causing it to slow down in the first place) but to stop getting the 'timed out' error you can encase your code in a block like this:

Applescript:


with timeout of 600 seconds
--{CODE THAT SLOWS EVERYTHING DOWN}--
end timeout

Now your script will keep trying to make it happen for a whole ten minutes before giving up instead of the default of two

Offline

 

#3 2017-11-24 03:37:43 pm

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4448

Re: Outlook 2011 script stopped working

ChangeAgent wrote:

The script below all of a sudden stopped working.


It's not very nice code with those double-nested tells and long-deprecated ASCII character command. Does it work any better like this?:

Applescript:


tell application "Microsoft Outlook" to activate
tell application "System Events" to keystroke "k" using {command down}

I don't have Outlook. I presume it doesn't have any sort of connect command in its scripting dictionary.


NG

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)