-- Notecase Pro sample script (requires Notecase Pro >= 3.1.3)
--
-- Description:
--  register this script to be opened on "post loading document" event trigger.
--  It will log into the file a list of all files that the user opened.
--
-- This script's author, Miroslav Rajcic, hereby waives all copyright 
-- and related or neighboring rights to this script, pursuant to the
-- Creative Commons CC0 Universal relinquishment of rights found at
-- http://creativecommons.org/publicdomain/zero/1.0/

-- make sure app version supports necessary scriptable program commands
nMaj, nMin, nRev = Nc_Config_GetAppVersion()
if (nMaj < 3 or (nMaj == 3 and nMin < 1) or (nMaj == 3 and nMin == 1 and nRev < 3)) then
	Nc_GUI_MessageBox("ERROR: Script requires NcPro version >= 3.1.3")
	return
end

logfile = "C:\\ncpro_log.txt"
outfile = io.open(logfile,"a")

outfile:write("Document opened:" .. Nc_Doc_GetPath(Nc_Doc_ID_GetCur()) .. "\n")
outfile:close()