Script for adding a daily note

I’d like a script that would create a new row (item) with today’s date in, so I can log daily activities.

Does anyone know how to do this? I’ve looked at the automation info, but I’m no coder.

Any help would be appreciated!

Does the Edit > Insert TIme Stamp > Short Date (nor any of the other time stamp options) not suffice? They come with keyboard shortcuts. Short Date for example, has command-/ as its shortcut.

Of course, it is possible to create rows and set the topic to the date by script but what would be different from the above that would require a script?

Thanks for the help. Yes I was aware of that. I was hoping for a script that would create a new item with the date inserted.

You can insert the date using either the shell command or with applescript’s own date. Short date takes its format from the System Preferences > Language & Region > Dates. Between the two you can construct a date with whatever format serves your needs.

After that, the script makes a new row after the selected row at the same level and uses the date for its topic. The three lines after that are just an option to then make a child row and select it. Hope this helps.

– set shorDate to do shell script “date ‘+%Y-%m-%d’”
set shorDate to short date string of (current date)
–> “2021-08-11”

tell application "OmniOutliner"
	tell document 1
		
		set selRow to last selected row
		set nRow to make new row at after selRow with properties {topic:shorDate}
		
		set nChild to make new row at after nRow
		indent nChild
		select child 1 of nRow
	end tell
end tell