• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to Paste into Outlook 2011 using keystorkes/System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Paste into Outlook 2011 using keystorkes/System Events


  • Subject: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 25 Feb 2016 21:02:22 +0100


Le 2016/02/25 à 20:21, Dave <email@hidden> a écrit :

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

Hello

I was often forced to build a loop checking that what I was copying is really stored in the clipboard but I never found a way to decide if the clipboard was ready to receive a value after pasting somewhere.

You may try to use :

repeat 10 times
delay 0.05
set the clipboard to myClipboard
if (the clipboard) is myClipboard then exit repeat
end repeat

Yvan KOENIG (VALLAURIS, France) jeudi 25 février 2016 21:01:43




 _______________________________________________
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

  • Follow-Ups:
    • Re: How to Paste into Outlook 2011 using keystorkes/System Events
      • From: Andrew Oliver <email@hidden>
References: 
 >Kind Of Annoying Droplet Behavior (From: "S. J. Cunningham" <email@hidden>)
 >How to Paste into Outlook 2011 using keystorkes/System Events (From: Dave <email@hidden>)
 >Re: How to Paste into Outlook 2011 using keystorkes/System Events (From: Yvan KOENIG <email@hidden>)
 >Re: How to Paste into Outlook 2011 using keystorkes/System Events (From: Bill Cheeseman <email@hidden>)
 >Re: How to Paste into Outlook 2011 using keystorkes/System Events (From: Dave <email@hidden>)
 >Re: How to Paste into Outlook 2011 using keystorkes/System Events (From: Yvan KOENIG <email@hidden>)
 >Re: How to Paste into Outlook 2011 using keystorkes/System Events (From: Dave <email@hidden>)
 >Re: How to Paste into Outlook 2011 using keystorkes/System Events (From: Dave <email@hidden>)

  • Prev by Date: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • Next by Date: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • Previous by thread: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • Next by thread: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • Index(es):
    • Date
    • Thread