2

I would like to know how can I get this information? I can keep polling, and checking which application is running, and see the pasteboard count at the same time. But I am afraid this way is not 100% accurate. For example, if the user go to app A, and copy things, in the pasteboard, the pasteboard count increase. But the second poll request did not started yet, and the user switch to to app B, then, the poll start, it may mess up the logic. So, any way suggested to find out the NSPasteboard is from which app? Thanks.

4

1 回答 1

0

不,这不受支持。一种 hacky 方法是使用系统范围的键盘挂钩来检测复制 (ctrl+c) 操作。当用户按下该键时,可以查看前台进程。

于 2014-03-27T21:03:56.830 回答