From: owner-macperl-toolbox-digest@macperl.org (macperl-toolbox-digest) To: macperl-toolbox-digest@macperl.org Subject: macperl-toolbox-digest V1 #1 Reply-To: $SENDER Sender: owner-macperl-toolbox-digest@macperl.org Errors-To: owner-macperl-toolbox-digest@macperl.org Precedence: bulk macperl-toolbox-digest Thursday, February 25 1999 Volume 01 : Number 001 ---------------------------------------------------------------------- Date: Tue, 16 Feb 1999 17:26:24 -0800 From: Vicki Brown <vlb@cfcl.com> Subject: [MacPerl-Toolbox] This is a test of the macperl mailing lists If anyone is out there, you might want to reply. You might want to try the digests. Take a look at http://www.macperl.org:8873/depts/mlists.html We expect the lists to go public, oh, tomorrow? If there be anyone here who have just cause why these here lists shall not be mentioned yet, let him speak now... - --- |\ _,,,---,,_ Vicki Brown <vlb@cfcl.com> ZZZzz /,`.-'`' -. ;-;;,_ Journeyman Sourceror: Scripts & Philtres |,4- ) )-,_. ,\ ( `'-' P.O. Box 1269 San Bruno CA 94066 '---''(_/--' `-'\_) http://www.cfcl.com/~vlb http://www.macperl.org ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org ------------------------------ Date: Wed, 24 Feb 1999 21:07:55 -0600 From: "Walter Torres" <walter@tscinternet.com> Subject: [MacPerl-Toolbox] RE: [MacPerl] Q on Toolbox access from Perl > -----Original Message----- > From: Arved_37@chebucto.ns.ca [mailto:Arved_37@chebucto.ns.ca] > Sent: Wednesday, February 24, 1999 5:36 PM > To: Walter Torres > Cc: MacPerl > Subject: Re: [MacPerl] Q on Toolbox access from Perl > > > On Sat, 24 Jul 1999, Walter Torres wrote: > > > Does anyone in here know how you can access Mac Toolbox info from Perl? > > > > Over in the Win32 world, some folks have written some Registry (a Mac > > desktop file want-to-be) MODules to read and write data into and out of > > there. > > > > I was wondering if anyone did the same for the Mac Toolbox? > > Walter, check under the Help menu in MacPerl. You notice the submenu for > Macintosh Toolbox Modules? :-) Look at the length of the list. There are > nooks and crannies of the Toolbox that aren't covered, but not many. :-) > > These are all Perl extension modules for MacPerl. Thanks for the note back. My Mac died some time ago. My office makes me use NT. I am creating a few scripts and I want them to be able to run on UNIX, Win32 and Mac, thus my posts of late. On the Mac, the Time Control Panel lets you set the Time Zone you are in. Do you happen to know what Toolbox call is needed to access that info, and if there is a corresponding Perl MODule to access that info? I would really like this to run on the Mac without allot of problems. Thanks Walter ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org ------------------------------ Date: Thu, 25 Feb 1999 12:48:51 -0500 From: Chris Nandor <pudge@pobox.com> Subject: [MacPerl-Toolbox] Internet Config Some proposed additions to IC.pm. Any problems with this? There is also a problem in IC with saving new mappings, IIRC. I might look into that at some point, but I just happened to have this here. Better names for GetICHelper wanted. GetURL seems fine to me since it is a pretty much globally accepted name now. I thought about making GetICHelper a tied hash, but I didn't want to provide an object or reference, and I don't think a tied hash can return a list, or even recognize wantarray. Is this the right place for this? Would toolbox or porters be better? (Matthias cc:d on the offchance he is not subscribed yet. :) *** Bird:src:freebie cvs:MacPerl:perl:ext:Mac:InternetConfig:InternetConfig.pm Thu Feb 25 12:29:43 1999 - --- Bird:src:Pudge:pudgeprogs:perl:site_specific:Mac:InternetConfig.pm Thu Feb 25 12:37:13 1999 *************** *** 130,136 **** icNoPerm icReadOnlyPerm icReadWritePerm ! ); @EXPORT_OK = qw( $ICInstance ); - --- 130,138 ---- icNoPerm icReadOnlyPerm icReadWritePerm ! GetURL ! GetICHelper ! ); @EXPORT_OK = qw( $ICInstance ); *************** *** 458,464 **** sub DESTROY { my($my) = @_; ! DisposeHandle($my->{entries}); } sub FETCH { - --- 460,466 ---- sub DESTROY { my($my) = @_; ! DisposeHandle($my->{entries}) if $my->{entries}; } sub FETCH { *************** *** 731,736 **** - --- 733,739 ---- =back =cut + $ICInstance = ICStart(); tie %RawInternetConfig, q(Mac::InternetConfig::_Raw); *************** *** 739,745 **** - --- 742,772 ---- =include InternetConfig.xs + =item GetURL URL + + Launch helper app with URL. Returns undef on error. + + =item GetICHelper PROTOCOL + + Return list of creator ID and name for helper app assigned + to PROTOCOL. Returns only creator ID in scalar context. + Returns undef on error. + =cut + + sub GetURL { + my $url = shift or return; + ICGeneralFindConfigFile($ICInstance); + ICLaunchURL($ICInstance, 0, $url); + } + + sub GetICHelper { + my $proto = shift or return; + my $helper = $InternetConfig{kICHelper() . $proto} or return; + my $app_id = substr($helper, 0, 4); + my $app_name = substr($helper, 5, ord(substr($helper, 4, 1))); + return wantarray ? ($app_id, $app_name) : $app_id; + } - -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org ------------------------------ Date: Thu, 25 Feb 1999 10:55:18 -0800 From: Eric Albert <ejalbert@cs.stanford.edu> Subject: Re: [MacPerl-Toolbox] Internet Config At 12:48 PM -0500 2/25/1999, Chris Nandor wrote: >Some proposed additions to IC.pm. Any problems with this? No...it looks like it makes a lot of sense. >Better names for GetICHelper wanted. GetURL seems fine to me since it is >a pretty much globally accepted name now. I thought about making >GetICHelper a tied hash, but I didn't want to provide an object or >reference, and I don't think a tied hash can return a list, or even >recognize wantarray. How about something like GetHelperApp? If it's in IC.pm already and isn't globally exported (which I'm sure is the case), there's probably no compelling need to repeat the module's name in the method name. >Is this the right place for this? Would toolbox or porters be better? Uh, this is toolbox. :) And yes, this is just fine here IMHO. - -Eric - -- Eric Albert ejalbert@cs.stanford.edu http://www.stanford.edu/~ejalbert/ ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org ------------------------------ Date: Thu, 25 Feb 1999 14:11:08 -0500 From: Chris Nandor <pudge@pobox.com> Subject: Re: [MacPerl-Toolbox] Internet Config At 13.55 -0500 1999.02.25, Eric Albert wrote: >How about something like GetHelperApp? If it's in IC.pm already and isn't >globally exported (which I'm sure is the case), there's probably no >compelling need to repeat the module's name in the method name. Well, it would be exported by default, which is the norm for the toolbox modules more than the exception. I am not averse to putting them in @EXPORT_OK though. use Mac::InternetConfig qw(:DEFAULT GetURL GetHelperApp); use Mac::InternetConfig qw(:all); Waiting for more thoughts on the matter. :) - -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org ------------------------------ End of macperl-toolbox-digest V1 #1 *********************************** ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org