Is there any way to get Hook working with Side Notes? SideNotes – Quick Notes on Screen Side – Apptorium
This would be a great addition indeed. I quickly looked into the scripting possibilities of the app, but I think the developer of SideNotes needs to add some more support to make this work.
I created a script for SideNotes, it seems to work ok. It’s an example of how to use it, because SideNotes uses folders to organise notes, you may want to change the default folder in the New Item script.
Also the Get Address script has a static title, I have not been able to retrieve the title of the current note, so this will need some work.
Get address script:
tell application “SideNotes”
set current_note to current note
set current_folder to current folder
set note_id to id of current_note
set note_title to title of current note
set note_url to “sidenotes://open/” & note_id
return “[” & note_title & “](” & note_url & “)”
end tell
New item script:
tell application “SideNotes”
set f to first folder where name is “Quick Notes”
set note_title to “$title”
set note_text to “# $title
$user_link”
set new_note to make new note in f with properties {text:note_text}
set note_url to “sidenotes:///open/” & id of new_note
set note_id to id of new_note
open with id note_id
end tell
note_url
thanks for sharing! For now users could use “Rename” in Title menu or linked items menu to rename.
I also contacted the developer and he has put the request on his todo list. He thinks it is already possible to make this work.
I have updated the script to the the link and title of the note. This needs the latest update from SideNotes to work because the developers fixed a bug with the Title property in AppleScript.
We’ve updated Integration to v. 191 for SideNotes. There’s a Hook to New
script in there.
There’s code in there to deal with the folder. As far as we know, Hook has no way to get the folder name from Side Notes itself, yet to create new notes in Side Notes, the Side Notes API requires knowing the folder name . So Hook prompts the user the first time. After that, the folder can be changed from the Terminal. We’ll add some documentation once the dust settles.
If anyone tries it could they please let us know how it works for them?
This is now in Hook 3.4, with thanks to @wernervp mentioned in release notes.
If anyone is connected to the SideNotes community or dev, it would be great to share this with them. The two apps are a natural fit.
I have notified the developer that SideNotes is now part of the Hook integration. He will also be working on a few updates to make sure integration is improved. Like for example using the integrated way of choosing a folder to put a new note in.
The developer is very responsive, which is great!
I have an updated new item script that asks for the folder to create a new note each time. I’m not sure which is preferable when choosing between the default Hook way or this way.
tell application “SideNotes”
set note_title to “$title”
set note_text to “# $title” & return & “$user_link”– get all folders in SideNotes
set folder_names to get name of every folder
set selected_folder_name to {choose from list folder_names}
if selected_folder_name is equal to false then
set f to first folder where name is “Quick Notes”
else
set f to first folder where name is selected_folder_nameend if
set new_note to make new note in f with properties {text:note_text}
set note_url to “sidenotes:///open/” & id of new_note
set note_id to id of new_note
open with id note_id
end tell
note_url