Closed dreasan closed 1 year ago
Thank you for opening this issue!
π @tumispro @ron-myers @mathieudutour @StevenRCE0 you might want to have a look.
π‘ Tip: Once the issue is resolved, comment @raycastbot close this issue
to close it.
I think it's beyond Raycast Deeplink's purpose and seems like a detour. You may have a look at a discussion about Apple Notes URL schemes which is likely to be a better way to jump into some specific note.
Maybe it'd be good to have an action to copy the note's URL, or even just its ID? It's not very straightforward to get that info from the Notes app itself, so Raycast could help here without making a whole new URL scheme.
Yup, I agree with @SKaplanOfficial.
My initial request/idea was based on the false assumption that the Apple Notes URL scheme is not working (anymore), based on another discussion and a failed self-test.
However, the link you provided to the Apple forum discussion made clear that I used a wrong scheme, and it actually works. I could now successfully open a note by using:
notes://showNote?identifier=UUID
Therefore, I would amend the initial request toward the use of the Apple Notes URL scheme.
Meaning, the notes search result list (Search Notes command) should offer an Action to get the note UUID (Copy Note ID). Or, even better: The URL to open the note (Copy Note Link). The ID is probably perhaps already known to Raycast at that point (this needs to be clarified).
I believe it would be useful, especially since it opens the door to easy internal linking in notes without first sharing these via iCloud. And as @SKaplanOfficial mentioned, these IDs are not directly accessible anywhere else in Notes.
It makes sense and is quite easy to implement. I'm working on it!
Update: It's easy to get the UUID from notes inside sqlite database. However, some notes are only retrieved via AppleScript approach, which UUID is not accessible (the id property is not what we need). So, it won't work on those notes (basically deleted ones).
Here I would start a discussion:
mobilenotes://
instead of notes://
, we can make the URL work on iOS! I think that's also quite helpful. The script here uses AppleScript and sqlite3 to get the selected note URL with AppleScript -- shouldn't be too difficult to modify this to get the deeplink of any particular note. Still doesn't work for "On This Mac" notes, but it seems like those just don't support deeplinks at all.
I think an Action to copy the deeplink for the current note in the Search Notes list is the most reasonable thing, compared to a script command, etc.
As for what to do with deleted notes, I'll leave this to others as I have the questionable habit of never deleting notes.
The script here uses AppleScript and sqlite3 to get the selected note URL with AppleScript -- shouldn't be too difficult to modify this to get the deeplink of any particular note. Still doesn't work for "On This Mac" notes, but it seems like those just don't support deeplinks at all.
Yep, I've seen the post. However, isn't it a subset of what we've got in the database?
Yes, I believe so, however it provides a way to get the UUIDs for the deleted notes currently obtained via AppleScript. That's for if you want to support deeplinks for deleted notes too without changing the AppleScript fetching approach.
Yes, I believe so, however it provides a way to get the UUIDs for the deleted notes currently obtained via AppleScript. That's for if you want to support deeplinks for deleted notes too without changing the AppleScript fetching approach.
This query excludes the deleted on purpose. We can get the UUID of those without workaround.
- Only iCloud notes are shown in sqlite database(for example, "On My Mac" notes are absent in my tests), and we could get promising URLs for those ones.
I could find an On my Mac test note in the SQL lite database, specifically the ZICCLOUDSYNCINGOBJECT table.
My method:
notes://showNote?identifier=UUID
SELECT * FROM ZICCLOUDSYNCINGOBJECT WHERE ZIDENTIFIER = '<UUID>';
For me, this returned the note data for the On my Mac note. I am uncertain if it had to do with the fact that I created a fresh note. I normally do not use the local note account.
I think an Action to copy the deeplink for the current note in the Search Notes list is the most reasonable thing, compared to a script command, etc.
I would prefer an Action too.
- With
mobilenotes://
instead ofnotes://
, we can make the URL work on iOS! I think that's also quite helpful.
Yes, I think both make sense. If I had to choose, though, I would go for notes://
. Considering, Raycast is built for macOS. An option for mobile could help with use cases, where you reference the content mainly from your phone. These users would likely use mobilenotes://
most of the time. I think a second action won't produce much clutter (e.g., Copy Mobile Link), so it should probably be added.
A little sad that it's a different scheme for mobile vs. desktop. But okay, better than nothing.
It rocks! The best approach is to fetch everything through db and ditch AppleScript fetching entirely. It'll not only solve this URL problem but also increase performance significantly.
I'm busy recently so no tests were done. Feel free to contribute!
Just checked the recent changes. It's been working nicely so far. Great!
The only thing I noticed is that the β+C
shortcut is not working for me for the copying note URL action, whereas β§+β+C
for the mobile note URL is working. With β+C
the clipboard just stays empty.
Triggering the action via the menu does work, though.
@dreasan Yep, seeing that on my end too. I thought it was working before, but I'm probably remembering wrong. In any case, I'll fix that soon when I work on #5968 and #5619.
Extension
https://www.raycast.com/tumtum/apple-notes
Description
I really appreciate this extension, and use it quite a bit to get to my notes. One thing that would make it even better would be an action to be able to create a deep link
similar to the one that can already be created to search for notes:raycast://extensions/tumtum/apple-notes/index?fallbackText=RecipeThe link searches for all notes containing recipes. Nice!Additionally, I would now want to be able to link to notes directly and open them. Therefore, an idea:Could we create a new action in the note search results to immediately create a deep link to open the note in Notes?
raycast://extensions/tumtum/apple-notes/open?fallbackText=Best%20Chocolate%20Chip%20Cookie%20Recipenotes://showNote?identifier=UUID
EDIT: Changed to Apple notes URL scheme. See comments below, for an explanation, why the Raycast URL scheme was suggested at first.
Who will benefit from this feature?
All users who would want to link to notes from other applications (writing tools, task managers etc.).
Anything else?
No response