ASS and call method

I am writing this to encourage users of ASS to learn in a small way how to use the call method command with existing and custom classes.

I have been coding for personal gratification a small application in both ASS and Objective c/ cocoa that creates a library (pList file) to store the paths to images and other global data associated with each library and display and edit the images.

Within the objective c /cocoa application I started from scratch to try and learn to code in objective c. I have had fairly good success and have implemented my application to a point where I have an edit window applying core image filters which I can apply to the image and then save.
Without rambling to much I have found the objective c not to difficult to learn at the class level but have not enjoyed the model view controller concept and its implementation through interface builder with actions being stored in the controller. It seems so long winded. Why can’t you just attach the code to the button or whatever and edit the code just for that object.

I have now commenced the ASS implementation of the same programme. Areas that have caused difficulty have been the implementation of global variables and the slow response of image view in ASS.

I have overcome the global variable problem by implementing a class in objective c that I access through call method to access and change the global variables from any script. I have found this method the most speedy of the various implementations I have tried.

With regard to Image View I have implemented two classes, both subclasses of NSView (myView and myEditView). myView is for speedy display of the library images and myEditView for implementation of rotate, crop, core image filters etc. As I said earlier learning cocoa/objective c to implement these classes was not to difficult.
Rotate and crop are implemented I am in the process of coding the core image interface.

With regard to speed of the ASS app compared to the cocoa/obj c app there is very little difference on my G4 1.25 imac, barely if at all noticeable. This is as a result of the call method and custom classes.

The model view controller concept is not an issue in ASS as you select your button, give it an applescript name and click to link it to your code and its done. The code you write can be contained in individual files related only to the button (my preferred way of working as it limits the length of your code files to something manageable).

When displaying the images one after the other the ASS implementation with a custom class in approximatley 5-6 times faster than the implementation using image view in ASS.

I would conclude that real (speedy) applications are possible in ASS and where speed is an issue then please learn to code in objective and produce a hybrid ASS/Objective c application using the call method procedure.

To learn cocoa/objective c from scratch and get immediate results in my experience is highly unlikely better to understand the call method of class concept in ASS and selectively design your classes as required.

Get learning…:wink:

–Terry

Because that’s not how things work around these parts. It’s less flexible and doesn’t abstract enough to make optimal use of OO/MVC paradigms.

A button, for example, sends a message to a controller. You specify what action it sends, from the list of available messages within the controller. Take note of that last part:

The controller knows what it can do publicly, and it makes those messages available to objects that can trigger them.

If the button knew how to insert a record into a persistent store, you’d have to wire up communication all over the place, because now your UI elements have to talk to each other to get things done and keep them straight. If you instead have a controller that knows how to do these things, the button and other UI objects only need to trigger the messages that the controller makes publicly available.

Thank you
:frowning: