"Hook to New" Script Advice from Agenda Users

Greetings users. I’m trying to modify my “Hook to New” Agenda script. All items (notes) entered into Agenda have to be placed into a project. Currently, due to the lack of a scriptable designated location, new notes are added to the open Agenda project of the moment. What I am trying to do is modify the script to add all HtN items to a specific project (an Inbox). Projects and notes are indexed items in the x-callback API app. I think I can do it with the Inbox scripted title and identifier but not sure how it would be formatted. Any suggestions would be appreciated.

You can try changing the line in New Script of Agenda:

set newNoteURL to "agenda://x-callback-url/create-note?title=" & encodedTitle & "&text=[" & encodedTitle & "](" & encodedLink & ")"

to

set newNoteURL to "agenda://x-callback-url/create-note?title=" & encodedTitle & "&text=[" & encodedTitle & "](" & encodedLink & ")" & "&identifier=myProjectIdentifier"

And change myProjectIdentifier to your target project identifier and see if it does what you want.

If the change causes any problem, you can always reset to its original script by clicking “Reset to default” button.

Thank you

1 Like

@bchend , Thank you. Adding the new line and adding the project identifier works except with the HtN identifier hard coded, moving or altering the project nixes it.

@bchend , Thanks again. This has been an undelt with thorn for a while. I’ve not been seeing the tree for the forest. As soon as I saw what you sent in context, I saw it. As for the fixed identifier, I followed @LucB 's suggestion to use terminal and am doing a crash study of system variables. This cranked up the volume a bit for a lot of things. :smiley:

1 Like