Page 2 of 2

Re: Show Notes

Posted: Tue Jun 09, 2009 11:29 am
by TerryHynes
Once you figure out the LUA scripting the HC.message box and autorun is a relatively simple way of achieving this. Another thought I had was to make the show notes a txt file but I'm not sure how to make that work as a macro. Great having time to think about these things finally - season is winding down here.

Re: Show Notes

Posted: Tue Jun 09, 2009 2:51 pm
by RobertBell
How about this? Save this code to a file called ShowStartupNotes.lua which is saved in your show file directory (or d:\horizon) It reads lines in a file called (specifically) d:\notes.txt

Code: Select all

function ShowStartupNotes()
io.input('d:\\notes.txt')
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 insert it and Robert's your mother's brother.

Re: Show Notes

Posted: Tue Jun 09, 2009 8:16 pm
by JohnGrimshaw
Does it REALLY need a change in anything other then the screen layout. SUGGESTION BELOW - THIS IS NOT CURRENTLY POSSIBLE...
I thought he meant something like this:
PaletteLabelSuggestion.gif
PaletteLabelSuggestion.gif (33.03 KiB) Viewed 958 times
Of course, MAYBE the "Label" in the cue list (say "Show Notes") could be the TITLE of a separate text file (Show Notes.txt), and if that file exists in the in the same folder as the show file, then the CONTENT of that file is shown in the window!

Re: Show Notes

Posted: Wed Jun 10, 2009 9:47 am
by TerryHynes
Thanks, Robert and John. I gave that script a go and it works fine. But it doesn't quite do what I'm looking for which is to pop up show notes unique to the show. It pops up the notes.txt file which would have all show notes in it. At this point, the HC.messagebox idea seems to work best for what I'm trying to achieve. And having figured out that all it takes in the script is to include double square brackets at the start and end of the text string makes this a pretty simple thing to do. If there was some way to place this on a softkey I think we'd be off to the races.

Re: Show Notes

Posted: Wed Jun 10, 2009 2:55 pm
by TaineGilliam
If Lua can know the name(and path) of the current show then it should be simple to modify Robert's script to look for showfile.txt instead of notes.txt

And as much as I like the elegance automatically determining the file name a fallback plan would be to make the macro call in the autorun pass a filename parameter.

Re: Show Notes

Posted: Wed Jun 10, 2009 4:17 pm
by RobertBell
try this:

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()')
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

Re: Show Notes

Posted: Wed Jun 10, 2009 4:26 pm
by TerryHynes
Unfortunately, I'm very new to Lua. So I'm not sure how to do what you are suggesting. But if someone can give me a couple of pointers, I'd be glad to give it a crack.

Oops. Should have read Robert's edit first. I'll try the new script.