Installing Xcode 4

Can i have Xcode 3 and Xcode 4 installed same time and develop some AppleScripts in Xcode 3 (mostly in AppleScript Editor 2.3) and some AppleScripts in Xcode 4?

As I understand it, Xcode 4 is still under non-disclosure and can’t be discussed publicly.

Now that it has been released: yes, you can have both installed, although by default Xcode 4 will overwrite Xcode 3.

But if your interest is in writing AppleScriptObjC apps, I wouldn’t bother. For that, it’s severely lacking at this stage.

Shane, could you expand upon this please --for those of us who haven’t tried the pre-release version of Xcode 4, it would be nice to know what its strengths and weaknesses are.

Ric

I haven’t spent a lot of time with it, but the biggest problem is that it doesn’t use an AppleScript Editor. So you click on a .applescript file, and it shows it in a normal text window like Objective-C, with its own, rather sad, attempt at parsing. You end up with things like “missing text” appearing with the two words in different colors.

And no editor means no compile command. The only way you fond out there’s a problem is by running. No adding of AS classes, either – you have to do it all manually.

There are some good things about Xcode 4, but most of them bypass AppleScriptOjC users.

That’s disappointing. I hope they’ll get around to improving AppleScriptObjC support in the next point upgrade.

Well to be honest as an all-round programmer I think it has been approved (applescript coloring). I don’t think it’s really a bad or good thing in general, some scripters would prefer it while others don’t. A big improvement is source control (i use a lot) and code predictor/completion in general has improved a lot and also a little for ASOC. Another improvement is of course the IB and Xcode merge. But it wasn’t a new feature it was just waiting when Apple made this also happen because all other IDE’s has this already built in. The greatest improvement for me is workspace, this is also for a long time in visual studio, but workspace is a solution and contains several projects. For example you can now have multiple applications in one workspace with ‘shared’ code more easily.

Well to be honest as an all-round programmer I think it has been approved (applescript coloring).

Do you mean improved? Are you happy with multi-word terms like “current application” appearing with one word in one color and the other in another? Misleading syntax coloring seems worse than no coloring at all to me.

But the lack of the ability to compile is the worst thing, IMO.

Well Shane I agree with you about the missing value part but current application is in almost any case used as “current application’s” followed by an object so current and application get the same (black) color. I also never use ‘of current application’ syntax (therefore I didn’t see it) and also try to avoid the current application call as much as possible.

Well what I mean with all-round is that Xcode uses for C, C++, Objective-C and PHP for example all the same coloring scheme. I think the coloring scheme of applescript was odd since the beginning of OS X (In os 9 and older it was black & white). I posted also that a coloring scheme can be something that is for one programmer really great and for others it isn’t. It’s the same of which car do you prefer. I think the new coloring scheme is great and looks good for me and again the missing value part is the only flaw I discovered yet. But if there is only one flaw I don’t bother.

Keep looking :wink: There are plenty of inconsistencies.

I understand what you are saying about the coloring scheme. But they would have done better to get the old styled text and then transform it – that way the syntax parsing would be correct. At the moment the parsing is inconsistent, and that’s less than helpful.

Two improvements for me:

In Xcode 3, after compiling, I would end up with condensed spacing and sometimes with words on top of each other until I went to edit again. No problems in Xcode 4.

If accidentally mis-type an applescript variable in Xcode 3, like MyTable, but you meant, myTable, you send up using pipes |myTable|. In Xcode 4, this is easier to fix.

Xcode4 does make you indent and end things properly. It doesn’t autofill stuff much.

I do wish there was a way to style the text like Xcode 3. That would be an improvement.

p.s.

Do like having IB built in. Less windows. Better for me. Did not take long to adapt to it from Xcode3.

The quick search documenation works for me most of the time.

This should be of interest to Xcode 4 and Script Debugger users:
http://blog.latenightsw.com/?p=491.

Basically, it means you can use SD as an external editor for Xcode 4 (recent
versions, at least). You need to set SD as your default AS editor, and then
choose Open with External Editor from the Xcode Project navigator contextual
menu. Edit in SD and hit save, and the code also updates in Xcode.

Earlier versions (and AppleScript Editor) won’t work because they won’t
compile code referring to classes by name.