Re: AS Library Question
Re: AS Library Question
- Subject: Re: AS Library Question
- From: Chris Page <email@hidden>
- Date: Thu, 17 Dec 2015 06:30:40 -0800
> On Dec 11, 2015, at 3:02 PM, has <email@hidden> wrote:
>
> Yeah, I've been banging on for years about the need to replace OSA with an out-of-process architecture for loading and running scripts for precisely the same reason.
So, like, NSUserScriptTask. There you go, right?
> The right thing would be for Apple to deprecate NSAppleScript...
You're conflating orthogonal concepts. There's no need to disallow running scripts in the current process just because there's a mechanism for running them in another process. They're complementary, layered facilities, one built upon the other, and each has its use-cases.
AppleScript (and OSA) is a rich, powerful technology for solving many different kinds of problems, many of which either require that scripts run in the client's process or perform better there. Your use-case of running a standalone, arbitrary user-supplied script is only one of many.
For example, many programs use embedded script languages as part of their core functionality, either to run built-in scripts or user-supplied scripts that extend or modify application behavior (c.f. Lua). AppleScript--and, more generally, the OSA technology--was designed primarily for this, from the start.
In fact, that's what AppleScript applets are: they're an application whose behavior is almost entirely defined by a script (or scripts).
> ...and direct app developers to use ASOC for running its own internal scripts...
Hmm? “use ASOC *for* running internal scripts”? Did you mean something like “don't execute user-supplied scripts within your application process if they use ASOC” and “only run ASOC scripts inside your application process if you wrote them”?
While it's something for each application developer to consider for themselves, running ASOC scripts in your process should be no more of a problem than using compiled frameworks or plugins. The primary purpose for ASOC scripts is to replace Scripting Additions with libraries, but, just as with Additions, if you're going to use ASOC you should be careful, test it with several client applications, etc. On the other hand, apps that run these scripts should generally leave it to users to decide whether they feel confident in their code. This is true whether they're using AOSC or not--scripts can do dangerous things, like delete user data, no matter what process they run in or which mechanisms they use to accomplish their tasks.
--
Chris Page
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden