Is it possible to search the scratchpad?

I have accumulated many notes (docs) in the scratchpad. It is very convenient.
I urgently needed to find one of the documents and realized that I have no way of searching all docs in the scratchpad.
thanks in advance for your time and help

The scratchpad is a location on your file system (where exactly depends on where you chose to put it in Preferences > General > Scratchpad).

That means that plain text scratchpad documents can be searched by using the Mac’s Spotlight tool. Go to the folder in Finder and press Search, highlight the Scratchpad folder and put your search term into the box. It should highlight all the files inside the scratchpad matching that content.

Unfortunately that only works for plain text files, not for RTF files. In that case you’ll need to use either a third party tool, or go to the command line (Terminal).

If you are comfortable with the command line, then all your need to do is run grep within the Scratchpad folder — it will search inside RTF files.

If you’re not comfortable with the command line, then these instructions will show you how, but CAUTION: if you’re not comfortable with the command line, then be aware it’s possible to do some destructive things with it. That’s not to say that anything I’ve shown below can damage your files — it can’t —, just that you shouldn’t type anything else in if you’re not sure… :smiley:

For the command line, do this:

  1. In the finder, right click on the Scratchpad folder and choose “Services > New terminal at folder”. This will open a terminal window onto your Scratchpad folder.

  2. After the prompt (which is probably $), type the following (exactly) then press enter: ls (that’s an ell, not a one). This will show you a list of the all the files in the folder.

[attachment=0]Screenshot 2021-01-02 at 12.54.15.png[/attachment]

(The line beginning david@BOG will look different on your system, The important thing is that it shows you the location of your Scrivener folder (for me ~/Dropbox/Scrivener/Scratchpad), and that somewhere there is a prompt ready for you to type a new line.)

  1. After the prompt, type the following (exactly) replacing “my-search-term” (the quotation marks are usually necessary) with whatever you’re looking for:
grep -i "my-search-term" *

(The -i flag makes the search case-insensitive, so it will find ‘Scrivener’ and ‘scrivener’. * means search every file.)

  1. This should give you a list of long lines, which start off with the names of the files containing the matches, even if they are RTF files, and the line in which the match occurs. You can then open the files in the finder / Scratchpad in the normal way.

In this screen shot I’ve search for the word ‘Scrivener’, using the code:

grep -i "scrivener" *

It returns 5 matches (NB: it returns every line with a match, so files can appear more than one in the list). Obviously the file names are in the first part of each line, terminating with :.

[attachment=1]Screenshot 2021-01-02 at 12.44.28.png[/attachment]

It sounds complicated, but once you’d done it a couple of times, it’s really easy…


thank you VERY much for your detailed reply. I greatly appreciate all the time you took to write it.
I tried out the terminal approach. It works as you describe.
I then thought about using houdahspot, my search app and it is very fast because I created a template specifically to search the scratchpad folder.
thanks again very much and happy new year

Glad it worked — I didn’t know whether you had something like Houdah Sport (or Devonthin SphereExpress, which I have). They’re definitely easier, though knowing some basic command line utilities like grep can come in very handy now and then!)

are you happy with it ? do you have the impression that they are still new developments or is it an old app they are keeping around ? I bought it but subsequently deleted it because of the amount of space is takes: 3 GB although I had done only a few searches.

It’s ok, but I don’t really use them that much. If spotlight doesn’t work, I use the terminal usually. But Devonthink itself is very good.

FWIW, I have DevonSphere Express, but have found its results … puzzling. I’m currently using Tembo, which is an express search tool from the HoudahSpot people.


thanks very much. I won’t waste time with it. I used to use Tembo. HoudahSpot is much more powerful for more complex searches.

thank you

Your post motivated me to find ways to make the scratchpad more powerful, for example:

  • in the scratchpad directory you describe, I created 2 folders, one scratchpad archive and the other scratchpad trash. I created Hazel rules based on content. When I want to archive or delete a scratchpad document, I simply type zzarch or zzdel in the document and hazel automatically moves them to the corresponding folder.
  • to work around the absence of styles in the scratchpad, I use the keyboard maestro macro action called “apply styles to clipboard” and created a universal library of styles identical to my Scrivener styles panel which I can use in the scratchpad
  • as a workaround to the absence of lists in the scratchpad, I found that if you create a list using the Bear Notes editor → copy → paste the list into the scratchpad, you end up with a fully functional Scrivener list within the scratchpad. By functional I mean that you can move items up, down, left and right, add more items and obviously also delete some and you can change the type of list ie bullet, numbered, roman, etc just like you would in Scrivener
  • to create a list rapidly, I created a small list in Bear→ copied to the clipboard → created a Typinator snippet (listyy) and now if I simply type listyy in scratchpad a fully functional list is created

it would be nice if all of this could be implemented in the scratchpad without all the workarounds

I don’t mean to take away from the good conversation on using file system tools and additional software to augment the scratch pad. It is meant to be an integrated tool given how it works on a folder of regular old files, and for most things you might want to do beyond what it does, using other tools is the right answer.

That said, ever since Scrivener 3 made functional improvements to the utility of a simplified project window, I’ve stopped using the scratch pad entirely. Why use an intentionally simplified thing that only does one thing, when you can do that, and do everything a project can do?

Now that more recent versions of macOS have broken the toolkit we were using keep files in real-time sync with the disk, there isn’t anything the scratch pad can do that a project window cannot.

A few ideas for what a project window can do: searching through notes (there is ⌘F in the top list view, as well as Quick Search, or even Project Search if you want to get hardcore), tagging notes with labels and keywords, full text writing and revisioning tools, annotating notes with a synopsis, interlinking them, archival to “hidden” folders, a proper trash system &c.

