[Lua] Show notes at startup

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

[Lua] Show notes at startup

Post by RobertBell » Tue Jun 09, 2009 3:06 pm

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')
io.input(filename)
local count = 0
local notes = {}
while true do
local line = io.read()
  if line == nil then
	break
  end
  count = count + 1
  notes[count] = line
end
if count > 0 then
local notetext = ''
for i, n in ipairs(notes) do
   notetext = notetext .. i .. ' - ' .. n .. '\n'
end
HC.MessageBox(notetext)
end
end
HC.AddUserFunctionDescription('ShowStartupNotes()')
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
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply