Applescript Studio Reference/Book

Greetings, everyone.

As I mentioned in another post, I’ve been tossing around the idea of writing some sort of ASStudio reference. There is an obvious gap in the documentation and resources available to ASS developers, a void I’ve been trying to help fill for more than two years through my participation in this community. I’ve been trying to find a way to make a more formal commitment to making this contribution, and creating a reference of this kind seems the most logical way. It would be a significant endeavor, with a comprehensive discussion of topics specific to development in ASStudio. Drawing on my experiences with applescript, and also with other languages I’ve worked with, I’d like to set down a broad and clear vision of my understanding of ASStudio and of programming in a more general sense as it applies to ASS development. I’d like to ramble a bit about style, give clear examples of common triumphs and pitfalls, discuss thoroughly every object and protocol available in vanilla ASStudio, and provide a grand palette of example code and projects upon which others can build their own ASStudio foundation. I essentially intend to rewrite everything that apple has provided in their ASS doc’s, adding in more content and more examples wherever apple has dropped the ball.

I have heard many requests for references to books or other resources that cover ASStudio development and conceptual topics. WIth few exceptions, there simply are no good learning tools for applescript studio development. While forums and random tutorials are certainly valuable resources, they typically lack the focus and structure that I believe many people are searching for. I think it’s time for someone… perhaps me… to create that resource.

I am very interested in knowing what people think about this. I would like to know what you, my peers, would like to see in this resource. Below are some specific questions I’d like your input on. There’s no need to clutter up the forum with this discussion, so please feel free to contact me via email if you have any input. I’m a big fan of outside input… especially the long-winded kind… so feel free to be as vague or as specific as you’d like. If you have an answer that doesn’t address a question I’ve asked below, please feel free to send it to me anyways. I’m fishing for interest and input, and I value any contributions you’re willing to take the time to make.

  1. How would you like to see it formatted? I’m leaning toward an “online reference” approach. Perhaps an html bundle that would extend/replace apple’s docs. Or, maybe an Xcode plugin or custom “Help Viewer”-style app that contained a local html reference with extended internet-supported resources. I realize that many people still read those “book” thingies, but I’m not particularly a fan of them and I think that writing an actual book is a little out of context. My emphasis will be on learning by example through sample code and sample projects. Only after you can open something up to see for yourself how it works, or to take something apart and then put it back together yourself, can you really learn how all of it’s components interact. A paper book just does not feel appropriate considering this belief. I feel that working in a digital medium would allow me to explore every angle and follow every path I might encounter, a limitation that can not be overcome in a paper book. Using an internet-based approach would allow me to publish online and to distribute local copies via the web. It would also allow me to easily integrate examples and scripts into my reference that could be accessed by simply clicking links to activate scripts, access files, link to other sources, or launch applications to handle advanced features of the reference.

  2. There are some topics out there that simply make no sense at all until you live, eat, and breath them for a long time. I can think of a handful of topics that need extensive documentation and examples to explain, which currently have little or no existing documentation. There are topics which continue to come up time and again in forums and in private discussions that beg to be written down in a comprehensive, easily-located manner. I have begun making a list of these things as I see them, but my experience has left me blind to what is and what isn’t difficult to learn in ASStudio. I learned much of what I know about applescript at least a couple years ago, and have forgotten how difficult learning some of it truly was. I’d like to gather a list of all of the topics that both new and experienced scripters believe deserve discussion. If you feel that a certain topic warrants expanded attention, please let me know what it is so I can add it to my list of important subjects.

  3. What actually works, or is of value to ASStudio developers… in terms of existing resources? Are there any resources that you’ve found indispensable, that exemplify what it is that I should be trying to achieve. My intention is not to rip off someone else’s good idea’s and claim them for my own, but rather to develop a model of what features, designs, and approaches are most influential to the most people. This question is broad-ranging, and can be interpreted as loosely as you’d care to interpret it. Having been a web designer for many years, I got into the habit of expecting clients to tell me what they wanted up front. When they… as non-designers… never did tell me what they wanted, I got into the habit of just making it all up for them. While I’d like to think that I’m an amazing designer and that they never complained about my designs because they were perfect :rolleyes:, I realize that it’s more likely that they were just indifferent because their passion for the site was disproportionate to my own commitment to the quality of my work. While it’s nice to have flexibility in what I create, it’s often an equal pleasure to have clear project guidelines. I’d like to know what works for you and what doesn’t. Are there certain design layout’s, certain features, certain accessibility issues or content requirements that a project of this scope should incorporate? What should I focus on that will be of most use and interest to you as a potential user? Please feel free to tell me exactly how you think that things should work… or, what you definitely don’t want to see it do. Once I decide whether to start down the path, I want to know from the beginning exactly where I’m going to end up at the end of the journey. I, of course, have a strong idea of what this thing will do and how it will look, but this is your chance to perhaps steer me in a direction I would not otherwise have gone.

  4. What else can you say? I’m open to anything at this point. Even if you just want to tell me you think I’m a jerk and never want to see anything I write, please feel free to take the time to share your insights. I’ve already got all the answers I need for my own development needs, or I know where to look to find them, so I’m certainly not writing this for my own benefit. It’s for you, and you, and YOU! If you want to have any say in how your new resource turns out, this may be one of the only times that I’ll come begging for your advice.

