views:

190

answers:

1

Here's a script where lots of people say it's good:

http://allancraig.net/blog/?p=381

But I can't get it to work. What are the steps I have to do with the Xcode script editor, to run that script?

I have pasted it in "Script Editor.app", that Script Editor app from Mac OSx and saved it as clang.scpt.

Then, I went to Xcode and opened the Script Editor, created a new script with this settings:

Input = Selection (??) Directory = Selection (??)

Script Code:

#!/bin/sh
/Applications/Clang\ Static\ Analyzer/clang.scpt

Must it look like this?? My script is my Applications directory, and there, in a subdir called "Clang Static Analyzer". I just dropped clang.scpt on terminal to get the path.

Output = Insert after Selection (??)

Errors = Merge with script output (??)

Then, when I execute that script, this happens:

/var/folders/QD/QDPLhhOJyvoyecmZQk+++TI/-Tmp-/965ABD-3FF7-46A3-8131-AA9CD1553D26-92280-0401D25AC142AE31: line 2: /Applications/Clang Static Analyzer/clang.scpt: Permission denied

Any idea?

A: 

From that page, you are missing the

/usr/bin/osascript

before the name of your script. The line above should read

/usr/bin/osascript /Applications/Clang\ Static\ Analyzer/clang.scpt

Honestly, I'd recommend installing Snow Leopard and Xcode 3.2. The Clang Static Analyzer is beatifully integrated with Xcode now, to the point where you can have the analyzer run with every build pass and have it illustrate where problems are, inline with your code. If you're worried about developing for iPhone OS 2.x, that is possible in Xcode 3.2.

Brad Larson
Sounds good! I'm going to get Snow Leopard with Xcode 3.2. Maybe the built-in voice for reading manuals is also enhanced in Snow Leopard?
HelloMoon