Using Hook out of the box with Curio one can only “hook” the full curio file, not specific Idea Spaces or even individual items.
On the other hand, there is a “Copy as Hyperlink” function that seems to get hyperlinks out of pretty much any object in Curio …
So I’ve put together items from a few sources (namely, a first scripting attempt from the the Curio forum and the “Drafts” script that comes with Hook, to get this:
set the clipboard to "" delay 0.1 tell application "System Events" to tell process "Curio" # get url click menu item "Hyperlink" of menu 1 of menu item "Copy As" of menu 1 of menu bar item "Edit" of menu bar 1 repeat 10 times try set myUrl to (the clipboard) if myUrl is not equal to "" then exit repeat end if end try delay 0.1 end repeat #get title set the clipboard to "" delay 0.1 try click menu item "Plain Text" of menu 1 of menu item "Copy As" of menu 1 of menu bar item "Edit" of menu bar 1 repeat 10 times try set myText to (the clipboard) if myText is not equal to "" then exit repeat end if end try delay 0.1 end repeat set n to count of paragraphs of myText if n is equal to 0 then set firstLine to name of front window else set firstLine to item 1 of paragraphs of myText set len to the length of firstLine if (len > 256) then set firstLine to text 1 thru 255 of firstLine end if end if end try return "[" & firstline & "](" & myUrl &")" end tell
This goes in the “Get Adress” script tab of a new Curio script-set that I created for the occasion.
It will output a hook for either:
- an Idea Space (in which case it gets the name from the name of the window, don’t know how to get anything more precise)
- any selected item IN an Idea Space (in which case the name, as per the Drafts script, is made up of the first 256 caracters of the content)
This is plainly a first attempt which will likely break (as I’m typing, I’m thinking “image with no text”) so please help if you have any ideas how to make this better.