• 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: Dave <email@hidden>
  • Date: Thu, 25 Feb 2016 18:59:24 +0000

Hi Yvan,

My email went down for a bit - back now. Here is my Script exactly as it is now:

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

			keystroke "a" using {command down}
			keystroke "v" using {command down}
		end tell

		set the clipboard to myClipboard
	end tell

end setOutlookContent:


on run
	get my setOutlookContent:("HELLO BRAVE NEW CONTENT")
end run


If I run this from the Script Editor then it works ok, but if I run from my App via AppleScript-ObjC then it sets what ever on the Clipboard of my App, not “theContentString”. I checked in Activity Monitor and the Process Name is definitely "Microsoft Outlook”.

I’m wondering if I need a delay? I save some posts somewhere that had delays…….

Any ideas?

Cheers
Dave


> On 25 Feb 2016, at 17:29, Yvan KOENIG <email@hidden> wrote:
>
> What if you use what I gave:
>
> on setOutlookContent:(theContentString as string)
>
> tell application id "com.microsoft.Outlook"
> 	activate
> 	set myClipboard to the clipboard
>
> 	set the clipboard to theContentString # MOVED
>
> tell application "System Events" to tell process "Microsoft Outlook" # CHECK THE PROCESS NAME, I DON4T USE MERDOSOFT PRODUCTS
> set frontmost to true
> 	keystroke "a" using {command down}
> 	keystroke "v" using {command down}
> end tell
>
> 	set the clipboard to myClipboard
> end tell
>
> end setOutlookContent:
>
> on run
> 	get my setOutlookContent:("HELLO BRAVE NEW CONTENT")
> end run
>
>
> Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) jeudi 25 février 2016 18:29:14
>
>
>
> _______________________________________________
> 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


 _______________________________________________
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: Christopher Stone <email@hidden>
    • Re: How to Paste into Outlook 2011 using keystorkes/System Events
      • From: Dave <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>)

  • 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