Re: How to Paste into Outlook 2011 using keystorkes/System Events
Re: How to Paste into Outlook 2011 using keystorkes/System Events
- Subject: Re: How to Paste into Outlook 2011 using keystorkes/System Events
- From: Dave <email@hidden>
- Date: Thu, 25 Feb 2016 19:21:41 +0000
Hi,
This seems to work regardless of where it is run from:
------------------------------------------------------------------------------------------
--
-- setOutlookContent:
--
------------------------------------------------------------------------------------------
on setOutlookContent:(theContentString as string)
tell application id "com.microsoft.Outlook"
activate
set myClipboard to get (the clipboard)
set the clipboard to theContentString
tell application "System Events" to tell process "Microsoft Outlook"
set frontmost to true
--delay 0.5
keystroke "a" using {command down}
--delay 0.5
keystroke "v" using {command down}
end tell
delay 0.5 *****************
set the clipboard to myClipboard
end tell
end setOutlookContent:
The last delay seems to do the trick. I’m wondering if I could safely lower this as 1/2 second seems a bit too long?
All the Best
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden