Hello hhas.
First of all, Nigel Garveys solution is serializqble, and yours arenât right out of the box, so what solution that is best in every circumstance isnât quite so.
I have read what you have written.
Well, other languages have libraries, like Python for instance, and the result of that is that basically âanyoneâ, sorts an array of three integers with Quicksort.
Doing so on the command line is one thing, doing so by AppleEvents is a whole other story.
I should really written something that that it would be hard to prevent newcomers to misuse the library. I guess.
For libraries to be good to use for new users, theyâll have to pretty much insulate the users from the diversity of for example file specifiers, I have written such a handler that I have posted here, when you have been around with AppleScript for some time, then you know that this handler is ok to use for a single retrieval of a posix path, now a new user might be using the same handler for retrieving a listing of the files that are in some subtree on his disk. Furthermore even if this part of the story is ok, and can be documented, that doesnât alleviate the fact, that the same checks might be one over and over again, in a script, because of the nondiscriminant use of library handlers which all performs the same tests for class conformance, and god knows what and what not, in order to be as robust and user friendly as possible. This hypothetical end userâs script, will run considerably slower than someone who knows what they are doing, because they know they can test just once, and make it run as fast as possible, which is part of Appleâs philosphy, that software should be fast and efficient. That is quite the opposite take than many other of the industry leaders, where âbuy better hardwareâ is the slogan.
The other reason for not liking the idea, is that it may lead to entrepeneural souls, who hardly knows what they do, to ship apps in the Appstore. Actually, I canât decide whether I think Javascript apps, that uses libraries, like Popcorn Time app, and ASOC apps, should be banned from the Appstore, or have a warning on their product page, that informs of what they are made of, and that they may reduce the responsiveness of the computer.
The problems I see with AppleScript libraries, other than the bloat, is first and foremost problems with dependencies and versioning of the libraries.
Many of the great libraries out there, has some kind of funding, either in man hours, or cash, from some corporation, and the corporation, isnât doing that for altruistic purposes, even though, some funding may be granted by Google Summer of code, having a good application. Because funding is needed, in order to establish a library of some size, because of managment, versioning, Q&A, and all that.
And actually, I think at lest AppleScript â2.3â was a great step in the right direction, this works for me. The Google page rank algorithm has been remarkably good, which is why there are less traffic on most forums nowadays, because people can read, and rather read, and solve their problems themselves, than sitting and waitng for some answer. I am not the only one, that google for solutions, I find something, either directly usable, or something I can tweak to work, all done, I drop it into the Script Libraries folder, and âvoilaâ.
There are tons of scripts out there, not only here, but at MacOsXAutomation, there are scripts at specialized app forums, at MacDevCenter, and MacTech, there are zillions of scripts at github and most problems have been solved in some forumpost before anyway, with code to snag.
Also, when I hear the word centralized repository, I kinda hear the word âcommitteeâ. And then I start thinking of self promoting power hungry people who are highly opiniated, and sees it as their duty to enforce their taste, opinons and perceptions on what is good and bad. Youâll often see them speak in a very self confident, self promoting, absolute manner, when dealing with subjects they at least think they are the sole experts on. The âSoup Nazisâ.
C was a nice language before the Ansi committee established a standard, I have that standard annotated in my shelf, and it covers the language and the standard libraries, in some 600 pages I believe.
A worser example is of course C++.
I make a lot of code freely available, it is just up to people to find it, if they need it, I donât push it onto them. The code stays at Macscripter, we do have a good environment here, and this is centralized enough for me. The only alternative I see, is the one everyone elses uses, and that is to post the code on their own blog, and that works too, Iâd of course contribute code to a central library, if there were any interest in that, on an âas isâ basis, and that it wonât be printed/written about in some book.
Personally, I have nothing against sharing code I have produced for my own consumption, and helping people, when I can. I read the above, as to commit to something, so it would become more of an open source project, and that is not for me, because that means I will have to commit time.
Luckily, we are on OS X, and we do have ASOC, and Shane Stanley has provided a framework, I believe everybody, at least on Yosemite can use. I think any form of Library should start with that framework, or that users that needs solutions should download it.
(I wrote âSoup Nazisâ, and not Nazis)
I guess that is a general you of sorts, that you donât mean that people who have spent many an hour, learning it, scripting scripts, are some kind of assholes, since we donât find the time, to really push it into the arms of those that have chosen not to put in the effort, knowing that there was a large probability for it beeing for nought anyway?
I regard my self more of an eternal student, than a high priest, and frankly I know no high priests, not here anyways, we all learn some bits, some more often than others, and I think youâd be rather âspecialâ, if you are motivated to âhand outâ âtrinkets of codeâ, like some kind of power exchange, instead of being helpful. I donât really see any ulterior motifs in people here,most of them anyway, but a sheer will to help out fellow citizens.
Dictating? The web is still free, if you choose not to use Google, nobody hinders you really, the thing is, especially with Google, that they happened to have a great product, at the right time, and somewhat had some luck and a theft for business, and ended up in an almost monopoly situation. I bet you have kept ownership over your book, or have you opensourced it? Would you have complained, if your book was so good, that it acquired a monopoly in the AppleScript book market?
You still use a Mac when you bought it, you bought more than that, you bought a whole concept, but I guess you as well, feel that the benefits are greater than the opposite. And that should the day come when you figures it to not be so, that you jump the bandwagon.
Besides that, I like Apples iCloud, it is great for sharing data among devices, and it provides as much privacy as is nowadays.
Yeah, you are one of them lowly users, that just happens to have written a book about the subject and peekd deep into the interals.
I see myself more as a student of AppleScript, and share my knowledge, and learn from others, not necessarily in the same process. And yes, process it is, and we more often end up with some truth and deeper understanding than mot. Most of the time, the tone is frienly, and we are aside of the blogosphere, so there is little self-marketing or âupmanshipâ here.
And you donât need reply, because I am done with this subject now.