Re: Best practice for activation of another application
Re: Best practice for activation of another application
- Subject: Re: Best practice for activation of another application
- From: "Gary (Lists)" <email@hidden>
- Date: Sat, 08 Oct 2005 13:11:51 -0400
"Michelle Steiner" wrote:
> On Oct 8, 2005, at 9:19 AM, Daniel Jalkut wrote:
>
>> When I write an AppleScript that needs to display a dialog in
>> another application, I always explicitly activate that appliation
>> first:
>
> It doesn't matter what application is active when the dialog is
> displayed; it's an Applescript dialog, not the application's dialog.
Yes, and if your user is intended to then do some action, in some
application, then one needs to target and move to that application: that's
not 'hijacking focus' [*], that's automation.
[*] "Daniel Jalkut" also wrote:
> leaving the activation out could be perceived as less intrusive to a
> user or application who doesn't want to have their focus "hijacked."
"Hijacked" focus, to me, implies a condition when a user would not expect,
or anticipate, that some window or other would be re-ordered. If a user is
running a script, let's say 'Move Mail to FileMaker', then if focus shifts
between those two applications, that's what I would consider an 'expected or
anticipated' consequence of running the script.
That said, I have a script of that very nature that came from another
author, and I've had to re-organize it because of a real problem the
programmer must have had with 'activate'. The rule I gleaned from that
author's work: Don't 'activate' an application if you don't need the user
(or the script-as-user) to be there.
During execution of that author's script, the 'activate' command was inside
a loop, therefore every message archived would require an
'Entourage->FileMaker->Entourage' physical window-flop...which was
intolerable and ridiculous.
A simple change allowed all archiving to take place with Entourage
frontmost, FileMaker in the background, plugging away without care of being
left behind. (Not that Entourage is usable during script execution, but if
it were... ;)
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden