(In app start)
If ArrayLen(Args()) = 1 Then 'Will catch if a single argument is given. (Like a file name)
file = args(0)
If SubString(file,StrLength(file) - 3, 3) <> "jgf" Then 'Checks the file extension to see if its the right type.
Msgbox(File & " is not a valid file","Error")
Return
End If
opendialog1.File = file
LoadFile