Bug, artefact or feature? Shared search field across tabs

I work with multiple projects open, each in a separate tab. When I project search (⌘⇧F) in one project, the search field is updated/shared across all tabs – although the search text itself is not changed in the other projects.

Scenario:
I project-search for “important text” in Project One, producing a scrivening. I then Find Next (⌘G) through the search results and notice something I need to check in another project. I switch to that project and perform a project search for “random text”. I find what I’m looking for and return to Project One. Pressing ⌘G now tries to find “random text” in the original scrivening instead of “important text”, despite the search field containing “important text”, which is clearly my intent.

I hope it’s clear that the behaviour I’d expect is for each tab to retain its own search text.

This is by far the biggest annoyance I have with Scrivener.

I think this is an Apple issue. I presume the Find routine is provided by Apple as part of TextKit, as I have noticed this happening across Apps built on TextKit, eg TextEdit and NWP.

:slight_smile:
Mark

1 Like

Do you see the same behavior if you open the second project in its own window, rather than a tab?

1 Like

Yes, I do. If I open two different projects in separate windows, for example, the behaviour mentioned occurs.

Just to add: my method for using Project Search is:

  • ⌘⇧F
  • Enter the search term
  • Hit ↵
  • ⌘A – to select all the items in the Binder
  • ⌘G – to step through the results

I can’t imagine this method is responsible for this issue. But I know software sometimes behaves in curious ways.

This is considered standard behaviour on a Mac, to share search terms across contexts in parallel uses of the same search system. This isn’t about tabs, or even what happens inside of one program. All native Mac software shares one universal search term used in ⌘F. Try switching over to TextEdit, paste some text from your project into a window, and hit ⌘G after having run a project search in Scrivener. Now hit ⌘F in TextEdit and search for a different word, switch back to Scrivener and press ⌘G.

1 Like

Ugh! Thanks for the heads-up.

Knowing this, I soon found a discussion on the DevonThink forums about it. The dev(s) there added an option to disable this feature. Is there any chance this could be added to Scrivener?

I also found this post informative: https://apple.stackexchange.com/questions/80894/why-does-a-find-field-value-in-one-application-show-up-in-a-the-find-field-of-an It seems the BBEdit folks also provide a solution.

An Automator solution was posted in that StackExchange that should work for everything, once you set it up (I haven’t tried it, but the shell commands being invoked by it are all still valid).

1 Like

Yep, BBEdit uses Apple’s Find dialog and I have encountered this issue when using it. I haven’t explored BBEdit for a solution there.

:slight_smile:
Mark

As I read it, the Automator suggestion clears the Find clipboard, which is not what I’m after.

BBEdit provides an “expert preference” to switch off the behaviour that’s causing my problem, namely:

defaults write com.barebones.bbedit FindDialog_UsesFindScrap -bool NO