Anyone can reach me via the email link in my user info, or directly at jobu10000(a)yahoo.com.

Looking forward to your input,
j

jobu:

I have been AppleScripting for nearly 2 years, and have only recently jumped into Xcode and AS Studio. Although definitely cool, it is a bit overwhelming, and I have been searching high and low for a good reference text and/or manual. On amazon.com, there is this book, which is supposed to be published next week. I have no idea if it actually will happen, but I am watching.

I think your concept of electronic publication is worthy, although I personally prefer paper. In fact, for this kind of thing, my all time favorite is a manual format, with those nifty plastic spiral bindings. I take a lot of notes in the margins. I know that a lot of people prefer electronic publications, so that they either never print anything out, or only print what they need, but I really hate reading text on a screen.

I am not sure what kind of format would be best, but I know what would be worst, and that is the annoying trend of “let’s learn this by making a project.” Oohhh, I hate that. The project idea is sound, but most of those articles invariably either leave out a step or two, or do not cover enough variety of approaches to make it applicable to what the reader is looking for in the first place. I think that sections based on the major parts of XCode and Interface Builder would be best, and would allow for plenty of discussion of details about the odd (or difficult) items within those sections. For instance, we beginners sometimes would like to know nothing more than how to add a second window, or drawer, or panel to an interface, with convenient step by step instructions. Then there is the menu bar, and added files, graphics, etc. As I am quickly learning, the whole package is pretty daunting, and if I had some sort of guidance for these little things, I would probably have a lot more fun (which is why I started messing around with AppleScript in the first place.)

I also think that your potential audience needs to be considered. By far, the beginner would benefit the most, but there are most likely plenty of intermediate level programmers, or experienced programmers looking to convert an application from a different platform that could use a little help. Most likely, each audience would have different needs, and therefore, a reference text may not necessarily meet everyone’s expectations.

Right now, there are nearly a dozen good books on the market for AppleScript. Although there are a few that cover XCode, none of them focus on AS Studio. I do not know about sales figures, but I would guess that if publishers are printing them, someone is buying them. Therefore, I believe there is PLENTY of room for a few AS Studio books as well. I know that I want one.

I know this is rambling, but I hope it helps, and I wish you the best of luck. (As well as godspeed.)

I think it would be an excellent idea to put something together, especially for someone like me“ the sometimes scripter.

I use Applescript/Studio as a tool to do other things, not as an end in itself. I’ll find myself (furiously) working on a project for three weeks straight, most of it relearning what I’ve forgotten in the four months I haven’t written anything. I’ve been doing this on and off for maybe ten years, and of course the UNIX underpinnings of OSX have really got me feeling a little dumb at times.

I do own three AS books, and the one I reach for the most is Haanan (sp?) Rosenthal’s. His style makes it easy to use as a reference when I need to fill in the gaps after a hiatus.

I would have hoped that by now someone way smarter than me would have put together something as good for Studio, in a format that Craig mentions above. No projects, but really easy “reference” type stuff. I’m still waiting…

Good Luck and I can’t wait to see it!

-N

This is an excellent idea, and something I would definitely be prepared to pay a moderate amount of money for, if done right.

The things I would love to see in particular are:

  1. Walkthroughs of using the more difficult aspects of Applescript, such as drawers, toolbars, tables and outlines, webviews, that sort of thing. It’s all well and good seeing them put to use in example apps, but having examples where these things are the sole objective, without other code and features confusing things, would be a real help.

  2. A good, clear command reference. There are tons of things I know how to do in PHP and other languages, but I end up having to spend ages rooting through the Apple docs to find the specific command that’s needed in Applescript.

  3. Paths. I spend hours tearing my hair out trying to get the paths to files right. A good explanation of how they work and when to use which type would be fantastic.

  4. A chapter with common problems and solutions.

There are lots of other things too but I can’t think of them off hand :stuck_out_tongue:

