You can still use your button returned:
text returned
record structure, but below in the script you then need to refer to the variable after text returned:
e.g. to titleString
and entryString
not to entryTitle
and entryText
.
In fact you don’t even need entryTitle
and entryText
because result
refers to the line above.
So something like this will work:
display dialog "Entry Title?" default answer ""
copy the result to {button returned:buttonPressed, text returned:titleString}
display dialog "Entry Text?" default answer ""
copy the result to {button returned:buttonPressed, text returned:entryString}
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 front document of application "Tinderbox 9"
set theContainer to find note in it with path thePath
set newNote to make new note at theContainer
tell newNote
if titleString is not missing value then set value of attribute "Name" to titleString
set value of attribute "Text" to entryString
set value of attribute "Prototype" to "p_Entry"
end tell
end tell
Those lines at the top of the script, which Script Debugger inserts by default, are rarely needed for basic scripts, especially the one referring to AppleScript version. When I use Script Debugger (I often don’t because Script Editor is lightweight and capable and also does JavaScript) I remove them because I don’t like clutter.
To be safe you might consider removing the apostrophe in the path though it doesn’t seem to be causing problems in your simple example.