Xcode build error: Expected end of line but found “"”. (-2741)

I’m converting an AppleScript Studio project to AppleScriptObjC.

It has a very long .applescript file which I finally adapted to AppleScriptObjC.

It compiles in AppleScript Editor with no problems.

However, when I try to build the project in Xcode I get this error:

Expected end of line but found “”". (-2741)

It stumbles upon the first quote here:


script MyScript
	property parent : class "NSObject"

If I remove the second line, it stumbles upon the next “class” property:


property NSApplication : class "NSApplication"

Once again, all compiles in AppleScript Editor.

I did any possible search on this situation - couldn’t find any solutions.

Any help will be appreciated!

Thanks,
Leo

What version of Xcode?

Xcode 4.6.1

Also, forgot to mention that I replaced the old AppleScript Studio contents of main.m with


#import <Cocoa/Cocoa.h>
#import <AppleScriptObjC/AppleScriptObjC.h>

int main(int argc, char *argv[])
{
    [[NSBundle mainBundle] loadAppleScriptObjectiveCScripts];
    return NSApplicationMain(argc, (const char **)argv);
}

which I just took from a new AppleScriptObjC project created by Xcode… Seems like a logical thing to do but I didn’t consult any documentation to confirm it.

Thanks,
Leo

I’d be inclined to upgrade to 4.6.3, but I don’t think that’s the problem. And yes, that should be fine for main.m – I presume you also added AppleScriptObjC.framework to the project.

I’m a bit puzzled. I’d be very wary of upgrading a project like that – I think you’re better of building a new version and copying stuff across – but that doesn’t help find the problem. Are the .applescript files UTF8?

Also, you mention compiling the scripts in AppleScript Editor. Did you save after that? For a while ASE would still save as MacRoman, which could confuse Xcode – it only accepts UTF8 for AppleScript. What version of ASE and OS?

Found it!

It was the “Compile AppleScript Files” build phase that remained from AppleScript Studio.

Thanks for all the advice Shane - eventually it’s your suggestion to move everything to a new project that made me compare the build phases and find it.

I plan to get your Explorer soon…

Thanks,
Leo