I am trying to write a script that does a bunch of neat stuff, but I need to be able to prevent the user from mucking things up by typing/clicking. Is there a way to block all user input for a time? Please help me! Also, by using osaxen in my script, and then compiling it into a run only application, will those same osax extensions need to be present on any computer that the script runs on? In other words, will I have to distribute a bunch of scripting additions along with my script?
Not that I know of. But there may be a workaround. What’s the problem?
Yes.
Yes. but it can be done more easily than you think. Check this answer from MacScript Digest:
“Speaking of osaxen, is there a way to use one without having to put it into the Scripting Additions folder first?”
I’ve got an osax that lets you do it. FaceSpan does also. Any script runner can do it.
“Alternatively, would it work if, at the start of a script, I would copy an osax to the Scripting Additions folder and then proceed to use it later in the same script?”
Yes, if you compile or run a script while running your script, you should be able to. I suppose I have to try this.
“And finally, why isn’t it standard in AppleScript to be able to embed osaxen into the resource fork of a script? One can use special icons by doing that, why not osaxen? It sounds like it would make sense… doesn’t it?”
It’s not a bad idea, but we were burned by the need to ship. Osaxen were a hack Donald thought up when we learned that AOCE had snagged the Finder human resources and we weren’t getting a scriptable Finder. We could convert some HyperCard xcmds into osaxen and write our own file manipulation tools so that AppleScript could do something out of the box.
Jens didn’t have time to add the resource loading to applets, and I don’t think we actually thought of it at the time or he might have tried to sneak it in.
We disallowed some osaxen behaviors that were not secure by adding a bit in the osiz resource for “allow remote events”. That’s what prevents you from sending “run script” commands to someone’s Finder.
Jon