Page 1 of 1

[Lua] Show notes at startup

Posted: Tue Jun 09, 2009 3:06 pm
by RobertBell
Taken from an idea from here this code reads a text file on the hardrive using the same file name as the show and displays a dialogue box with notes on startup. Useful for conveying ideas between multiple operators.
Copy this code to a file called ShowStartupNotes.lua and save in your show file directory (or d:\horizon)

Code: Select all

function ShowStartupNotes()
local filename = HC.GetProperty('system','showfilepath')
filename = string.gsub(filename,'.spf','.txt')
local count = 0
local notes = {}
while true do
local line =
  if line == nil then
  count = count + 1
  notes[count] = line
if count > 0 then
local notetext = ''
for i, n in ipairs(notes) do
   notetext = notetext .. i .. ' - ' .. n .. '\n'
Then from any show file, make an Autorun cue list with a macro on it. When you get into the script editor, there will be a hint to ShowStartupNotes(). Just make sure you have a file in the same directory as the *.spf file name using the *.txt extention. i.e., bob.spf show file has notes called bob.txt in the same directory