Opinions on ASOC

I would like an opinion (or three) on ASOC versus straight ObjC. What real benefit is there to ASOC versus just biting the bullet and digging into ObjC directly?

Thanks for any thoughts.

Jim

Hi,

for me the only benefit of ASOC is the ability to exchange data between applications
I’m writing everything else in Objective-C

For me, ASOC was a much easier step than ObjC. But it helped me considerably to understand how ObjC works, and made more a lot more confident in writing code in ObjC. My goal is to eventually do as Stefan said, communicate with other apps in ASOC and do the rest in ObjC.

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

For me I start a project in ObjC and add only the AppleScriptObjC framework to it when needed.

It depends on your programming background, and what you want to write, I think. DJ and Stefan were programming in Objective-C before ASObjC existed, I believe, so their approach makes sense to them. For people who have only programmed in AppleScript, at the very least, ASObjC provides a gentler introduction to the frameworks. You can build applications in ASObjC and, if you wish, transfer them to Objective-C progressively.

But if you want to write complex apps that don’t actually make use of AppleScript – that is, they don’t talk to other apps – then at some stage you are going to have to bite the bullet. ASObjC’s main purpose is putting interfaces on AS scripts.

You’re right about me

Right, first I started with AppleScript about 6 years ago learning it by scratch but learning it intensely like a foreign language.
Two years later I began learning Objective-C which took pretty long to even understand the basics.
Before ASObjC I used the third-party AppScript.framework and Apple’s ScriptingBridge.framework,
but I must admit that I preferred AppScript.

ASObjC is a great add-on to Cocoa apps as well as a stand-alone solution to write applications for advanced scripters.
Unfortunately the learning curve is much flatter than for the old-fashioned AppleScript Studio

Well, I’ve been Applescripting professionally (as in people actually pay me to do it) for 12+ years with shell, and a hodgepodge of javascript, Ruby, etc. as needed. It’s quick to do proof-of-concept quickly and robust enough to create entire workflows. (The general thrust of my work is workflow engineering for the printing / graphic arts industry or art creation utilities).
But sometimes I think I should learn what I call “big boy programming” and learn a higher level language. Living on Macs, ObjC is the obvious choice. There are some Illustrator plugins I would love to write (essentially ObjC versions of scripts I’ve written in most cases). I have looked at ASOC some but then I think I should just bypass the middleman and go right into ObjC.

I appreciate all the replies on this. Thanks to all.

Jim

Jim,
That is exactly what I had been doing, and for about the same amount of time too. Applescripts by themselves, and a lot of Applescript Studio, for my work and freelance. Then I wanted to expand my abilities, and started to try to learn Objective-C. I was failing pretty miserably. I graduated with an art degree and never took any serious programming classes at all. Applescript was self-taught but I clearly did not know the real rules of computer programming. Applescript is sort of an outlyer, but of course still super-effective at what it does do! I did not understand ObjC at all honestly, until I made the plunge and went to Big Nerd Ranch for the 7 day course. Wow it was such a jump start to understanding Obj-C so much better! I would have NEVER learned Obj-C without going there; it was just too big of a change from my Applescript programming mindset to overcome on my own. I was seriously getting depressed that I could not understand the 4th or 5th chapter of the Aaron Hillegas book, nothing was working. BNR really made me understand how things work.
After about 6 months back from BNR I was able to put together a fully Obj-C application, and it ran right. After that I worked on a really big application that even used outside frameworks and is one of the cornerstone apps at my office now. It’s got about 12 Obj-C classes, and only 1 ASOC class (the one that actually finally talks to InDesign after the rest of the data is handled).
At this point I clearly understand what ASOC is doing with regards to calling Obj-C methods, and can pass data back and forth. I’ve recently moved a bunch of calls from Applescript to Obj-C equivalents and gotten a 9000% percent speed gain (heh it was calling the Finder to get a file list, so inefficient).
Shane’s helped a lot too since ASOC was a big change. But knowing Obj-C definitely puts me a leg up on getting things done on my own without always asking for help- or feeling like I’m missing something fundamental.
ASOC does have it’s place as it’s the only way currently to talk to 3rd party apps. I’ve got apps that talk to InDesign and Photoshop and Finder, one that talks to Filemaker and an FTP application. Obj-C just can’t do that on it’s own, so you blend things when needed.
I would definitely recommend going Obj-C as much as you can.

