• 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: Fri, 26 Feb 2016 15:35:20 +0100

As I don't own Outlook I tried to do the job in Mail.
At front was the message created after pressing the button "Answer"

tell application "Mail"
activate
end tell

set newContents to "azertyuiop
qsdfghjklm
wxcvbn?"

tell application "System Events" to tell process "Mail"
set frontmost to true # required under Yosemite, not required under El Capitan but don't hurt
# Select All
keystroke "a" using {command down}
# Delete
key code 51 using {command down}
keystroke newContents
keystroke return
repeat with aPara in paragraphs of newContents
keystroke aPara & return
end repeat
end tell

Running it I discovered that keystroking a text skip the embedded return characters.
This is why I decided to keystroke the paragraphs one by one.

As you see, the script doesn't clobber the clipboard.


I guess that the scheme may be adapted to Outlook.


Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) vendredi 26 février 2016 15:35:13



 _______________________________________________
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

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>)
 >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: Andrew Oliver <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: 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>)

  • Prev by Date: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • Next by Date: AppleScript Script Editor Crashing Problem
  • 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