Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

monsieurpaul

macrumors regular
Original poster
Oct 8, 2009
230
0
Hello,

I am trying to create an app that will insert text wherever the cursor is (mostly in another app). Right now I am using the pasteboard and a cmd-v keystroke event. It works, but I find it rather crude and it wipes out everything that could have been in the pasteboard.

Is there another way to achieve this ?

Thanks,

Paul
 
Hello,

I am trying to create an app that will insert text wherever the cursor is (mostly in another app). Right now I am using the pasteboard and a cmd-v keystroke event. It works, but I find it rather crude and it wipes out everything that could have been in the pasteboard.

Is there another way to achieve this ?

Thanks,

Paul

Can you edit the code of the first app? In that case, you can change it to send out notifications of text changes. You then capture these with the second app.
 
Can you edit the code of the first app? In that case, you can change it to send out notifications of text changes. You then capture these with the second app.

- Can notifications work between 2 apps ?

- If I understand correctly, I would need to add code in the receiver app also to react to the notification. Unless there are some kind of universal notifications that all apps are supposed to listen ?
 
- Can notifications work between 2 apps ?

I think they do.

- If I understand correctly, I would need to add code in the receiver app also to react to the notification. Unless there are some kind of universal notifications that all apps are supposed to listen ?

Something like that. But, if I remember correctly, it is not guaranteed that you will receive all notifications in time, in order, or even at all.

Why not have app1 write the data to disk and read that file from app2? Do you need it realtime?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.