Censoring pasted text

  • Hello,

    if I paste some text from clipboard into a textview, is there a way to
    replace all the occurrences of "foo" by "bar"? If possible, I don't want to
    use "textStorageDidProcessEditing:" as it is called every time I type in
    something. To put it in other words, is there perhaps an event which is
    fired when I paste in something? Is it possible to differentiate between
    text change coming from typing or pasting?

    Thanks in advance!
  • Oh, sorry for the noise. It's in the NSTextView docs, section "Managing the
    Pasteboard".

    On Fri, May 25, 2012 at 9:09 AM, ecir hana <ecir.hana...> wrote:

    > Hello,
    >
    > if I paste some text from clipboard into a textview, is there a way to
    > replace all the occurrences of "foo" by "bar"? If possible, I don't want to
    > use "textStorageDidProcessEditing:" as it is called every time I type in
    > something. To put it in other words, is there perhaps an event which is
    > fired when I paste in something? Is it possible to differentiate between
    > text change coming from typing or pasting?
    >
    > Thanks in advance!
    >
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today