Go to documentation repository
...
Enter the following in the Script field:
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "MACRO" && Event.SourceId == "1" &&
Event.Action == "RUN")
{
var ;
for(i=1; i<=4; i=i+1)
{
SetObjectParam("CAM",i,"hot_rec_time","10");
}
DebugLogString ("Hello world");
} |
The error message says that there is no identifier in the second line of variable declaration operator (var). That means no variable has been declared. This is a critical error in JScript, thus the script has not been executed.
Change the text of the script (see the “var i;” line).
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "MACRO" && Event.SourceId &&
Event.Action == "RUN")
{
var i;
for(i=1; i<=4; i=i+1)
{
SetObjectParam("CAM",i,"hot_rec_time","10");
}
DebugLogString ("Hello world");
} |
Check the accuracy of the script result. The Hot recording field in the Camera 1 to Camera 4 object settings panels should read “10”.
| Info | ||
|---|---|---|
| ||
The Hot recording field in the Camera settings panel is empty by default |
...