My code is:
Code: Select all
var macro;
for (var i=0;i<=10;i++)
{
macro = "CODE:";
macro += "VERSION BUILD=8820413 RECORDER=FX" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "TAB T=1" + "\n";
macro += "URL GOTO=http://www.website.com/canon/[seriesname]/videos" + "\n";
macro += "FRAME F={{fnum}}" + "\n";
macro += "TAG POS=1 TYPE=SPAN ATTR=TXT:1<SP>Video" + "\n";
macro += "TAG POS=1 TYPE=SPAN ATTR=TXT:(1<SP>of<SP>5) EXTRACT=TXT" + "\n";
macro += "TAG POS=1 TYPE=SPAN ATTR=TXT:(1<SP>of<SP>10) EXTRACT=TXT" + "\n";
macro += "TAG POS=1 TYPE=DIV ATTR=TXT:<SP>We<SP>are<SP>all<SP>out<SP>of<SP>offers.<SP>Please<SP>check<SP>back<SP>later<SP>for<SP>more. EXTRACT=TXT" + "\n";
macro += "TAB T=2" + "\n";
macro += "TAG POS=1 TYPE=DIV ATTR=TXT:Step<SP>5 EXTRACT=TXT" + "\n";
macro += "TAG POS=1 TYPE=DIV ATTR=TXT:Step<SP>10 EXTRACT=TXT" + "\n";
iimPlay(macro);
var frame = 0;
while (true)
{
iimSet("fnum", frame);
if (iimPlay("macro") == 1)
{
break;
}
frame++;
}
if (iimGetLastExtract(1)== "(1 of 5)") {
iimPlay('5.iim');
} else if (iimGetLastExtract(2) == "(1 of 10)") {
iimPlay('10.iim');
} else if (iimGetLastExtract(4)== "Step 5" && iimGetLastExtract(5) != "Step 10") {
iimPlay('5e.iim');
} else if (iimGetLastExtract(4) == "Step 5" && iimGetLastExtract(5) == "Step 10") {
iimPlay('10e.iim');
} else if (iimGetLastExtract(3) == "We are all out of offers. Please check back later for more.") {
iimPlay('none.iim');
} else {
iimPlay('single.iim');
}
}