Re: Event to trigger writeSelectionToPasteboard

2011-01-06 Thread Peter Watkins
Hi Graham, On Tue, Jan 4, 2011 at 2:43 PM, Graham Cox wrote: > > On 05/01/2011, at 3:04 AM, Peter Watkins wrote: > > This is what I'm really trying to achieve, "I'm writing an app that lets > the user select text in one program and paste it into another by >

Re: Event to trigger writeSelectionToPasteboard

2011-01-04 Thread Peter Watkins
Hi Mark, You used to be able to get around this stuff by using one of the > plugins available (AppleScript Addition or Contextual Menu). But it > seems with each new OS release, Apple has been isolating apps more and > more. No plugins, no way to directly perform common actions like > copy/paste o

Re: Event to trigger writeSelectionToPasteboard

2011-01-04 Thread Peter Watkins
Hi Peter, You can copy a selection using the Accessibility API: > First get the UIElement for the application's "Copy" menu item. > Then invoke "AXPress" on it. > Drawback is that you will have to ask the user to enable Accessibility if > it is not enabled. > > To get an idea about Accessibility,

Re: Event to trigger writeSelectionToPasteboard

2011-01-04 Thread Peter Watkins
Hi Graham, Read the Services Implementation Guide: > > > http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/SysServices/introduction.html > > The app needs to be written to be services aware, and implement the > protocols specified in the guide. If not, you can't do what you'r

Event to trigger writeSelectionToPasteboard

2011-01-01 Thread Peter Watkins
I'm writing an app that lets the user select text in one program and paste it into another by middle-clicking the mouse button. This roughly emulates the X11 selection buffer. The first version I wrote used event taps to detect when the user dragged a selection (doesn't work for a double-click sel