yeah i know, but the first line of the script is commented out, its “Flash Games.applescript” would that be causing the problem. should i copy and paste the entire script here?
on clicked theObject
set theSelectedRow to the selected data row of table view 1 of scroll view 1 of window "index"
set theGame to contents of data cell 1 of theSelectedRow
set this_app to path to me as string
set this_app to POSIX path of result
This is not entirely true. Comments are ignored during compile, but line numbering is preserved when reporting build errors. (As the compiler walks your source, it ignores comments, but if the comment is malformed, the compiler will assume it’s looking at a token of some sort.)
You can test this with the following two (differently broken) pieces of code:
- test comment
on clicked theObject
end clicked
The above will throw an error on line 1, according to the compiler.
-- test comment
- on clicked theObject
end clicked
While this second example will error on line 3. As you can see, the compiler takes into account the comment and the whitespace when reporting which line it failed on. (Otherwise, it would be ridiculously difficult to debug compile-time errors.)
fiftyfour: Please post the very first line of the script that does not build properly.
You really need to me more thorough, clear, and specific in your posts. Was the line:
flash games.applescript
or
-- flash games.applescript
Or something else?
Good to see you don’t care about figuring out what you did wrong! What are you going to do when you run into this problem in the future, with a larger, more complex project where this “solution” is a pain in the ass? What about future scripters who may run into your problem and decide to search the Web for solutions, only to find this derelict thread where you “don’t really care”?
Please don’t start threads you aren’t interested in seeing through. It doesn’t help anyone–you, the people who take their time to help you, or others who search the forums.
Obviously, that line looks okay. (Barring anything that doesn’t translate well through the forums, like null characters sitting somewhere they shouldn’t.) If you remove the line entirely, does it compile?
I’ve had a similar issue with xcode. Also when copy and pasting all in a new project it worked fine. I guess there is a little but obnoxious bug somewhere…
I’ve run into a problem similar to this before, and one cause that was difficult to track down was that there were hidden characters in the code that had come from cut & pasted text from the web. I’m not sure why you might have cut&pasted a comment into your project, but perhaps there was some other text in there and when you deleted it there were some hidden characters in there that you missed. One website I frequent for sample code is a japanese site, and if I’m not careful about only copying certain text, I sometimes get characters in there that are using some japanese encoding. These hidden characters throw wacky errors and since you can’t see the characters it’s not easy to know how or where to delete them from. Usually if I COMPLETELY DELETE and manually rewrite every line anywhere near the problem, it solves the problem. If cut & pasting the same exact code into a different project worked for you, this is probably not the cause of your problem, though.
Get info on the script that is throwing the build error.
Change its encoding from UTF-16 to UTF-8.
When prompted to Reinterpret, Cancel, or Convert the text of the script, click Convert.
Clean your project and click build.
And now we have one cause of this problem nailed down (the OSA compiler probably can’t interpret UTF-16 characters correctly), as well as its resolution. The question is . . . how did the encoding get set to UTF-16 in the first place? I’m not certain this is normal behaviour, but I can’t say that it isn’t, either.