Jump to content

Search Apple/iCloud Notes


Recommended Posts

  • Replies 117
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I've created a workflow to find and open Apple/iCloud notes in Notes.app. Get it on Packal and feel free to open issues/make pull requests on GitHub.  

Version 3.0.0 is out! Notes for this release: Rewritten in Go Faster searching Create a new note if none was found Shift+enter to search for query using Notes in

@Jasondm007 in your filesystem, is Notes.app located in /Applications as well as /System/Applications?   @Regluke and @Vero the basic functionality is now restored on Catalina as of version

Posted Images

  • 3 months later...
  • 4 weeks later...

Hi @sballin, thanks for this brilliant workflow. It's indeed godsend.

 

However, I can't use the body search (nb) because I'm getting this security issue (and "Security & Preferences" pane doesn't show the "Allow" option (because I've already allowed it and can use title search and folder search).

 

The error_log shows this:

 

panic: runtime error: slice bounds out of range [104:100]

goroutine 1 [running]:
main.BuildSubtitleAddition(0xc00002240a, 0x68, 0xc000026070, 0x64, 0x208af58ea, 0x1, 0x64, 0xc000022500)
	/Users/sean/Dropbox (MIT)/Dotfiles/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C13422B2-62E5-4A91-A8D9-65E18FA46712/search_notes/main.go:216 +0x2d4
