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