sballin / alfred-search-notes-app

Use Alfred to quickly open notes in iCloud/Apple Notes.
https://www.alfredforum.com/topic/11716-search-appleicloud-notes/
MIT License
522 stars 24 forks source link

search_notes: No such file or directory #31

Closed sergeyzwezdin closed 3 years ago

sergeyzwezdin commented 3 years ago

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
sballin commented 3 years ago

It's working for me and others on Big Sur... Are you able to see the binary in the Finder and execute it? In the terminal you can try

cd /Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/6F8AAE28-930C-467C-A257-7A123A3DBE88/search_notes
./search_notes title blah
sergeyzwezdin commented 3 years ago

No, there is no 6F8AAE28-930C-467C-A257-7A123A3DBE88 in Workflow Scropts.

sballin commented 3 years ago

Can you try deleting the workflow from Alfred, restart your computer, then install the workflow again?

sergeyzwezdin commented 3 years ago

I've removed the workflow, restarted OS, and installed the workflow again. The same result.

Logs:

/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D427525A-76FB-41FF-B309-AEC9247517D3: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/75961C70-E065-44E9-8668-583B9ED9EA04: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/C2694D8C-DFB9-4228-86EE-0D3387D0FBBE: line 1: search_notes/search_notes: No such file or directory

I also do not see anything in /Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/:

image

sballin commented 3 years ago

That's strange...

sergeyzwezdin commented 3 years ago
  1. 4.2.1 [1187]
  2. Yes
  3. No
  4. Yes, I do. They are located at /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows
sballin commented 3 years ago

Can you try replacing the contents of the "n" script filter with this and see if it works?

wfd=$alfred_preferences/workflows/$alfred_workflow_uid
"$wfd/search_notes/search_notes" title "$@" 2>> "$wfd/error_log.txt"
if [[ $? != 0 ]]; then
    osascript "$wfd/handle_error.scpt"
fi
sergeyzwezdin commented 3 years ago

No, it doesn't work. The same as before.

w/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D427525A-76FB-41FF-B309-AEC9247517D3: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/75961C70-E065-44E9-8668-583B9ED9EA04: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/C2694D8C-DFB9-4228-86EE-0D3387D0FBBE: line 1: search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/7427F7F6-D58A-4A07-B1F3-08AEDF3FC858: line 2: /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37/search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E00A9C33-2F75-478A-9CDA-7827894530CB: line 2: /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37/search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/6270E1D5-E7EF-4998-8E7D-9CFC77514130: line 2: /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37/search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/017F804A-BB74-4377-8DC8-350EA5AFDC5D: line 2: /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37/search_notes/search_notes: No such file or directory
/Users/sergey/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D31758D9-4FFB-4708-80A0-C325BA66DEA3: line 2: /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37/search_notes/search_notes: No such file or directory
sballin commented 3 years ago

Does the directory /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37 exist? What directory do you get taken to after right-clicking on the workflow and doing "Open in Finder"?

sergeyzwezdin commented 3 years ago

Does the directory /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37 exist?

Yes

What directory do you get taken to after right-clicking on the workflow and doing "Open in Finder"?

/Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37

sballin commented 3 years ago

And that has all the right files in it? If so, does searching work in the terminal?

cd /Users/sergey/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.E45AD698-9643-47FC-A365-0B75579A3C37/search_notes
./search_notes title blah

If that works, then to get it working in Alfred, I recommend going to System Preferences > Security & Privacy > Privacy and making sure that Alfred has

If you have verified all those and it's still not working, you could try some of these ideas: https://www.alfredapp.com/help/troubleshooting/preferences. I think creating a new user and trying it there might be the best one to try first.

sergeyzwezdin commented 3 years ago

And that has all the right files in it? If so, does searching work in the terminal?

image

sballin commented 3 years ago

So you have several files from the workflow, but you're missing the binary for some reason, and when Alfred doesn't find it in the folder where it's supposed to be, it looks in ~/Library/Caches/.... That's why the original error message you started this issue with shows that directory.

One of the options when first running an unsigned binary is "Move to Trash". Can you check if "search_notes" is anywhere in the trash? I verified that the binary is included in the workflow downloads on Packal and Github releases... If you cloned/downloaded the repo, the binary would not have been included, but you also wouldn't have been able to "allow" it to run either.

sballin commented 3 years ago

If you have Go installed you can try doing make inside the search_notes folder, and if it works you'll have a self-signed binary and the workflow should run.

sergeyzwezdin commented 3 years ago

Yeah, seems you're right. I might accidentally remove the bin file. So, these steps helped me to make it working:

  1. Remove the workflow.
  2. Download & install it again.
  3. Right click on workflow, find it in Finder.
  4. Find search_notes bin file. Right click on it and select "Open" and confirm that it should be run.
  5. Approve the app in the system.
  6. Close everything.

And now it's working.

Thank you for your help. Much appreciated! 👍