Very cool, Super! I am actually an old stripper / platemaker / pressman / bindery worker / delivery guy / electronic prepress / artist / photographer / workflow designer / go-fer / etc. with 25 years (sheesh! I feel old now) in graphic arts. We should have coffee sometime! What’s the halfway point between mid-Michigan and Pennsylvania? LOL :stuck_out_tongue:

Thanks for the insight and encouragement. I wonder if I could talk my employer into sending me to the BNR. (They sent me on a 3-day course at RIT a few years back, which was awesome!) Hmm.:smiley:

Thanks again.

Jim

PS: Did you take the “Beginning Cocoa” class?

Remember that pro software on a mac like software from adobe, quark or microsoft is mostly written in C/C++. Objective-C is purely used for the presentation layer but the application (business layer) itself is written in C and C++ and so is the API.

I’m a little younger, so I started on all digital prepress/art… PowerMac 7100 was my first machine. In college they had a big camera for negs, but we never used it. Though the typography teacher was very traditional and made us draw/paint most of the projects by hand.

Yes at BNR it was the beginning class - the first 2 days were like “introduction to objective c” and then the next 5 were Cocoa (methods, frameworks, classes like NSArray or NSMutableDictionary etc etc). I did buy a Programming in C e-book and also Objective-C e-book and worked through them as best I could, so when I got there I didn’t come in totally cold to all the concepts. But man, it’s a lot in 7 days. It’s good to have a (simple) project to take along to try to work on.

While we’re all getting nostalgic…

My background is in publishing too: copy editing, photography, paste-up, typesetting, then DTP. I got into automation when everyone and his dog bought a Mac and decided they could do it, and I seemed to get stuck with the harder jobs. And I only got into Objective-C when I heard that ASObjC was coming.

But when I started in publishing, Linotypes were fed with molten lead…

Well my background is stormier. From BBC Basic machine (most beautiful machine with interpreter) when I was between 8 and 12 years. Then 4 years later I went to CNC milling machines (ISO programming). From there I went to building PLC’s for simple machinery. Then I went to embedded systems with programmable microcontrollers (C), which I still do today as hobby. Around '98 (Mac OS 9) I started developing for mac also in the advertisement business. For The mac I learned AppleScript with Carbon (first introduced with C++) and later I learned Objective-C. Even if I knew AppleScript before Objective-C I was already familiar with C and C++. Still I bought Shane’s book, printed it out, read it from cover to over.

Ok I’ll guess I’ll chime in too,

It has been wonderful to read everyone’s stake in ASOC so far.

As for me: I started with applescript maybe 7 years ago, copying Sal Soghoian’s dice roll game, then making some quark scripts for a graphic designer friends. I created two small apps at the time, Birthdaybook and Backuplist which have evolved ever since into full fledged apps. They were ok as pure Applescript Studio apps but crazy hacks and workarounds were needed to get them to work with the UI as expected.

Then ASOC happened and, thanks to Shane and Craig and everyone else, I got the hang of it pretty quickly. Couldn’t have done sheets and alerts without you Shane! I rewrote backupList+ entirely in ASOC but eventually needed some custom OBJ-c classes for the table views and drag and drop particulars. So I read Hillegass and Stephen Kochan but what really got me over the hump was Craig’s great OBJ-c tutorial. Now he’s turned me on to Ruby - help!

OBJ-c and cocoa were not too hard to get the hang of but I am just beginning to intuit object oriented thinking which feels like another universe. Now both apps have been rewritten in OBJ-c as they should be and it feels like I am no longer trying to do I.M. Pei with lincoln logs. Now there is Authorization API and C and pointers. Understanding pointers seems important to everything.

