Simple question


what’s ne keyboard key or command menu to check syntax in Xcode 4.x?
I would like that, is something is wrong, Xcode show me the line with error.


There is no Xcode simple equivalent of Script Editor’s compile, however when you build the app the scripts are checked. If the build fails due to an incorrect syntax it will give an AS style build error “OSACompile Error” which contains a line number too. For example:

HelpAndContactController.applescript:113: error: Expected “end” or “on” but found “end tell”. (-2741)
Command /usr/bin/osacompile failed with exit code 1

Error is (Expected “end” or “on” but found “end tell”), it THINKS it happened on line 113 of the file “HelpAndContactController.applescript”.

Note I say THINKS because the AS compiler can often get the line wrong, especially when brackets or are missing. Like in this case line 113 contains the end tell to a counterpart tell, I misspelled the beginning of another tell within it so it didn’t know why there was an extra end tell, it thought the misspelling was a valid command because it was of the form

tegll (make new...

so note they are more clues than fact.