--[[
VPLanguage = lua
VPScriptMenuTitle = New Page With Current Date
VPShortcutKey = j
VPShortcutMask = command control
VPEndConfig
--]]

-- check out http://www.lua.org/pil/22.1.html for more formatting options.

textView = windowController:textView()
document = windowController:document()

pageName = os.date("%Y.%m.%d", os.time())

document:createNewPageWithName(pageName)

if textView ~= nil then
    textView:insertText(pageName)
else
    document:openPageWithTitle(pageName)
end