Property Error when using foundation framework

If I have these two lines


use framework "Foundation"
set osversion to system version of (system info)

I get the error “Expected end of line, etc but found property” but if I comment out the use framework line then its ok. Any ideas on how I get rid of this error?

Thanks in advance, Scott

Hi Scott,

This seems to work:

use framework "Foundation"
use scripting additions

set osversion to system version of (system info)

gl,
kel

System info doesn’t belong to Foundation but to the scripting addition named “Standard Additions”.

Yvan KOENIG (VALLAURIS, France) jeudi 31 juillet 2014 18:28:59

Thanks for the explanation. I guess without having any “use” statements it must have automatically included scripting additions.

I think that’s it also. When you add the use foundation, I think the AScript Editor thinks that you’re writing an AppleScript Objective C program for the applet or for the library. Just guessing.

gl,
kel

Correct. Once you include any use statement, everything other than built-in commands must be either targeted (with a tell/using terms from statement or similar) or covered by its own use statement.