Globals and Properties

I have used Applescript Studio to try and implement an image viewing programme as a trial of its abilities.

The biggest problem I had was the implementation of global variables and ASS inability to have a truly global varialble as implemented in many other languages. The loading and saving of user defaults or script libraries did impact the performance of the programme.

I have thus resorted to learning Cocoa and it has been a long process with some success. However, the learning curve is steep and results, in my case, did not come quickly.

I have also scripted in SuperCard and as it is carbon based does not have access to some of the widgets implemented in Cocoa and AppleScript studio. However, it does implement globals.

To the point of the post.

I would like to return to AppleScript Studio but not without a proper implementation of globals.

Does anyone know if this is likely in the not to distant future.

–Terry

To my knowledge, the global variables, with a scope on the whole of scripts of a project, is not supported yet by AS-S, it is a pity, I know…

It should not be forgotten that, in more of “using defaults” and the script librairies, you can use simple text files to pass the data between the script files.

You can use the “list” and “record” formats of data, directly with the text files, which facilitates their management in the scripts.

The advantage of the text files, it is the speed much faster of this technique on the others.

Of course, that does not replace the global variables, but that remains sufficiently fast to not penalize the fluidity of the program.

:slight_smile:

Thanks for your reply.

Interestingly I have just found out that FaceSpan appears to have a full implementation of globals.

I wonder therefore why Apple cannot implement globals.

Is it deliberate policy to encourage the use of Objective C and cripple AppleScript Studio thus limiting its use to smaller projects.

Regards

Hi :slight_smile:

I am unaware of if there is really a “strategic” reason to deprive AppleScript-Studio of the global variables, and if it is the case, which would be this reason (there are perhaps here the persons which would have an answer to this question).

Personally, I allot this limitation to a simple historical reason, because the current development tools provided by Apple, are directly from the old tools developed for the NexStep platform (it is besides why the majority of the handled objects begin with the prefix “NS” = “NextStep”).

AppleScript-studio is only one very recent addition since on an environment of existing development of many years, and I suppose that the engineers of Apple have to make choices and also compromises to be able to integrate this technology in the best way.

Actually, I think that AppleScript-Studio exists only because the development tools were returned scriptables.

For FaceSpan the things are a little different. This tool existed under Os9 and it had already a mechanism extremely well thought of global variables and global context, very simple of use and extremely effective.

When FaceSpan made the jump with MacOsX, them persons in charge for the development of this tool have whole to reconsider again, and I remember to have received at the time an email of the person in charge for the project asking me which things I wished to see preserving in the new version, among a provided list.

Obviously, I wished that the global variables in priority are preserved, it is what they succeeded in doing, and I congratulate them sincerely, because the challenge was not easy. Only the concern which I could note, it is that the integration of this technology produces some deceleration of the operations, nothing serious good, but that can be sometimes a little penalizing.

Ultimately, perhaps that a day the engineers of Apple will succeed in integrating the global variables in AS-S, I hope for it for my part, but for the moment, even if this functionality misses, we can anyway carry out interesting projects with AS-S, in spite of these limitations.

In any case, if the global variables are essential for you, FaceSpan can be indeed a solution very interesting and serious for your projects.

Regards…

PS. Please excuse me if there are sentences difficult to read or incongruous, my English being very poor, I write my messages in French and I use tools for translation to help me to pass them in your language. thank you for your comprehension.