GithubHelp home page GithubHelp logo

sballin / alfred-search-notes-app Goto Github PK

View Code? Open in Web Editor NEW
496.0 17.0 23.0 407 KB

Use Alfred to quickly open notes in iCloud/Apple Notes.

Home Page: https://www.alfredforum.com/topic/11716-search-appleicloud-notes/

License: MIT License

Python 13.71% Go 81.63% Makefile 4.66%
alfred apple-notes icloud-notes notes-app notational-velocity

alfred-search-notes-app's People

Contributors

sballin avatar ytqh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alfred-search-notes-app's Issues

Language support

Characters like İ/i currently cause problems when their case is changed. Here is a pre-release version to fix this problem: Search Notes.zip

ns throws Value Error

Describe the bug
I am receiving ValueError when running Notes search with ns

[09:43:29.841] ERROR: Search Notes[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/aci/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.027998C4-05B8-4F90-9F44-8C2461B79E36/get_notes.py", line 126, in <module>
    print(getNotes(searchBodies=False))
  File "/Users/aci/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.027998C4-05B8-4F90-9F44-8C2461B79E36/get_notes.py", line 95, in getNotes
    folderName = folderNames[folderCodes.index(d[1])]
ValueError: tuple.index(x): x not in tuple

To Reproduce
Steps to reproduce the behavior:

  1. type ns
  2. Fallback Search > nothig found

Desktop (please complete the following information):

  • OS: 10.15.4
  • Alfred version: 4.0.9
  • Workflow version: 2.0.0

Apple M1 support

To Reproduce
Search notes on M1 silicon Mac

Info

  • macOS version: 11.3
  • Alfred version: 4.3.4
  • Workflow version: v3.3.0
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events? Yes
  • What is the output of the debug log when the error occurs? Bad CPU type in executable

Additional context
Rebuilding the excitable in workflow directory on M1 machine with 1.16 resolves this issue

Proposed Implementation
If you're on macOS Catalina with Alfred 4, download the latest version of the workflow for:

  • Intel (x86)
  • Apple (M1)

Doesn't OCRed search text in images

To Reproduce

Steps/context to reproduce the behavior:

  1. Create a note with some handwritten text. If you use a unique made up word you won't get other hits. I used "folgittey"
  2. Search for that unique word in Spotlight, and you get a hit
  3. Search for the same unique word in Alfred and no note is found, only an option to create a new one
  4. Regular text in notes is searchable

Fill out this information if it's not already included in the error text.

  • macOS version: 11.5.1
  • CPU: Intel
  • Alfred version: 4.5 Pre-release
  • Workflow version: 3.4.1
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events?
    Yes to all of these except "Automation > Alfred 4 > Notes", as there is no entry even listed
  • What type of account are your notes stored in (iCloud/On My Mac/Email)? iCloud
  • If no error notification appears automatically, what is the output of the debug log when you reproduce the problem?
[16:46:24.068] Logging Started...
[16:46:29.704] Search Notes[Script Filter] Queuing argument ''
[16:46:29.805] Search Notes[Script Filter] Script with argv '' finished
[16:46:29.809] Search Notes[Script Filter] { "items": [ { "title": "Marcus Aurelius", "subtitle": "Notes", "arg": "0B12E172-4990-4E68-8F62-04DE9ED7102B,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICNote/p1047,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICAccount/p430,", "quicklookurl": " " }, { "title": "Chunngap", "subtitle": "Notes", "arg": "99596301-A1A6-4BD7-8BD9-1D68A9C413E5,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICNote/p1055,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICAccount/p430,", "quicklookurl": " " }, { "title": "TOBBLEZ", "subtitle": "Notes", "arg": "CBA78FA0-01A8-4106-8B44-C574269CBDA1,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICNote/p1091,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICAccount/p430,", "quicklookurl": " " }, { "title": "AirPods replacement", "subtitle": "Notes #ggo-ber #goo", "arg": "C0E9FEA1-21CC-42BF-9C63-64991B6C365A,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICNote/p1060,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICAccount/p430,", "quicklookurl": " " } ] }
[16:46:32.466] Search Notes[Script Filter] Queuing argument 'f'
[16:46:32.584] Search Notes[Script Filter] Script with argv 'f' finished
[16:46:32.587] Search Notes[Script Filter] { "items": [ { "title": "f", "subtitle": "Create new note", "arg": "f", "quicklookurl": "" }, { "title": "Marcus Aurelius", "subtitle": "Notes | …Flarbicle wangdoddle…", "arg": "0B12E172-4990-4E68-8F62-04DE9ED7102B,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICNote/p1047,x-coredata://549413B4-F796-4CD7-92F7-D9FC10159754/ICAccount/p430,f", "quicklookurl": " " } ] }
[16:46:32.687] Search Notes[Script Filter] Queuing argument 'fo'
[16:46:32.799] Search Notes[Script Filter] Script with argv 'fo' finished
[16:46:32.802] Search Notes[Script Filter] { "items": [ { "title": "fo", "subtitle": "Create new note", "arg": "fo", "quicklookurl": "" } ] }
[16:46:32.913] Search Notes[Script Filter] Queuing argument 'fol'
[16:46:33.030] Search Notes[Script Filter] Script with argv 'fol' finished
[16:46:33.033] Search Notes[Script Filter] { "items": [ { "title": "fol", "subtitle": "Create new note", "arg": "fol", "quicklookurl": "" } ] }
[16:46:33.092] Search Notes[Script Filter] Queuing argument 'folg'
[16:46:33.183] Search Notes[Script Filter] Script with argv 'folg' finished
[16:46:33.186] Search Notes[Script Filter] { "items": [ { "title": "folg", "subtitle": "Create new note", "arg": "folg", "quicklookurl": "" } ] }
[16:46:33.258] Search Notes[Script Filter] Queuing argument 'folgi'
[16:46:33.321] Search Notes[Script Filter] Script with argv 'folgi' finished
[16:46:33.328] Search Notes[Script Filter] { "items": [ { "title": "folgi", "subtitle": "Create new note", "arg": "folgi", "quicklookurl": "" } ] }
[16:46:33.531] Search Notes[Script Filter] Queuing argument 'folgit'
[16:46:33.571] Search Notes[Script Filter] Script with argv 'folgit' finished
[16:46:33.588] Search Notes[Script Filter] { "items": [ { "title": "folgit", "subtitle": "Create new note", "arg": "folgit", "quicklookurl": "" } ] }
[16:46:42.055] Search Notes[Script Filter] Queuing argument 'folgitt'
[16:46:42.159] Search Notes[Script Filter] Script with argv 'folgitt' finished
[16:46:42.177] Search Notes[Script Filter] { "items": [ { "title": "folgitt", "subtitle": "Create new note", "arg": "folgitt", "quicklookurl": "" } ] }
[16:46:42.203] Search Notes[Script Filter] Queuing argument 'folgitte'
[16:46:42.235] Search Notes[Script Filter] Script with argv 'folgitte' finished
[16:46:42.254] Search Notes[Script Filter] { "items": [ { "title": "folgitte", "subtitle": "Create new note", "arg": "folgitte", "quicklookurl": "" } ] }
[16:46:42.334] Search Notes[Script Filter] Queuing argument 'folgittey'
[16:46:42.358] Search Notes[Script Filter] Script with argv 'folgittey' finished
[16:46:42.392] Search Notes[Script Filter] { "items": [ { "title": "folgittey", "subtitle": "Create new note", "arg": "folgittey", "quicklookurl": "" } ] }

Error creating new note from different space than main window

To Reproduce

Steps/context to reproduce the behavior:

  1. Search for a note that doesn't exists
  2. Press enter to create new note
  3. Workflow switches to space with notes main window and creates the note
  4. When you go back to space from which you activated workflow there is Alfred error window with following error

Error text

-1719: System Events got an error: Can’t get window 1 of process "Notes". Invalid index.

Screenshot 2021-09-26 at 12 47 13

Info

Fill out this information if it's not already included in the error text.

  • macOS version: 10.15.7
  • CPU: Intel
  • Alfred version: 4.5.1 [1256]
  • Workflow version: 3.5.1
  • Full disk access: Yes
  • Icloud
  • Nothing in debug log

Move notes to folder (working script)

Hi
I've updated my copy to include a script (set up under keyword nf with option down) to move the currently selected notes to the found folder. This would be a great official addition IMHO. The script is below, with lots of your code in comments which can no doubt be deleted.

-- This script takes "URLs" of format "identifier,itemID,accountID,userQuery" or just "userQuery"
-- accountID can be the string "null", if so the default account is used
-- Some commands need to run twice, otherwise they fail when toolbar search is active

on alfred_script(q)
	try
		if q contains "/ICNote/p" or q contains "/ICFolder/p" then
			set AppleScript's text item delimiters to ","
			set identifier to text item 1 of q
			set itemID to text item 2 of q
			set accountID to text item 3 of q
			set AppleScript's text item delimiters to ""
		end if
		tell application "Notes"
			if q contains "/ICNote/p" then
				(*				-- Show user-requested note
				open location "notes://showNote?identifier=" & identifier
				open location "notes://showNote?identifier=" & identifier
				-- Compatibility with macOS < 11 which does not support notes://
				set OSVersion to system version of (system info)
				set mainVersion to text 1 thru ((offset of "." in OSVersion) - 1) of OSVersion as number
				if mainVersion < 11 then
					if accountID is "null" then
						show note id itemID in default account
						show note id itemID in default account
					else
						show note id itemID in account id accountID
						show note id itemID in account id accountID
					end if
				end if
*)
			else if q contains "/ICFolder/p" then
				-- Show user-requested folder
				set s to selection
				repeat with n in s
					if accountID is "null" then
						move n to folder id itemID in default account
						move n to folder id itemID in default account
					else
						move n to folder id itemID in account id accountID
						move n to folder id itemID in account id accountID
					end if
				end repeat
				(*			else
				-- Create new note from user query
				tell default account to make new note at default folder with properties {body:"<div><h1>" & q & "</h1></div><div><br></div>"}
				show first note in default account
				show first note in default account
				tell application "System Events"
					tell process "Notes"
						set focused of text area of scroll area of group 1 of splitter group 1 of splitter group 1 of window 1 to true
						key code {125, 125} -- down, down
					end tell
				end tell
				*)
			end if
		end tell
	on error errorMessage number errorNumber
		display alert "Show Note Error" message ((errorNumber as string) & ": " & errorMessage & "

Input: " & q) as critical
	end try
end alfred_script

search_notes: No such file or directory

I'm following the install instructions, but even after approving search_notes app, Alfred still requires verification once I type n in search bar.

Logs contain the following:

/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/6F8AAE28-930C-467C-A257-7A123A3DBE88: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/B5570B8D-B01F-4818-ACEE-78BCFEE1F070: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/78489B71-A6D2-48FB-9100-AE2C2D5BF4FB: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/F0DFB648-56E8-4DBA-BAC7-AE369A837CB1: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D0A4196F-85EB-4B0F-9FAD-E49D88EECCC9: line 1: search_notes/search_notes: No such file or directory

MacOS Monterey

Most likely a bug in Monterey but the "search_notes" permission is not appearing on the Security Preferences to allow. Again, most likely a bug in MacOS but did want to bring it up.

No way to create a new note deterministically

Since the only way to create a new note is to have no results, you're kind of out of luck if it matches anything.

For example, if I want to create a new note called "Bowling", but there's already a new called "Plans for Bowling", there's no way to do so currently with this workflow.

Selected note doesn't open

  1. Search for a note with n <query>
  2. ↵ Enter
  • If you're already in a note in the Notes app, the notes app will appear, but the old note still stays visible
  • If the Notes app is in the folder view, the selected note is highlighted, but not opened

v3.4.0+ not work on 10.14

To Reproduce

Steps/context to reproduce the behavior:

  1. Search for a note
  2. ...

Error text

Copy and paste the full error text from any error messages. Screenshots can also help but may not show the full text.

Info

Fill out this information if it's not already included in the error text.

  • macOS version:
  • CPU: Intel or Apple (M1)?
  • Alfred version:
  • Workflow version:
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events?
  • What type of account are your notes stored in (iCloud/On My Mac/Email)?
  • If the workflow can't manage to show a list of your notes, verify that the search_notes executable file is present by right-clicking the "Search Notes" workflow in the workflow list of Alfred Preferences, choosing "Open in Finder" and opening the search_notes folder. Is there a file of the same name inside that folder?
  • If no error notification appears automatically, what is the output of the debug log when you reproduce the problem?

search_notes error panic: unable to open database file: operation not permitted

To Reproduce

Steps/context to reproduce the behavior:

  1. Search for a note
  2. Error below

Error text

Please copy this entire text if submitting an error report. You may need to scroll.

panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
github.com/sballin/alfred-search-notes-app/main.go:502
main.main()
github.com/sballin/alfred-search-notes-app/main.go:515 +0x654

macOS: 11.5.1
Alfred: 4.5.1
Workflow: 3.4.1
CPU: arm64e
Binary xattrs: com.dropbox.attrs
Notes DB xattrs: com.apple.quarantine
Binary info: 0755 501/ke 20/staff
Notes DB info: 0644 501/ke 20/staff
Query: title '�'
Accounts: (-1743) Not authorized to send Apple events to Notes.

Info

Fill out this information if it's not already included in the error text.

  • macOS version: 11.5.1

  • CPU: M1

  • Alfred version: 4.5.1 [1256]

  • Workflow version: 3.5.0, 3.4.1

  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events?

    Looks like System Events might be the culprit:
    Screen Shot 2021-08-10 at 12 52 33 PM

  • What type of account are your notes stored in (iCloud/On My Mac/Email)? iCloud

  • If the workflow can't manage to show a list of your notes, verify that the search_notes executable file is present by right-clicking the "Search Notes" workflow in the workflow list of Alfred Preferences, choosing "Open in Finder" and opening the search_notes folder. Is there a file of the same name inside that folder? Yes

  • If no error notification appears automatically, what is the output of the debug log when you reproduce the problem?

Copy notes:// URL doesn't work

Using the copy note as URL feature throws error

Here is the debug log output

[18:15:33.998] Search Notes[Script Filter] Queuing argument ''
[18:15:34.091] Search Notes[Script Filter] Script with argv '' finished
[18:15:34.094] Search Notes[Script Filter] {
    "items": [
        {
            "title": "Scratchpad",
            "subtitle": "Notes",
            "arg": "x-coredata://E56025F2-FC6A-42A7-8A73-EC73F575F9EF/ICNote/p3007?",
            "quicklookurl": null
        }

Deleted a bunch of these for privacy

    ]
}
[18:15:40.844] Search Notes[Script Filter] Processing complete
[18:15:40.845] Search Notes[Script Filter] Passing output 'x-coredata://E56025F2-FC6A-42A7-8A73-EC73F575F9EF/ICNote/p3007?' to Run NSAppleScript
[18:15:40.867] ERROR: Search Notes[Run NSAppleScript] {
    NSAppleScriptErrorAppName = Notes;
    NSAppleScriptErrorBriefMessage = "AppleEvent handler failed.";
    NSAppleScriptErrorMessage = "Notes got an error: AppleEvent handler failed.";
    NSAppleScriptErrorNumber = "-10000";
    NSAppleScriptErrorRange = "NSRange: {392, 4}";
}
[18:15:40.869] Search Notes[Run NSAppleScript] Processing complete
[18:15:40.869] Search Notes[Run NSAppleScript] Passing output '' to Run Script 

To Reproduce
Steps to reproduce the behavior:

  1. Invoke Alfred
  2. Type n (followed by a space)
  3. ⌥ Return
  4. Doesn't copy url to clipboard as expected, throws error.

Desktop (please complete the following information):

  • OS: MacOS 10.15.6
  • Alfred version: 4.1
  • Workflow version: 3.1.0

Python2 reappeared

After merging python3 PR, looks like there are now 2 places where python2 reappeared:

  1. update.py
  2. info.plist

This triggered the macOS "Software needs to be updated" dialog for me, where "learn more" said "python2 is on its way out".

Feature: create note if not exists

Hi! Would be nice if n <filter>would create a new Note with title <filter> if it wasn't found in Alfred.
Currently it exits the search-notes workflow.

image

Alfred Search Notes Worflow Error

To Reproduce
Steps to reproduce the behavior:

  1. Type 'n' into Alfred search bar

Info

  • macOS version: BigSure 11.4
  • CPU: Intel or Apple (M1)? Intel
  • Alfred version: 4.3.4
  • Workflow version: 3.3.0
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events?
    Yes, except don't have the option to turn on "Automation > Alfred 4 > System Events"

Additional context
After typing "n" into Alfred I get the below error. It had been working perfectly up until about a week or so ago.

image

Notes folder and items are ignored

Describe the bug
When I search for notes in the default folder named "Notes" or try to open that folder It doesn't appear. I'm not sure if there's something different with my notes so the underlying AppleScript fails. Searching for notes in all other folders appear to work fine.

To Reproduce
Steps to reproduce the behavior:

  1. Type 'n ' then a note name.
  2. If it's in the 'Notes' folder it won't appear.

Desktop (please complete the following information):

  • OS: macOS 10.15.5
  • Alfred version: 4.0.9
  • Workflow version: 3.0.1

Utilize "tags" notes feature of Mac OS Monterey

Is your feature request related to a problem? Please describe.
Now that Monterey is released, wanted to check if the workflow can be modified to utilize new features of Monterey (i.e., tags).

Describe the solution you'd like
This workflow must accept the "tag name" as the input, Alfred should then display all the other tags under this tag, which can be used to narrow down to the document right from the Alfred search bar.

Example. If I have 100 notes with the tags

  1. #kubernetes #setup #howto
  2. #kubernetes #reference #kubectl
  3. #kubernetes #istio #overview
  4. #kubernetes #core #overview
  5. #Java #setup #howto

Then the workflow can accept the input - if the user types "Kubernetes", then the user can further drill down from the list of items in Alfred (i.e., setup, howto, overview, Istio, core, Kubectl).

if the user types "overview" after "kubernetes" (i.e., kubernetes overview), then the Alfred search bar can display "Istio and core" as options.

This will be very useful to narrow down to the document right from the search bar.

Describe alternatives you've considered

Additional context

Can't open notes contained in “On my Mac” if iCloud notes also present

To Reproduce
Make sure the Notes app both contains notes synced through iCloud, and notes stored locally (in the “On My Mac” section).
Use the workflow to search for a note from the On My Mac section, and press enter to open it; nothing happens.

Info

  • macOS version: 11.4
  • CPU: M1
  • Alfred version: 4.3.4
  • Workflow version: 3.3.0
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events? Yes!
  • What is the output of the debug log when the error occurs?
[11:18:08.435] Search Notes[Script Filter] Processing complete
[11:18:08.437] Search Notes[Script Filter] Passing output 'x-coredata://[REDACTED]/ICNote/p50?com' to Run NSAppleScript
[11:18:08.740] ERROR: Search Notes[Run NSAppleScript] {
    NSAppleScriptErrorAppName = Notes;
    NSAppleScriptErrorBriefMessage = "Can\U2019t get note id \"x-coredata://[REDACTED]/ICNote/p50\" of default account.";
    NSAppleScriptErrorMessage = "Notes got an error: Can\U2019t get note id \"x-coredata://[REDACTED]/ICNote/p50\" of default account.";
    NSAppleScriptErrorNumber = "-1728";
    NSAppleScriptErrorRange = "NSRange: {301, 38}";
}
[11:18:08.761] Search Notes[Run NSAppleScript] Processing complete
[11:18:08.762] Search Notes[Run NSAppleScript] Passing output '' to Run Script

Additional context
Before I enabled iCloud note syncing (and therefore only had the “On My Mac” section), the workflow could open notes from this section just fine.
To be clear, the workflow still finds these notes (they're listed in the results) but can't open them (actionning the result doesn't do anything).

As a test, I changed the default account in Notes preferences, from iCloud to On My Mac, and predictably this flips the issue: with that setting, the workflow can't open iCloud notes anymore, but can open local notes.

Trying to authorize "search" fails with security warning

Describe the bug
Installed the workflow and followed the instructions to manually authorize "search." However, when I do that, I get the following popup with no option to override the security warning:

image

A similar warning happens when I type in "n" to the alfred inteface, displaying the following popup instead with the additional option to "Move to Trash":

image

To Reproduce
Steps to reproduce the behavior:

  1. install the workflow

  2. try running "n" into the alfred search box

  3. immediately get a error popup

  4. install the workflow

  5. try to authorize "search"

  6. security warning popup displays

Desktop (please complete the following information):

  • OS: macOS 11 b3
  • Alfred version: 4.1
  • Workflow version: 3.1.0

Additional context
Typing ANY word that starts with "n" in the Alfred search box now immediately errors out as indicated above.

not support to search when my note has a table

Describe the bug
can't find table content

To Reproduce

1、I have a note, the note contains a table like this

name tag usage mark use help
jcmd java view jar startup argument jcmd pid help

2、when i search by press nb jcmd, it show no result

Desktop:

  • OS: macOS 10.15 Catalina
  • Alfred version: Alfred 4
  • Workflow version: v3.0.2

Additional context

can't parse note format correctly when the note contains a table

if !strings.Contains(strings.ToLower(string(body)), strings.ToLower(search)) {

I really appreciate your help,thank you!

Error in python getNotes function

Describe the bug

When I type n or nb or nf, it shows "Search Notes" / "Notes Bodies"... respectively, but then switched to google search.

I checked the debug log output, first it was because python3 was not installed, so I had to install via homebrew, which required the latest version of xcode. So now I have the latest version of xcode and python3.

Now I still have the same erratic behaviour, but now with a different error in the logs. Maybe I have the wrong version of python ? Which version is required.

I suggest putting these requirements in the repo readme :)

Log Output

[10:06:37.564] Logging Started...
[10:06:45.002] Search Notes[Script Filter] Queuing argument '(null)'
[10:06:45.176] Search Notes[Script Filter] Script with argv '(null)' finished
[10:06:45.179] ERROR: Search Notes[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/sam/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1DC8A72D-6AE1-4164-A099-E4F86C168D83/get_notes.py", line 126, in <module>
    print(getNotes(searchBodies=False))
  File "/Users/sam/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1DC8A72D-6AE1-4164-A099-E4F86C168D83/get_notes.py", line 88, in getNotes
    dbItems = sorted(dbItems, key=lambda d: d[sortId], reverse=sortInReverse)
TypeError: '<' not supported between instances of 'NoneType' and 'float'

To Reproduce

Basically use the workflow (I mean nothing works for me).

Desktop (please complete the following information):

  • OS: catalina 10.15.3
  • Alfred version: 4.0.8
  • Workflow version: 2.0.0 (latest as of March 2020)

Alfred note search fails after Notes.app search

To reproduce:

  • Search for a note in Notes.app search bar and click to place cursor in note text
  • Search using Alfred for a note in a different folder and press enter
  • View flashes, Notes.app search bar is cleared, but the note in the view is still the one that was found using Notes.app

Does not work if xcode-select is not installed

Describe the bug
I was scratching my head why this workflow does not work, debug log showed

Starting debug for 'Search Notes'

[2020-01-10 19:22:54][ERROR: input.scriptfilter] Code 1: xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools.
See man xcode-select for more details.

I had to run two console commands, not sure if normal user would know how to do that tho
xcode-select --install
sudo xcode-select --reset

And now it works, i had Xcode installed but removed it, thats why

Not sure you can do about it, not sure if u can display alert that user dosnt have xcode-select installed

Have an option to select which folder notes get created in

It would be great if there was an option to select which folder a note was created in. For example I have two folders and want all my new notes to be in the second 'inbox' folder so they are all together for me to review later on. Currently each note gets saved to the first folder.

Paypal asks for too much commission

The problem
I want to donate 5$. I know, this is a small amount of money, but I don't know how many people donate, so, probably, it could be at least a small little present to the author of this great workflow. It's not a problem for me to overpay 55% of commission, but, still, I feel like it could stop others from donating small amount of money and it just feels injustice.

The solution
Probably, PayLor.Me 2.0. I know nothing about it, but a quick search has shown that it could be at least a sort of alternative to paypal.me. I didn't consider any other alternative and didn't spend much time on the research.

Screen Recording 2020-03-09 at 12 48 10

Problem when creating a new note w/ "nc" command

To Reproduce

Steps/context to reproduce the behavior:

  1. Type "nc" in Alfred Search bard
  2. Type new text and press enter

Error text

Screen Shot 2021-11-17 at 10 07 12 AM

"-1719: System Events got an error: Can’t get group 1 of splitter group 1 of splitter group 1 of window 1 of process "Notes". Invalid index."

Info

Fill out this information if it's not already included in the error text.

  • macOS version: Monterey
  • CPU: Apple (M1)
  • Alfred version: 4.6
  • Workflow version: The Latest? Yesterday, I downloaded it directly here and followed with the update prompt that popped up in Alfred.
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events? Yes
  • What type of account are your notes stored in (iCloud/On My Mac/Email)? iCloud
  • If the workflow can't manage to show a list of your notes, verify that the search_notes executable file is present by right-clicking the "Search Notes" workflow in the workflow list of Alfred Preferences, choosing "Open in Finder" and opening the search_notes folder. Is there a file of the same name inside that folder? Yes
  • If no error notification appears automatically, what is the output of the debug log when you reproduce the problem? Unsure

ERROR: Search Notes.app[Script Filter] JSON error

I was getting the following error in Alfred 4 with latest version of search-notes-app:

ERROR: Search Notes.app[Script Filter] JSON error: Unexpected end of file during string parse (expected low-surrogate code point but did not find one). in JSON

I was not able to reproduce it, but somehow moving to python3 helped here.

search_notes error – panic: unable to open database file: operation not permitted

To Reproduce

Steps/context to reproduce the behavior:

  1. In macOS Monterey, open Alfred
  2. Type the letter n (in this particular case, I was trying to open Notion)

For now, I have disabled the workflow until the issue is solved

Error text

panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
github.com/sballin/alfred-search-notes-app/main.go:461
main.main()
github.com/sballin/alfred-search-notes-app/main.go:474 +0x7f3

macOS: 12.0.1
Alfred: 4.6
Workflow: 3.5.2
CPU: x86_64h
Binary xattrs: com.apple.lastuseddate#PS
Notes DB xattrs:
Binary info: 0755 501/donovan 20/staff
Notes DB info: 0644 501/donovan 20/staff
Query: title '�'
Accounts: iCloud

Stopped working after MacOS 11.4 upgrade

To Reproduce

  1. I'm getting the error message described in "Required setup": https://github.com/sballin/alfred-search-notes-app#required-setup'
  2. Step 3 in the instructions doesn't work, as the "Open Anyway" button doesn't appear.

Info

  • macOS version: 11.4
  • Alfred version: 4.0
  • Workflow version: 3.3.0
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events? Yes
  • What is the output of the debug log when the error occurs?
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789
panic: unable to open database file: operation not permitted

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:394
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:407 +0x789

Additional context
Add any other context about the problem here.

Note linking

It looks like there is a handy built-in way to link to notes.

On macOS

notes://showNote?identifier=A5E7652C-26A5-4E42-8393-F300D7E5C80B

On iOS

mobilenotes://showNote?identifier=A5E7652C-26A5-4E42-8393-F300D7E5C80B

The identifiers are the same across computers/phones and are stored in the Notes SQL database (column zidentifier in table ziccloudsyncingobject) and the content graph of the note on iOS.

This is almost perfect except that it appears you would need to have one of each type of URL in order to have the link functionality on both platforms, as the mobilenotes:// link doesn't work on macOS and vice-versa.

@temochka any thoughts? As you predicted there is now a Shortcuts app in macOS Monterey.

turn query into the body of a new note as a fallback when unable to search note

problem i'm having
hi sean - my problem is that id like to turn my query into a new note if the workflow is unable to find it - a body version of how a new note is created, when the workflow can't find the title in the title search function.
i.e. type "nb remember to buy bread" -> workflow realizes there is no "remember to buy bread" text, and creates a new note with the query being the body -> a new note with an empty heading with "remember to buy bread" as the body is created.
Right now I have it set up in apple note preferences that while searching/creating a new note title, the default text is the body, so when I want to create a new note I type "nt insert new note text here"
Still a beginner at code so I can't read the workflow well, from opening the workflow in Alfred I see that "nb" command is connected to the third "creating a new note" task, but it doesn't seem to be working.

solution
have "create a new note with query" as a fallback option after pressing return, when no notes can be found with the query

alternatives
I googled other note workflows but they haven't been updated to work for alfred 4 or just don't work, really hope you can help!

Functionality to create new note isn't working

The creating a new note functionality isn't working. If I type 'n here is a new note' it just tries to Google search that text. In other words, the Alfred-search-notes-app workflow exits and alfred defaults to google search. It finds my notes with no problem but creating a new note is not working. Any ideas why? Thanks in advance.

Fill out this information if it's not already included in the error text.

  • macOS version: 11.4
  • CPU: Intel or Apple (M1)? M1
  • Alfred version: 4.3.4
  • Workflow version: 3.4.1
  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events?
  • What type of account are your notes stored in (iCloud/On My Mac/Email)? iCloud
  • If the workflow can't manage to show a list of your notes, verify that the search_notes executable file is present by right-clicking the "Search Notes" workflow in the workflow list of Alfred Preferences, choosing "Open in Finder" and opening the search_notes folder. Is there a file of the same name inside that folder?
  • If no error notification appears automatically, what is the output of the debug log when you reproduce the problem?

no such column: zalttext

To Reproduce

Steps/context to reproduce the behavior:
Just updated to 3.4.0 and I now get this error when typing "n ", i never get the permission error nor see the "allow" button in security.

  1. Search for a note
  2. ...

no such column: zalttext



Please copy this entire text if submitting an error report. You may need to scroll.

panic: no such column: zalttext

goroutine 1 [running]:
main.PanicOnErr(...)
	github.com/sballin/alfred-search-notes-app/main.go:440
main.main()
	github.com/sballin/alfred-search-notes-app/main.go:453 +0x7f3

macOS: 10.15.7
Alfred: 4.3.4
Workflow: 3.4.0
CPU: x86_64h
Binary xattrs: 
Notes DB xattrs: com.apple.quarantine
Binary info: 0755 502/ay 20/staff
Notes DB info: 0644 502/ay 20/staff
Query: title '�'
Accounts: iCloud, Mapbox

Copy and paste the full error text from any error messages. Screenshots can also help but may not show the full text.

Info

Fill out this information if it's not already included in the error text.

  • In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events? - yes
  • What type of account are your notes stored in (iCloud/On My Mac/Email)? - iCloud, Google (error still happens when this is disabled)
  • If the workflow can't manage to show a list of your notes, verify that the search_notes executable file is present by right-clicking the "Search Notes" workflow in the workflow list of Alfred Preferences, choosing "Open in Finder" and opening the search_notes folder. Is there a file of the same name inside that folder? - yes
  • If no error notification appears automatically, what is the output of the debug log when you reproduce the problem?
[20:02:46.725] Logging Started...
[20:02:49.926] Search Notes[Script Filter] Queuing argument ''

Help request: understanding the note data format

The note body text data in the database contains some non-text bytes that I don't understand. I'm interested in cleanly extracting the plaintext and raw link URLs, but I've been having trouble coming with general enough rules to do it right.

If you recognize this format, please let me know. Here's what I know so far:

Note data is stored in the database in gzip DEFLATE format. After decompression, it looks like this:

[short amount of non-text bytes]

[note title plaintext]

[note body plaintext (what the user sees in the Notes app—links appear as the user-set text rather than the raw URL if applicable)]

[bytes 26 16]

[non-text bytes of length roughly proportional to length of note]

[raw URLs of all links in body text, each preceded by a ~9-byte sequence that starts with 42 and followed by some more non-text bytes]

Note body preview problems

  • Locked notes show an ugly error message as the body preview
  • Notes that are just a title with no body show the title again as the preview
  • Notes with images and no text have a blank body preview
  • Newlines in note body preview could be replaced with /

Suggestion: copy note contents to clipboard

Copy the contents of the selected not to the clipboard. I use Apple Notes for all my code snippets and right now I use this workflow to search for the snippet, but then I have to manually copy the note contents to the clipboard. Being able to copy to the clipboard right in Alfred would be super great.

I was playing around with Evernote and the Evernote workflow and this appears to be able to do this. I'm assuming this is not apples and oranges, but just wanted to mention. https://www.alfredforum.com/topic/840-evernote-workflow-9-beta-4-alfred-4/

Search suggestion

Hi,

Thanks for this workflow, it works great.
I have a "minor" suggestion when searching for notes which I noticed recently.

When you search with "n"-hotkey and then start typing the keyword, it switches from the workflow to default search when there is no match.
Would it be possible to change the output to something like "No results" instead?

Here is an example of what I mean when I search for a note with title "Workflow":
screen shot 2019-01-17 at 07 24 35
This one is found which is great.

If I add the next letter in the keyword it switches from the Notes workflow to default Alfred search:
screen shot 2019-01-17 at 07 25 51

It would feel better if Alfred stayed in "Notes search mode" and gave me a result instead even if there are no matches, for example just outputting "No note found" or something like that. At the moment Alfred doesn't seem to care about the "n"-hotkey when there is no match and switches to default search.

Keep up the good work!

TypeError: 'NoneType' object has no attribute '__getitem__'

I just downloaded the package from Packal but it does not work, here's the debug data:

[2018-08-10 00:07:22][ERROR: input.scriptfilter] Code 1: Traceback (most recent call last):
  File "/Users/stevejobs/path/to/Alfred.alfredpreferences/workflows/user.workflow.43CB9AFF-A420-4B19-8C99-C393EC988448/searchNotes.py", line 35, in <module>
    for m in matches]
TypeError: 'NoneType' object has no attribute '__getitem__'

Let me know if you need me to provide you with more info. FYI, I am on High Sierra at the moment too

Filenames containing emojis are incompatible with Dropbox sync

Describe the bug
Folder filenames containing emojis do not sync properly over Dropbox.

To Reproduce
Steps to reproduce the behavior:

  1. Install workflow on computer A with dropbox sync
  2. Try to use workflow on computer B
  3. Folder icons didn't sync and don't show up in Alfred results

Desktop (please complete the following information):

  • OS: 10.15.4
  • Alfred version: 4.0.9
  • Workflow version: 2.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.