Find text replaced with Safari query

Strange bug.

  1. Open Find (that Cmd-F thing), enter a find text, let it search and find.
  2. Switch to Safari; perform a range of activities, several will raise the issue, one does for sure: enter “this is my search” into Safari’s address&search-bar, let it search
  3. Alt-tab back to Scrivener…
  4. … and your Find text will be replaced with “this is my search”

As I’m at it: I’m currently performing a lot of search&replaces to clean up a longer manuscript, many with regex. I’ve missed a history of finds. Otherwise, regexes rock, apart from the missing \U command implementation.

I don’t think this is a bug. OS X has a find pasteboard, and when a find is performed, other find texts can be updated from that pasteboard. It’s strange that it’s happening in this particular case, though, that Safari is putting the information up there for Scrivener to find.

Unfortunately find history is only possibly with standard find fields, and a lot of users wanted find fields that supported invisible characters.

The combination of both features has some unwelcome side effects, though. On the other had, if forced me to have an text editor opened next to Scrivener to store the regexes in case I had to come back to them later. In case anyone has to deal with similar English language and academic formatting Stalinisms in the future, here they are:

1. <i.e. > -> <i.e., > 2. <e.g. > -> <e.g., > 3. <([^,—]) (e\.g\.)> -> <$1, $2> # replaces "text e.g." with "text, e.g." 4. <— ,> -> <—,> # remove unnecessary spaces after em-dash 5. < ([Aa]) ([aeio])> -> < $1n $2> # replaces "a error" with "an error" 6. < ([Aa])n ([^aeio])> -> < $1 $2> # replaces "an flaw" with "a flaw" 7. <\. (\{[\w ;:\\]+\})> -> < $1\.> # replaces 'text. {\comment: \Author 1999}' with 'text {Author 1999}.' 8a.<\.” \{([\w ;-]+)\}> -> <” \{$1\}\.> # replaces '"test." {Author 1999}' with '"test" {Author 1999}.' 8b.<” \{([\w ;-]+)\}\.> -> <\.” \{$1\}> # replaces: '"test" {Author 1999}.' with '"test." {Author 1999}' 9. <,” > -> <”, > # replaces „text -> “text

I’m pretty sure the shared “find” string thing is normal. I’ve noticed that in many different programs. I’ll search for ^W in Scrivener and then I get the same string in TextEdit when I use Find, there (though now it is searching for a literal caret symbol since it doesn’t support regex). The only programs that don’t seem to consistently cross-pollinate search terms are programs that have been ported to the Mac and make only light use of Cocoa libraries, like Word.

For me, shared find strings is annoying 45% of the time and welcome 45% of the time. It can be very useful to jump from window to window hitting Cmd-G, with little care for which program you are on. It’s a very content biased move by Apple. But then there is that 45% of the time where it is hugely annoying. :slight_smile:

I do also keep a file of useful regex patterns (I wouldn’t trust search history in any program to store those), but there is little reason to use another text editor just for that. Try Scrivener’s Scratch Pad (which has the benefit of using external files that other programs can access—no need to have Scrivener open if you come across a good pattern.