Over the years people have asked us to add more and more into the scratch pad, but really the things that get asked for are things that already exist, and that would if implemented only serve to make the scratch pad less unique, and more like this…


Thank you VERY much for your comment. Your solarized light themed scratchpad like template is superb and I am migrating from my current scratchpad to your template.
I will create a keyboard maestro macro to insure that it is alway floating when activated.

I had a look at your template and would have 2 questions:

1- I notice that the view is editor horizontal split, but I can’t figure out how you put the list of notes/docs on top. What is the “list of notes” in Scrivener terms ? It’s not a Binder, not a corkboard, not an outline. In other words, how could I reproduce the horizontal split view with list of docs on top in any Scrivener project I am working in ? It would be useful to know because the binder often takes up too much space but needs to be there like when you drag and drop files. It that case, I can hide the binder drag and drop in the docs list at the top.

2- in my current (standard) scratchpad, when I drag and drop a PDF into a Note (not into the notes list), a fully scrollable PDF is inserted into the note. With your scratchpad 2.0 template, I only see the first page of the PDF. I suspect that this is a configuration issue, but I can’t find the parameter

Thanks again very much !

You’re welcome!

Yeah! I wish that were a persistent project setting, one that could even be saved into the template—but a macro does the trick nicely, especially since it has an if condition for matching a specific window title.

But it is an Outliner. :slight_smile: I’ve removed all of the stuff from it that come along with a default setup: there is only one column, the title, and icons are removed from it. The header and footer bars are remove to make it even cleaner. The other settings are navigational: binder affects top editor only (so you can easily switch between large groups of notes), with the special exclusion set to open non-group items in “other”, thus clicking on files in the binder loads in the lower half, and finally outliner selection in the top half affects the editor on the lower half.

So that’s the recipe, and you could do it by hand, but just take this window and open the Window ▸ Layouts ▸ Manage Layouts… panel, create a layout, and then apply it to your other project. You’ll want to enable the setting to preserve outliner and corkboard settings, with that. And you might also want to “back up” your current project window layout first—and now really any project can become this. Of course Layouts don’t load items into splits, so you may need to do some navigation to make the setup sensible, after switching.

I have an “Inbox” folder in most of my large projects, and have this particular setup saved as a Layout, it’s a nice way to shrink an otherwise sprawling project down to nothing, so that it can be used to gather notes from other sources. When I’m done I just load my sprawling layout and carry on.

That isn’t specific to this layout, that’s just what happens to PDF files you drop into the main editor. It considers PDF a vector image format and isn’t designed to work any other way—try it in TextEdit as well (or the regular scratch pad for that matter), you’ll get the same weird result.

I pinned the top list to the Research folder on purpose though (it is renamed to “Notes” by the by). Put that PDF into the top list, not the editor on the bottom.

thanks very much for all the explanations. I am extremely happy with the results which will greatly help my workflow because I am constantly working in different apps : browsers, pdfs, mindmaps, etc
have a nice day

Folks, thank you for this discussion and for sharing the scratch pad project. The template imported well into the Win 3 beta, only needed to remove extraneous Outliner columns from the upper window.


1 Like

Uh, yeah, wow trying that, then trying to fix it, and then saving an updated template, exposes a lot of bugs! And frankly I couldn’t even fix the project. I presume it may have something to do with the fact that it was created from a very old Mac template that I use as my blank starter for all projects. Maybe it even goes back to the Mac alpha days, and doesn’t quite do things the way the Windows beta was programmed to expect. I don’t know, I tried to fix it, and it just outright refused to ever work the way it was supposed to.

So I completely redid it from scratch with a new blank project and tested it on Windows to make sure it doesn’t blow up. Now it works as expected on both platforms. I’ve updated the original link for any other Windows beta users interested in trying it. I noticed three things did not convey across platforms properly no matter what I tried, but they are all very minor and preferential:

  • It was supposed to show up in a custom “Notetaking” category for templates, not “Misc”.
  • View ▸ Use Label Color In ▸ Outliner Rows was to be enabled.
  • Project Settings: Special Folders: Default New Bookmarks Folder is supposed to be set to “Notes”.

Thanks for letting me know, Jim.

Thanks Ioa, I’ve moved to v2 of your Scratchpad project on the v3 beta! So far so good… :smiley:

I have been using the new Scratchpad for a few days and am very happy. In terms of workflow, I would like to be able to toggle between the currently Scratchpad layout and editor only when I am working in a specific note.
In your opinion, what would be the quickest way to do so ?
My instinctive solution was to toggle between editor only and Scratchpad layout, but that does not work because when you switch to editor only, the focus in the Binder becomes the focused document, and when you return to the Scratchpad layout, the notes list is empty (because the focus in the binder has moved from “Notes” to the current document.
thank you Ioa

For quickly switching between common layouts, I’ve assigned a few to F-keys. Each layout you create is listed off the Window ▸ Layouts ▸ submenu, so it’s a reliable binding.

As for optimising what gets loaded where, this where using Keyboard Maestro, to handle your shortcut management instead of the OS, could be the ticket. Consider that you can use the Navigate menu to focus a specific editor pane, and then once the focus is there, jump directly to any specific note with Quick Search, all with keyboard commands and typing. E.g., your “F5” key that loads the layout could not only do that, but always load the “Inbox” folder in the top pane and select the last note in the list into the bottom pane. I’ve never gone to that length, but now that I think about it, I might. :slight_smile:

1 Like

The combination of layout + navigation with a so.called keyboard maestro conflict palette solves the problem. Thanks very much IOA