OmniOutliner and controlling user interaction in AppleScript
Michael Terry
formido at mac.com
Mon May 10 20:33:33 PDT 2004
On May 10, 2004, at 7:31 PM, Andrew Abernathy wrote:
> Any of the scripters out know much about / have opinions about
> controlling the user interaction level (which indicates whether or not
> the application should attempt any interaction with the user)? As best
> as I can tell, AppleScript still doesn't have standard support for
> changing the user interaction level, and I'm trying to confirm this,
> and see what support scripters think is important.
Yes, I think you're right. The topic doesn't come up much. In general,
applications just eliminate user interaction when executing script
commands. For example, when you empty the trash via Finder->Empty
Trash…, a dialog pops up asking you if you really want to do that. If
you empty the trash via script, no dialog is presented.
> This is coming up at the moment because if a user asks OmniOutliner to
> open a document and it fails (permissions problem, corrupt file, etc)
> then an alert panel is displayed, but if the user double-clicks an
> outliner document or a script tells OO to open a document and it
> fails, no alert panel is displayed, leaving the user wondering what
> happened.
>
> The difference between these cases is that both the double-click and
> scripting actions go through AppleEvents, but it's difficult (at best)
> to tell the difference between them programmatically in order to
> display an alert in the double-click case and be silent in the
> AppleScript case. I'd be fine with just checking the AppleEvent user
> interaction level, relying on the scripter to turn off user
> interaction if so desired (and turn it back on when done), but there
> doesn't appear to be standard support for scripters to adjust the user
> interaction level. I'm hoping I'm overlooking something, or someone
> has some insight that will help. Short of that, anyone have
> expectations for exactly what they would _want_ in terms of this
> functionality?
>
>
It would be cool and unusual if you allowed scripters to change the
user interaction level within Outliner. You can do this sort of thing
in VBA for Office applications, I think. But, if this were the only
case where it applied, it would seem a little silly. If that's the
case, and notwithstanding implementation concerns, the best solution
from a scripter's point of view would be to throw an error so that we
can choose whether to trap and deal with it.
There's no way for ASers to do change the user interaction level on a
system wide basis, though, if that's what you mean.
Mike
More information about the OmniOutliner-Users
mailing list