main.LiteDB.GetResults(0xc000242000, 0x208af58ea, 0x1, 0x208af58e5, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/sean/Dropbox (MIT)/Dotfiles/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C13422B2-62E5-4A91-A8D9-65E18FA46712/search_notes/main.go:317 +0xd51
main.main()
	/Users/sean/Dropbox (MIT)/Dotfiles/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C13422B2-62E5-4A91-A8D9-65E18FA46712/search_notes/main.go:403 +0x138
touch: Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.ED7FF581-A6D4-467A-9095-7248E1201713/update.py: No such file or directory
touch: Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.ED7FF581-A6D4-467A-9095-7248E1201713/update.py: No such file or directory
panic: runtime error: slice bounds out of range [104:100]

goroutine 1 [running]:
main.BuildSubtitleAddition(0xc00002248a, 0x68, 0xc000026070, 0x64, 0x208b558ea, 0x1, 0x64, 0xc000022580)
	/Users/sean/Dropbox (MIT)/Dotfiles/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C13422B2-62E5-4A91-A8D9-65E18FA46712/search_notes/main.go:216 +0x2d4
main.LiteDB.GetResults(0xc000242000, 0x208b558ea, 0x1, 0x208b558e5, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/sean/Dropbox (MIT)/Dotfiles/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C13422B2-62E5-4A91-A8D9-65E18FA46712/search_notes/main.go:317 +0xd51
main.main()
	/Users/sean/Dropbox (MIT)/Dotfiles/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C13422B2-62E5-4A91-A8D9-65E18FA46712/search_notes/main.go:403 +0x138

 

Despite trying the spctl --master-disable method and giving Alfred 4.app and search_notes binary almost all privacy privileges, I can't seem to get the search body function work.

 

Any solutions would be much appreciated.

 

Thanks! 🙂

Screenshot 2021-03-17 at 23.47.00 (Notes).png

Link to post

As I moved away from Evernote, I'm now keeping all my files/attachments/searchable pdfs in iCloud Drive and I'm using Notes as my main note taking app. I'm very keen with my current setup and this workflow is tremendously helpful - literally a godsend! - after the new Evernote apps broke my entire workflow (neither the Alfred extension nor spotlight worked anymore to search/action notes).

 

I have one question regarding this workflow - how could I modify it to have the note open in a separate window after the search - without the sidebar? It currently opens the note in the "list view" and I have to double-click on the note to open it in a separate window. Any way to setup another modifier key (e.g. using ⌘+Enter after searching) so it opens directly the specific note?

Edited by jxxst
typo
Link to post
4 hours ago, jxxst said:

I have one question regarding this workflow - how could I modify it to have the note open in a separate window after the search - without the sidebar? Is currently opens the note in the "list view" and I have to double-click on the note to open it in a separate window. Any way to setup another modifier key (e.g. using ⌘+Enter after searching) so it opens directly the specific note?

 

You could create a new "Run NSAppleScript" action with the following code:

 

on alfred_script(q)
	tell application "Notes"
		-- Show user requested note
		-- Get note id which is first item in q
		set noteID to text 1 thru ((offset of "?" in q)-1) of q
		show note id noteID in default account
		show note id noteID in default account
		-- Click menu Window -> Float Selected Note
		tell application "System Events" to tell process "Notes" to click menu item 11 of menu 7 of menu bar 1
	end tell
end alfred_script

 

Link to post
Posted (edited)
14 hours ago, buraktuyan said:

However, I can't use the body search (nb) because I'm getting this security issue (and "Security & Preferences" pane doesn't show the "Allow" option (because I've already allowed it and can use title search and folder search).

 

Thanks for reporting this issue. I don't think it's security related, that error message is always the same because it's the most common problem users face. I think it's because of certain characters like i/İ having different byte length depending whether they are uppercase or lowercase, and the workflow converts notes to lowercase when searching. I'll work on a fix...

Edited by sballin
Link to post
4 minutes ago, sballin said:

 

Thanks for reporting this issue. I don't think it's security related, that error message is always the same because it's the most common problem users face. I think it's because of certain characters like i/İ having different byte length depending whether they are uppercase or lowercase, and the workflow converts notes to lowercase when searching. I'll work on a fix...

 

Actually, I resolved the issue on my end by removing the error handling code for the "Search note bodies" function:

 

When I start searching for note bodies, Alfred shows the default fallback options for a second or two (and no icons/options for this workflow) but then your workflow starts showing the results for the note body search. When there's error handling, this transition triggers the error message above.

Screenshot 2021-03-18 at 15.21.56 (CleanShot)@2x.png

Link to post
12 minutes ago, buraktuyan said:

Actually, I resolved the issue on my end by removing the error handling code for the "Search note bodies" function

 

Weird! I'll have to think about this. I was able to reproduce your error message with a note containing "İ" but removing the error handling didn't fix things for me.

Link to post
5 minutes ago, sballin said:

 

Weird! I'll have to think about this. I was able to reproduce your error message with a note containing "İ" but removing the error handling didn't fix things for me.

I just ran a test with a note containing "İ" in it, and the nb search couldn't list it in the results. However it didn't throw an error message either.

 

As a note, some of my notes had characters like İ or Ş in them, that was probably the core reason why I was getting this error in the first place.

Link to post
7 hours ago, buraktuyan said:

I just ran a test with a note containing "İ" in it, and the nb search couldn't list it in the results. However it didn't throw an error message either.

 

As a note, some of my notes had characters like İ or Ş in them, that was probably the core reason why I was getting this error in the first place.

 

Here is a pre-release version where characters like that should be handled properly: https://github.com/sballin/alfred-search-notes-app/files/6168245/Search.Notes.zip

 

Let me know if you encounter any issues!

Link to post
8 hours ago, sballin said:

 

Here is a pre-release version where characters like that should be handled properly: https://github.com/sballin/alfred-search-notes-app/files/6168245/Search.Notes.zip

 

Let me know if you encounter any issues!

 

It works great for me without any issues and without any manual changes to the code. Thanks a LOT! 🙂👍

And I liked the new fallbackCreateNew and fallbackSearchBodies functions -- the second one already made my life easier. 👌

Link to post
Posted (edited)

Version 3.3.0 is released! New features:

  • Choose between creating a new note or searching note bodies when no note with a matching title is found (set your preference in environment variables)
  • Better support for accented characters
  • Paste note links quickly using a snippet shortcut
Edited by sballin
Link to post

Hi everyone -- longtime Alfred user, new to this workflow. I'm on latest Big Sur (11.2.3) and I can't get past the "Allow Anyway" part of the installation. I click Allow Anyway, it disappears, I call up Alfred, and it starts all over again. Any suggestions? Thank you!

Link to post
15 minutes ago, qe3 said:

Hi everyone -- longtime Alfred user, new to this workflow. I'm on latest Big Sur (11.2.3) and I can't get past the "Allow Anyway" part of the installation. I click Allow Anyway, it disappears, I call up Alfred, and it starts all over again. Any suggestions? Thank you!

 

In the security pref pane, do you have "Allow apps downloaded from" set to "App Store and identified developers?"

 

Does anything show up in the error log or alfred debug log when you try to open it?

Link to post
1 hour ago, sballin said:

 

In the security pref pane, do you have "Allow apps downloaded from" set to "App Store and identified developers?"

 

Does anything show up in the error log or alfred debug log when you try to open it?

Yes to #1. Image attached.

 

No to #2. See attached after 10-15 attempts to follow the directions.

253022568_ScreenShot2021-03-24at6_19_47PM.thumb.png.0d28e7745a355b84f3836072fe72bdaa.png

 

 

Screen Shot 2021-03-24 at 6.21.29 PM.png

Link to post
35 minutes ago, qe3 said:

Yes to #1. Image attached.

 

No to #2. See attached after 10-15 attempts to follow the directions.

 

Weird... here are a couple more things you can try:

 

1. Locate the binary in (workflow directory)/search_notes, it's the file named search_notes. Right click the binary and press Open (don't do anything else like double click, cmd-down, etc). This is supposed to be equivalent to "Allow Anyway"

2. Try running the binary in the terminal (cd to search_notes directory and do ./search_notes)

3. If neither of the above work, try restarting your computer, or doing 1/2 on a different computer...

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...