I suggest that you take the time to read the Scripting Guide. You will find it an efficient way to learn the structures and syntax of JSL.
Concerning your code:
Your If() statement syntax is incorrect. The form of an If() statement is:
If( condition1, result1, <condition2, result2>,...,<elseResult>)
The error statement you received points to Line 7, Colum 21, the "{"; Your If() function has a condition but no result.
If (Is Missing(fn))
It has a condition, but the second ")" closes out the statement. JMP then incounters the "{" and doesn't know what to do with it. I believe what you really want is:
If( Is Missing( fn ),
Exit(),
// Else Open the selected file
Open( fn )
);
I may also suggest that you may want to think long and hard about using
Exit()
it terminates JMP.
You may want to just stop the execution of the script, but leave the user with the JMP session remaining open. To do this, use the
Throw()
function.
Jim