Re: NSApplescript weirdness
Re: NSApplescript weirdness
- Subject: Re: NSApplescript weirdness
- From: "Chris Backas" <email@hidden>
- Date: Sun, 10 Aug 2003 14:36:39 -0400 (EDT)
- Priority: Normal
>
>I'm experimenting a bit with the NSAppleScript class in
>
>Java, and I'm not getting very far. For whatever reason,
>
>the bridged version only allows construction from a String
>
>and not a compiled file path; I can deal with that, but
>
>I'm getting errors I don't understand trying to do even
>
>that much. When I try to .compile() the NSAppleScript
>
>instance, I get this back from the errorInfo dictionary:
>
>
>
>Error Message: Expected end of line, etc. but found unknown token.
>
>Error Code: -2741
>
>Error Description: Expected end of line, etc. but found unknown token.
>
>Error Range: {785, 1}
>
>
>
>The Applescript I'm trying is very simple, it runs just
>
>fine in Script Editor, and if I run it directly out of the
>
>text file from the command line it's fine as well. IE:
>
>
>
>osascript <My Script File>
>
>
>
>So, what's the deal? Is NSAppleScript completely broken?
>
>
No; I use it all the time (though not from Java). I suggest you think about the formatting of the string - for example, whether you may have forgotten to escape quotes (and backslashes). m.
I'm just reading in the raw contents of a text file created by copy/paste from a working binary copy of the same script. What I did that ended up working was using NSStringReference(java.net.URL).string() Why that
makes it work is beyond me, but I'm not complaining either =)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.