Comments (7)
- macOS version?
- Alfred 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 is the output of the debug log when your error happens?
from alfred-search-notes-app.
-
MacOS: 10.15.6
-
Alfred: 4.3
-
Verified that
Alfred 4
has all of the permissions you mentioned
Output Log
[13:03:11.069] Search Notes[Script Filter] Script with argv 'golf' finished
[13:03:11.100] Search Notes[Script Filter] {
"items": [
{
"title": "Golfing",
"subtitle": "Notes",
"arg": "x-coredata://4E224CCE-DD8D-417D-B922-DD0E9F4F45EA/ICNote/p257?golf",
"quicklookurl": null
},
{
"title": "Golf Club Buying",
"subtitle": "Archive",
"arg": "x-coredata://4E224CCE-DD8D-417D-B922-DD0E9F4F45EA/ICNote/p156?golf",
"quicklookurl": null
}
]
}
[13:03:21.001] Search Notes[Script Filter] Processing complete
[13:03:21.002] Search Notes[Script Filter] Passing output 'x-coredata://4E224CCE-DD8D-417D-B922-DD0E9F4F45EA/ICNote/p257?golf' to Run NSAppleScript
[13:03:21.136] Search Notes[Run NSAppleScript] Processing complete
[13:03:21.149] Search Notes[Run NSAppleScript] Passing output '' to Run Script
from alfred-search-notes-app.
Thanks, that all seems normal... Are you viewing your notes in gallery mode? I made this workflow with list mode in mind, but can reproduce what you report when I switch to gallery.
from alfred-search-notes-app.
from alfred-search-notes-app.
You can try pasting the following to replace the script that has the description "Show note/folder or create note". I'm not a big fan of the delay required for it to work, and it doesn't work if the Notes in-app search is active.
on alfred_script(q)
tell application "Notes"
if q contains "/ICNote/p" then
activate
tell application "System Events" to key code 53 -- escape
-- 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
delay 0.3
tell application "System Events" to key code 76 -- return
else if q contains "/ICFolder/p" then
-- Show user requested folder
-- Get folder id which is first item in q
set folderID to text 1 thru ((offset of "?" in q)-1) of q
show folder id folderID in default account
show folder id folderID in default account
else
-- Create new note from user query
-- Move from any other folder/state to default "Notes" folder
show default folder in default account
show default folder in default account
tell application "System Events"
tell process "Notes"
click menu item 1 of menu 3 of menu bar 1 -- File, New Note
set clipboardOld to the clipboard
set the clipboard to q
click menu item 6 of menu 4 of menu bar 1 -- Edit, Paste
click menu item 1 of menu 5 of menu bar 1 -- Format, Title
key code {36, 36} -- press enter twice
delay 0.1
set the clipboard to clipboardOld
end tell
end tell
end if
end tell
end alfred_script
from alfred-search-notes-app.
Yeah, that isn't super bulletproof either -- it still doesn't work when the Notes app is already on a different note (first bullet point in the original issue description above).
Anyways, I appreciate you trying to help me out here -- I think I'll just switch to the list view for now for the path of least resistance (I may switch to something like markdown files or Bear at some point anyways).
~~~~~
As a side note, do you have any advice and where to find documentation on writing AppleScript? I'd love to be able to debug/write AppleScript and solve these problems for myself, but the whole thing is super daunting and confusing to me right now:
- The syntax is weird, and I haven't been able to find a resource for it
- Even when you look up an app's documentation in
Script Editor.app
, it's like, yeah here are your objects and APIs -- but it's still confusing on how I actually go about using them in a real script
from alfred-search-notes-app.
Applescript is unfortunately not very well documented. I mostly learned by googling, dictionaries, and looking at unrelated scripts people have written. There's a paid app called Script Debugger which helped me out when I was new to it. One very handy command is "get properties of blah". For UI scripting the Xcode Accessibility Inspector is very useful.
from alfred-search-notes-app.
Related Issues (20)
- Error: Couldn't posix_spawn: error 2 HOT 1
- can not create note HOT 1
- Unable to Search Notes in Alfred 5 HOT 3
- Search note doesn't work on MacOS Ventura HOT 4
- notes open in All iCloud folder in Mac OS Ventura HOT 2
- Create Note Error HOT 2
- A bug occurs when creating a note HOT 3
- Operation not permitted, Ventura 13.2.1 HOT 12
- Create Note Error HOT 1
- Shift previews not showing HOT 1
- Cannot look for a specific note if Notes app already open - ERROR line 2: /usr/bin/python2: No such file or directory HOT 1
- Can't search notes after reinstalling OS (21 November 2023) HOT 1
- Just wont work..... HOT 2
- Should it work under Sonoma? HOT 2
- Cursor not set when creating new note HOT 13
- panic: unable to open database file: operation not permitted HOT 2
- Hope to be able to directly copy the title + body text. HOT 2
- Text view from Alfred >= 5.5
- 打不开,不能使用 HOT 3
- Opening a note pauses for multiple seconds HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alfred-search-notes-app.