Skip to content

Commit

Permalink
Final tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sballin committed Jun 6, 2020
1 parent c226f82 commit 1ba4785
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
# Search Notes.app with Alfred

### Search titles or create a new note if none was found

<p align="center">
<img src="https://user-images.githubusercontent.com/2719004/71554521-5c635800-2a31-11ea-97db-1b7c41aaf408.png" width="654" title="screenshot">
<img src="https://user-images.githubusercontent.com/2719004/83949726-62850e00-a7f3-11ea-99a7-48f8c67cd480.png" width="654" title="screenshot">
<img src="https://user-images.githubusercontent.com/2719004/83949516-403ec080-a7f2-11ea-940c-1813559ce462.png" width="654" title="screenshot">
</p>

## Usage
### Search note titles and bodies

### Search keywords
<p align="center">
<img src="https://user-images.githubusercontent.com/2719004/83949619-e094e500-a7f2-11ea-8802-7856620d4ec8.png" width="654" title="screenshot">
</p>

* **n** to search note titles (this also lets you find notes using the pattern "[folder name] [note name]")
* **nb** to include note body text in search
* **nf** to search note folder names
### Search folder names

<p align="center">
<img src="https://user-images.githubusercontent.com/2719004/83949622-e25ea880-a7f2-11ea-92fa-b2250e574402.png" width="654" title="screenshot">
</p>

### Result actions

* **enter** to open the note/folder, or create a new note if none was found
* **shift+enter** to search for your Alfred query using the Notes in-app search
* **enter** to open the note/folder or create a new note if none was found
* **shift+enter** to search for your Alfred query using the Notes in-app search
* **cmd+enter** to copy the note body to the clipboard
* **alt+enter** to copy a notes:// URL to the clipboard that can be opened with the included `Note Opener/Note Opener.app`

## Install

If you're on macOS Catalina with Alfred 4, download the [latest version](https://github.com/sballin/alfred-search-notes-app/releases/latest/download/Search.Notes.alfredworkflow) of the workflow.

### Authorizing the binary
### Required setup

The "search" binary needs to be manually authorized to run on your computer. Right-click the Search Notes workflow, click "Open in Finder", open the "search" folder, right-click the "search" binary, click "Open", and you should be all set after it runs once in Terminal.

### Older versions
### Customize

If you encounter problems or are on an older version of macOS/Alfred, try an older version like [1.4.3](https://github.com/sballin/alfred-search-notes-app/releases/tag/1.4.3).
Result ordering and title+folder search behavior can be controlled using the [environment variables](https://www.alfredapp.com/help/workflows/advanced/variables/#environment).

### Stay up to date
### Updates

By default, the workflow checks Github for updates every 24 hours. This can be disabled by removing the connections to the "Check for updates" block in the workflow.

You can also be notified of new releases by watching this repo or subscribing to the Alfred forum [thread](https://www.alfredforum.com/topic/11716-search-appleicloud-notes/).
### Compile

## Customize

Result ordering and title+folder search behavior can be controlled using the [environment variables](https://www.alfredapp.com/help/workflows/advanced/variables/#environment).
If you want to compile the binary yourself, you can go into the "search" folder and do `go build`.

## Contributors

Thank you to all who have submitted pull requests, and to [drgrib](https://github.com/drgrib) for allowing me to build off the [alfred-bear](https://github.com/drgrib/alfred-bear) workflow.

I'm very new to Go, so if you see anything that can be improved, don't hesitate to submit a pull request.

## Donate

If you enjoy using this workflow, consider [donating](http://paypal.me/sbballin)!
2 changes: 2 additions & 0 deletions alfred/alfred.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Modified from github.com/drgrib/alfred so that quicklookurl can be "null" without quotes */

package alfred

import (
Expand Down
2 changes: 2 additions & 0 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ or create note</string>
<key>sortByDate</key>
<string>1</string>
</dict>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>3.0.0</string>
<key>webaddress</key>
Expand Down
2 changes: 2 additions & 0 deletions search/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ func (lite LiteDB) QueryThenSearch(q string, search string) ([]map[string]string
if err := rows.Scan(columnPointers...); err != nil {
return results, err
}

// Skip adding item if note body does not contain search string
val := columnPointers[len(cols)-1].(*interface{})
// Type assertion required by bytesReader
noteBodyZippedBytes, ok := (*val).([]byte)
if !ok {
continue
Expand Down

0 comments on commit 1ba4785

Please sign in to comment.