Let me third or fourth this obviously positive response (not counting any you might have received privately). I took up scripting about two years ago and have a bunch of books on it. For my money, the two most useful are Danny Goodman’s AppleScript Handbook which I bought from SpiderWorks as a download PDF, and Matt Neuburg’s AppleScript: The Definitive Guide, second edition (I have the first as well, but the second is a must-have).

Goodman’s ‘book’ got me started - got me to the point where I could do something, but whatever in-depth understanding I have of the language I got from Neuburg (and, of course, from the bbs; guys like Nigel Garvey and Kai Andrews). An analogy for those two books would be Engineering School; as an undergrad, I learned how to do things, but it was only as a grad student that I really understood what I was doing and why.

As Craig Smith said earlier, I too loathe books that do it all by example, because then the onus is on me to understand the nuances. We’ve all had problems generalizing someone else’s examples, I’m sure. Sometimes, you fail because it’s what I refer to as the “5 - 3 = ?” problem. If you don’t understand that 5 and 3 stand for the count of objects, 3 of which are to be removed from a collection of 5, then the ‘obvious’ answer is 5! Take the 3 out of that phrase, ignore the funny puncuation, and you’re left with 5, QED. In Neuburg’s book he explains what’s going on and includes some examples - almost all fairly trivial - constructed not to amaze, but to hammer home the points just made and to solidify the concepts with concrete specifics. Not everyone learns this way, but it’s what I prefer and this is my opportunity to ‘pitch’ for it.

The only text I have now on ASS is Chapter 23 of Fritz Anderson’s “Step into X code”. Most of the book uses Obj-C from which it’s really hard to generalize to AS. If you can accomplish the equivalent of Neuburg’s effort for AppleScript Studio, particularly with respect to clarifying the interface tools available and the flow of information from scripts to other elements in the bundle and back, I’ll pay a lot for a copy. Neuburg’s book was $40 and I have two copies. If you put it out in PDF form, I’ll pay half that for it and spend the rest on the paper to print it and the cost of spiral binding it.

Go for it, Jobu. I can’t wait.

Adam Bell

I agree with Craig Smith when he says he hates the phrase “let’s do a project” because it’s never the project you’re dying to do. I realize that it’s often the best way to learn something but if you’re all excited about digitalizing your collection of barnacles, it’s really annoying to first have to build a currency converter in order to learn something.
Another turn-off for me is that code examples tend to take the easy route. Say, to take but an example, they’ll show you how concatenate and format two Core Data fields in Objective-C but they fail to mention that the method they use will generate an erorr if one of the fields happens to be empty. So you faithfully copy the code and get error messages you don’t know how to handle.
So, what I’m looking for in any book/manual/tutorial is:
– a problem-based approach: How do I change the contents of the third cell in the second row? Not, let’s build a mail application which I already have and is working fine, thank you very much.
– complicated examples: How to concatenate two strings when one contains a deadly virus or nothing at all. How to determine the class or name of something when just using the word “class” or “name” raises a frightening error.

An in-depth discourse on bindings would be wonderful. The sooner, the better, Jobu. Is the first edition in print yet? :slight_smile: - bmose

Hey

I’m new to these forums, and just spotted this post, and would like to say that something like this would be brilliant!

I especially agree with the points Castle makes about working with the more advanced UI components, a list of commands and syntax is a must for any language guide, and finally, file paths, oh how I hate them so!!!

I’ve pretty much taught myself how to work most of the bits I needed with AppleScript Studio thanks to the example apps Apple have included, but I still feel that I’m missing a lot, and I can’t really find any book anywhere that does the job of filling that gap.

Also, my problem was I was trying to compare AppleScript Studio to Visual Basic 6 in the way you would create your applications. There are similarities, but AppleScript is more powerful I would say, but not as easy to create the GUI and link all the components. Something written specifically for AppleScript Studio with X-code would be fantastic! Hope you’re still planning on doing something like this :slight_smile:

-Ryan

I just figured out that 39 weeks have passed since Jobu started this thread – that’s the gestation period for a human baby. Is the book gestating?

@Jobu;

105 weeks since the feeler. Can we assume it ain’t gonna happen?

I wish it would - I’d buy a good one.

I hope Jobu is okay. He hasn’t posted on MacScripter since last July. I only know of him what I’ve encountered on this site, and his input has frequently been invaluable.

It’s a shame this project seems sort of dead; I am not finding many good tutorials on ASS, and it is certainly more overwhelming than just writing a script. Looks like a very powerful tool, though.

If this was made available in either book form or online docs, I would gladly pay $50 for it. All ideas sound good to me. And I consider myself pretty experienced but there are still lots of things I haven’t learned.
Chris

Has this idea died? Because right now, Apple has a great idea with poor documentation.