Ah, thanks agraham, the help file, your last comment and some trial and error seem to have got it all working now. Suddenly it all seems quite obvious.
my code for anyone else with the problem is:
Code:
(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
Which seems to work fine.
EDIT: First version only worked when given an argument to check.

. New code checks if the argument is there...