Hi,
Let me first explain where I want to go, what I want to (try) to do:
For many years I have used and still use Veritrope - Justin Lancy’s scripts to save browser tags to DEVONthink. Link to Veritrope code library.
There’s a ton of smallish scripts to add stuff to Evernote, Devonthink, Omnifocus just to name a couple. Probably many Tinderboxers are familiar with them. Most of the scripts I use are called by Alfred.app in combination with a keyboard shortcut. (similar of what Dominique Renauld is doing, mentioned here on the forum as well)
Now to my question:
I searched the forum on how to create a note using AppleScript, and of course plenty of answers came up. Among the ones that were most promising, I chose @dmrogers example Captain’s Log as a starting point. (link)
I do have a copy of Script Debugger, but have not used this tool very much.
The AppleScript errors out on the line that says:
set newNote to make new note at theContainer
What needs to be changed to the code in order to make a new note?
What am I missing / why does the code fail?
At the bottom of the Script Debugger’s window, it says: Stopped (Error: Can’t make missing value into type location specifier.)
For completenes sake, I add my full code below:
tell application "Tinderbox 10"
set this_moment to (the current date)
set nmMonth to (month of this_moment) as string
set nmYear to (year of this_moment) as string
set thePath to "Captain's Log/" & nmYear & "/" & nmMonth & " " & nmYear & "/" & date string of this_moment
tell document "Captain's Log.tbx" -- suffix .tbx required on my machine
-- this is how to specify a note down in the hierarchy:
set theContainer to find note in it with path thePath
set newNote to make new note at theContainer
tell newNote
if entryTitle is not missing value then set value of attribute "Name" to entryTitle
set value of attribute "Text" to entryText
set value of attribute "Prototype" to "p_Entry"
end tell
end tell
end tell
As always: Thanks for helping out!