The more I get into OBJ-c now, the more I appreciate the strengths of ASOC. I think ASOC was a good move now in retrospect. Combining them is nifty. I am and artist and write code as a hobby. Sharpening my intuitional logic helps me let go more in painting perhaps.

Cheers and thanks, Rob :slight_smile:

Best. Thread. Ever. :smiley:

It’s nice to see such a varied group and hear your stories. I hope more people contribute - this is very cool stuff to read!

Cheers!
Jim

Well I guess I should through my two cents in too. I fell like an odd man out here since I have no background in publishing, graphic design or art of any kind. I’m a retired research chemist who has dabbled in programming since the early days of personal computers. From Basic on my Ohio Scientific computer in the late 70’s, to Forth (there’s an obscure language) on my Amiga 64 and then Visual Basic, Applescript, and now ASOC and Objective-C. I didn’t have a lot of experience with straight applescript or applescript studio, just dabbling as I said, and found them to be pretty tedious with their “this object of this box of this view of this window blah blah…” syntax. I generally use ASOC to write stand alone apps, not interacting with other apps – I also try to use the syntax that is most like Obj-C, so I consider ASOC to be like a somewhat hobbled dialect of Obj-C. Except for speed, I don’t see a lot of difference between ASOC and Objective-C as long as you are sticking to cocoa methods. Sure, there are a few methods you can’t use in ASOC, but the main thing lacking in ASOC is the ability to use straight C or C++ in your code. At the same time I started learning ASOC, I also read several books on objective-C (“Learn C on the Mac”, “Learn Objective-C on the Mac” and “Learn Cocoa on the Mac”) but didn’t really understand them well until I got experience with ASOC. So in that respect, I agree with some of the other comments that ASOC is a good way to ease into Objective-C. I’m now writing all or parts of most projects in objective-C and starting to incorporate more straight C in them as well. I’m gearing up to do some Arduino micro controller programming this winter to control things around my house – it uses a C like language, and I have the Serial Port X scripting addition to interface between ASOC and the Arduino. I have to admit that I have learned most of what I know trying to help people with their questions on this forum. There’s nothing like trying to teach something to get you to learn it well.

Ric

My background is also in graphic arts and design for 20 years now (therefore I haven’t played with Linos fed with lead, just the film ones :slight_smile: ), and I began using automation roughly 5 years ago with AppleScript Editor, of course. But I did study programming back in college, so the concepts of AS were fairly easy for me to understand. I studied TurboPascal and Pascal, as well as a bit of Assembly and Basic back in the days of the TRS-80 and C64.

But it’s been (and still is) quite a step to understand Obj-C, and I think I will need some lessons. I need to get live answers from a living, breathing person to progress it seems. :slight_smile:

But I mostly use my skills to create workflows or apps that improve manual workflows in advertising agencies and photographers, and it looks like there is tons of potential, but people do not grasp easily how much their lives would be improved with automation. I know mine has and people i’ve worked with or for. They just wouldn’t live without automation in their business lives.

I’m trying to push this business further, but it’s quite a pitch to make as it is difficult to explain the whole thing (advantages, improvements, etc) in one phrase, thus it’s hard to get them to schedule a demo… but I won’t stop, this is way too much fun!

With this said, I absolutely love ASOC. Now I understand a lot more about apps and their inner workings, and I feel confident that I will eventually master Obj-C and C/C++ in the future. It’s a difficult change to make, but once you got the feel of it, it’s just brilliant.

P.S.: I agree, best thread ever. :slight_smile:

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

I forgot to mention that - for me the ability to reference UI elements with one outlet changed everything. I could redesign the whole interface without changing any code. “This object of this box” stuff was insane.

And now using bindings in ASOC - brilliant! I just translated my big app from ASOC to OBJ-c and used core data to connect everything. I agree that ASOC was a great bridge and teacher for me to take on OBJ-c.

Rob