Re: Interacting with other applications

2007-03-24 Thread Ken Williams


On Mar 23, 2007, at 9:56 AM, David Cantrell wrote:


Consider what happens if I'm busily typing away, and the dialogue box
pops up and grabs focus, and then whatever its default is gets  
selected

because i hit space or enter.


That's exactly what a couple applications do on my machine  
(Backup.app and a shareware reminder for SideTrack), and I agree it's  
annoying.  A better behavior would probably be a bouncing dock icon  
that defaults to yes after 30 seconds or whatever.  Still annoying,  
but it wouldn't actually cause problems.


 -Ken


Re: Interacting with other applications

2007-03-24 Thread Daniel Staal
--As of March 24, 2007 3:31:56 PM -0500, Ken Williams is alleged to have 
said:



Consider what happens if I'm busily typing away, and the dialogue box
pops up and grabs focus, and then whatever its default is gets
selected
because i hit space or enter.


That's exactly what a couple applications do on my machine (Backup.app
and a shareware reminder for SideTrack), and I agree it's annoying.  A
better behavior would probably be a bouncing dock icon that defaults to
yes after 30 seconds or whatever.  Still annoying, but it wouldn't
actually cause problems.


--As for the rest, it is mine.

How about calling Growl?  You can have it call you back on click or 
timeout...


http://growl.info/documentation/developer/

Daniel T. Staal

---
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---


Re: Interacting with other applications

2007-03-23 Thread David Cantrell
On Thu, Mar 22, 2007 at 05:55:18PM -0400, Sherm Pendley wrote:
 On Mar 22, 2007, at 1:01 PM, Andrew Brosnan wrote:
 I'd like to run a daily backup script on my laptop, but I'd like it to
 ask permission first. I'm wondering what is the best way to do this.
 First off - can you always depend on a user being logged in? If so,  
 the simplest ideas tend to be the best. For a full-blown GUI app I'd  
 use CamelBones, but for a simple OK/Cancel dialog the old MacPerl  
 module is still the easiest:
 
   #!/usr/bin/perl
   use MacPerl;
   my $verify = MacPerl::Answer('Do you want to run backups?', 'OK',  
 'Cancel');
   print $verify, \n;

Consider what happens if I'm busily typing away, and the dialogue box
pops up and grabs focus, and then whatever its default is gets selected
because i hit space or enter.  So not only have you annoyed me by
popping something up and then removing it before I get a chance to read
it, you'll now take an action without the user knowing about it but on
the assumption that he does, *and* you've eaten an arbitrary amount of
what I typed, which I'll have to type again.

Needless to say, this is a Very Bad Idea.

-- 
David Cantrell | Nth greatest programmer in the world

It's my experience that neither users nor customers can articulate
what it is they want, nor can they evaluate it when they see it
-- Alan Cooper


Re: Interacting with other applications

2007-03-23 Thread Andrew Brosnan
On 3/23/07 at 2:56 PM, [EMAIL PROTECTED] (David Cantrell) wrote:

 On Thu, Mar 22, 2007 at 05:55:18PM -0400, Sherm Pendley wrote:
  On Mar 22, 2007, at 1:01 PM, Andrew Brosnan wrote:
   I'd like to run a daily backup script on my laptop, but I'd like 
   it to ask permission first. I'm wondering what is the best way 
   to do this.
  First off - can you always depend on a user being logged in? If 
  so,   the simplest ideas tend to be the best. For a full-blown GUI 
  app I'd   use CamelBones, but for a simple OK/Cancel dialog the 
  old MacPerl   module is still the easiest:
  
  #!/usr/bin/perl
  use MacPerl;
  my $verify = MacPerl::Answer('Do you want to run backups?', 'OK',  
  'Cancel');
  print $verify, \n;
 
 Consider what happens if I'm busily typing away, and the dialogue box
 pops up and grabs focus, and then whatever its default is gets 
 selected because i hit space or enter.  So not only have you annoyed 
 me by popping something up and then removing it before I get a 
 chance to read it, you'll now take an action without the user 
 knowing about it but on the assumption that he does, *and* you've 
 eaten an arbitrary amount of what I typed, which I'll have to type 
 again.
 
 Needless to say, this is a Very Bad Idea.


I think that was meant as a rudimentary example, at least that's how I
took it. I appreciated the info. shrug

Andrew



Re: Interacting with other applications

2007-03-23 Thread Sherm Pendley

On Mar 23, 2007, at 10:56 AM, David Cantrell wrote:


On Thu, Mar 22, 2007 at 05:55:18PM -0400, Sherm Pendley wrote:

On Mar 22, 2007, at 1:01 PM, Andrew Brosnan wrote:
I'd like to run a daily backup script on my laptop, but I'd like  
it to

ask permission first. I'm wondering what is the best way to do this.

First off - can you always depend on a user being logged in? If so,
the simplest ideas tend to be the best. For a full-blown GUI app I'd
use CamelBones, but for a simple OK/Cancel dialog the old MacPerl
module is still the easiest:

#!/usr/bin/perl
use MacPerl;
my $verify = MacPerl::Answer('Do you want to run backups?', 'OK',
'Cancel');
print $verify, \n;


Consider what happens if I'm busily typing away, and the dialogue box
pops up and grabs focus, and then whatever its default is gets  
selected

because i hit space or enter.  So not only have you annoyed me by
popping something up and then removing it before I get a chance to  
read

it, you'll now take an action without the user knowing about it but on
the assumption that he does, *and* you've eaten an arbitrary amount of
what I typed, which I'll have to type again.

Needless to say, this is a Very Bad Idea.


If this were something that might pop up at any random moment, I'd  
agree. But it's a daily backup script - it's not unexpected, and  
presumably it's scheduled to run at the same time every day. Andrew  
doesn't need to be notified that it's going to run, he knows that  
already; all he needs is veto power over it.


sherm--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net




Interacting with other applications

2007-03-22 Thread Andrew Brosnan

I'd like to run a daily backup script on my laptop, but I'd like it to
ask permission first. I'm wondering what is the best way to do this. I
thought I would have the script open Terminal.app and use STDIN/OUT? If
so, what is the recommended way to do this? IPC::Open? One of the Mac::X
modules?

Thanks,
Andrew



Re: Interacting with other applications

2007-03-22 Thread Sherm Pendley

On Mar 22, 2007, at 1:01 PM, Andrew Brosnan wrote:


I'd like to run a daily backup script on my laptop, but I'd like it to
ask permission first. I'm wondering what is the best way to do this.


First off - can you always depend on a user being logged in? If so,  
the simplest ideas tend to be the best. For a full-blown GUI app I'd  
use CamelBones, but for a simple OK/Cancel dialog the old MacPerl  
module is still the easiest:


#!/usr/bin/perl

use MacPerl;

	my $verify = MacPerl::Answer('Do you want to run backups?', 'OK',  
'Cancel');

print $verify, \n;

sherm--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net