-- Notecase Pro sample script (requires Notecase Pro >= 3.2.3) -- -- Description: -- Script gets and writes to the clipboard the current note's recursive index number -- -- This script's author, Paul E. Merrell, 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 == 2 and nRev < 3)) then Nc_GUI_MessageBox("ERROR: Script requires NcPro version >= 3.2.3") return end -- store IDs of current document and note as variables nDocID and strNoteID nDocID = Nc_Doc_ID_GetCur() strNoteID = Nc_Note_ID_GetCur(nDocID) -- get and store current note's recursive idx as variable nNoteRecursiveIdx nNoteRecursiveIdx = Nc_Note_RecursiveIdx_GetByID(nDocID, strNoteID) -- write the current note's recursive Idx to the plain text clipboard Nc_Env_Clipboard_Set(nNoteRecursiveIdx, 0) -- tell the user what happened Nc_GUI_MessageBox("This note's recursive index number is " .. nNoteRecursiveIdx .. ".\nThat number has been written to the clipboard.")