MacPerl-Digest Friday, April 9 1999 Volume 01 : Number 039 Re: [MacPerl] scriptable text editor Re: [MacPerl] scriptable text editor Re: [MacPerl] scriptable text editor Re: [MacPerl] EBCDIC in, ASCII out? Re: [MacPerl] What value to use for DOMAIN in MacPerl::Choose? Re: [MacPerl] mktime Broken? [MacPerl] Mac::Navigation glue Re: [MacPerl] Mac::Navigation glue [MacPerl] Shuck and Print Re: [MacPerl] Shuck and Print Re: [MacPerl] Shuck and Print Re: [MacPerl] Mac::Navigation glue [MacPerl] Net::FTP Problem Re: [MacPerl] Shuck and Print Re: [MacPerl] Mac::Navigation glue ---------------------------------------------------------------------- Date: Thu, 08 Apr 1999 14:58:47 GMT From: bart.lateur@skynet.be (Bart Lateur) Subject: Re: [MacPerl] scriptable text editor On Thu, 8 Apr 1999 08:11:32 -0400, Chris Nandor wrote: >I cannot find a copy of >Scriptable Text Editor anywhere. Anyone have a link? It was on the floppy included with Danny Goodman's "Applescript Handbook". Bart. ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 10:04:15 -0500 From: "Jefferson R. Lowrey" <lowrey@mailbag.com> Subject: Re: [MacPerl] scriptable text editor At 10:09 AM -0400 4/8/99, Chris Nandor wrote: >At 09.41 -0400 1999.04.08, Jefferson R. Lowrey wrote: >>At 8:11 AM -0400 4/8/99, Chris Nandor wrote: >>>I checked with url on EFnet (an infobot in Perl (that was written up in >>>TPJ) on IRC that stores links to stuff, especially Mac stuff), I checked >>>the AppleScript SDK (which just has STE release notes), I looked in the >>>Apple FTP sites, I searched the Apple site, and I cannot find a copy of >>>Scriptable Text Editor anywhere. Anyone have a link? >>> >> >>It's buried inside the Applescript SDK. It's not available as an >>individual download. > >I have the SDK. It isn't there. A folder containing release notes is there. > I've confirmed that it was part of the OLD sdk, and not available where it used to be. It used to be available as part of <ftp://ftp.apple.com/devworld/Development_Kits/AppleScript/AppleScript_Set up/Apple%27s_Scripting_Syste.sit.hqx> However, 7Edit, availabe in ftp://ftp.apple.com//devworld/Tool_Chest/OS_Utilities/Apple_Events/AE_Sample_App lications.sit.hqx might serve just as well. In particular, it supports some of the same odd AppleEvent terminology that our favorite perl editor does (like "Spot"). Jeff Lowrey ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Fri, 9 Apr 1999 00:05:08 +0900 From: Peter Hartmann <hartmann@mbox.kyoto-inet.or.jp> Subject: Re: [MacPerl] scriptable text editor At 8:11 Uhr -0400 08.04.1999, Chris Nandor wrote: >I checked with url on EFnet (an infobot in Perl (that was written up in >TPJ) on IRC that stores links to stuff, especially Mac stuff), I checked >the AppleScript SDK (which just has STE release notes), I looked in the >Apple FTP sites, I searched the Apple site, and I cannot find a copy of >Scriptable Text Editor anywhere. Anyone have a link? > >Thanks, The only location I know of is Danny Goodman's FTP site. It is contained in his 1MB tutorial file package called AppleScript Handbook. Kind of heavy considering that Scriptable Text Editor is only about 100k, uncompressed. ftp://ftp12.ba.best.com/pub/dgoodman/ASHandbook.sit.hqx __Peter Hartmann________ mailto:hartmann@mbox.kyoto-inet.or.jp (preferred) mailto:phv00542@askic.kic.ritsumei.ac.jp (rarely checked) ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 10:11:14 -0500 From: John Gilmore-Baldwin <john@dwx.com> Subject: Re: [MacPerl] EBCDIC in, ASCII out? Just an FYI. My message was forwarded to somebody familiar with IBM systems, and this person kindly pointed out to me that I was doing things the hard way. All I needed to do was FTP the file as a text file, and the FTP daemons handle the EBCDIC->ASCII conversion. This person was working with 390s, but the behavior is the same on the AS/400 I'm working with. Thought some might like to know. Thankfully, perl makes the conversion easy, so I didn't lose a lot of time solving this problem. Thanks all, John >Thanks all. > >I grabbed the Convert::EBCDIC module, and it works fine on the Mac. I >haven't finished looking at all of the solutions I got, but I will. And I >really appreciate the help. > >Thanks again, >John > > >>That's what I need to do, take an EBCDIC file, and translate it to ASCII. >> >>While the task isn't that difficult, if somebody has already written an >>elegant solution, I feel no need to do it too. So, if anybody know of a >>solution for this conversion that's already done, please let me know. >> >>Thanks, >>John >> >> >> >>===== Want to unsubscribe from this list? >>===== Send mail with body "unsubscribe" to macperl-request@macperl.org > > > > >===== Want to unsubscribe from this list? >===== Send mail with body "unsubscribe" to macperl-request@macperl.org ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 11:32:49 -0400 From: Chris Nandor <pudge@pobox.com> Subject: Re: [MacPerl] What value to use for DOMAIN in MacPerl::Choose? At 12.09 -0400 1999.04.08, Brenda Cannon wrote: >I am interested in using Macperl::Choose DOMAIN, TYPE, PROMPT to allow >the user to choose an address. The part that I don't understand after >reading the documentation is what value DOMAIN should have. (I just >want to allow the user access to local hard drives, nothing else). >Can anyone help me out? You want to present a dialog box to get or put files? Use the Mac::StandardFile package. It's the best way to go. - -- 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-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 14:31:01 -0400 From: "Paul J. Schinder" <schinder@pobox.com> Subject: Re: [MacPerl] mktime Broken? On Wed, Apr 07, 1999 at 11:36:07PM -0700, A K Suska wrote: } I thought I had seen a thread about difficulties using the POSIX time } functions--can someone refresh my memory about problems with mktime and } workarounds (if any)? No matter what I feed to mktime I get a negative value } back that chokes ctime, localtime, etc showing only Jan 1, 1904. Whenever dealing with times using MacPerl, it's always a good idea to remember that current Mac times are already > 2^31 seconds past Jan 1, 1904. So you have to keep Perl from interpreting this as a signed integer, or you're hosed. One useful trick is to assign or pass $time | 0. This won't change the value at all, but seems to force Perl to interpret the value as an unsigned integer, which is what you want. Without seeing any code, I can't tell you any more than this. } } TIA } } Alex } - -- Paul Schinder schinder@pobox.com ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 08 Apr 1999 17:30:54 -0400 From: "Quentin Smith" <macmania@bit-net.com> Subject: [MacPerl] Mac::Navigation glue On the recent topic of Nav Services, I have written a "glue" for the Mac::Navigation" module. Name the module "NavServices.pl" and put it in your site_perl folder. To test it, use the following script: #!perl -w use strict; print &GetFiles("Select some files to open.", undef, qw[TEXT ttro]); Here is the complete definition for the GetFiles subroutine: &GetFiles(prompt, defaultFolder, typeList, dialogOptions); The sub will automatically use StandardFile.pl if Nav Services are not available. More coming soon, stay tuned! #!perl -w # &GetFiles(prompt, defaultFolder, typeList, dialogOptions); sub GetFiles { use Mac::Navigation; use Mac::Files; use strict; my($text, $default, @types, $options, $nav, $file, $numFiles, $i, @files) = @_; if (NavServicesAvailable && NavServicesCanRun) { if (!defined ($options)) {$options = NavGetDefaultDialogOptions()}; $options->message($text); $options->windowTitle($text); $options->dialogOptionFlags( $options->dialogOptionFlags | kNavNoTypePopup); # Get rid of type popup my $types = new NavTypeListHandle "McPL", [@types]; local($^W) = undef; $nav = NavGetFile($default, $options, $types, sub {use Mac::Events;Mac::Events::DispatchEvent($_[1]->event);}); if ($nav && $nav->file(1)) { if (wantarray()) { $numFiles = $nav->count; for $i (1 .. $numFiles) { push(@files, $nav->file($i)); } return @files; } else { $file = $nav->file(1); return $file; } } } else { require "StandardFile.pl"; return $_ if defined($_ = StandardFile::GetFile($text, @types)); } } ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 19:30:47 -0400 From: Chris Nandor <pudge@pobox.com> Subject: Re: [MacPerl] Mac::Navigation glue Cool, this is what I've wanted to see for some time. Maybe a module called Mac::GetFile or something. Mac::FileDialogs. I dunno. Should work with StandardFile.pm and Navigation.pm. Some suggestions: * Uses Mac::StandardFile, not StandardFile.pl. * Most people don't have Mac::Navigation. Better to do something like: my $hasnavservices = do 'Mac/Navigation.pm'; Then when it comes time later: if ($hasnavservices) { Mac::Navigation->import; # ... } else { require Mac::Standard File; Mac::StandardFile->import; # ... } Also, it would be nice to extend this to do putting of files to, and maybe choosing of objects or something, too. - -- 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-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 21:39:43 -0400 From: Dave Johnson <dave_johnson@ieee.org> Subject: [MacPerl] Shuck and Print I've been working on other things for a while and I am now getting back to working with MacPerl. One thing has always mystified me. Why does Shuck not have a Print command? Thanks Dave Comparing Windows to a Mac is like comparing Sparkling Wine to Champagne. It has the bubbles and will get you drunk. But when you wake up in the morning you've got a headache. ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 21:56:19 -0400 From: Chris Nandor <pudge@pobox.com> Subject: Re: [MacPerl] Shuck and Print At 21.39 -0400 1999.04.08, Dave Johnson wrote: >I've been working on other things for a while and I am >now getting back to working with MacPerl. One thing has >always mystified me. Why does Shuck not have a Print >command? Why is the sky blue? :) - -- 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-request@macperl.org ------------------------------ Date: Thu, 8 Apr 1999 23:00:12 -0400 From: George Michel <gmichel@siteriggers.com> Subject: Re: [MacPerl] Shuck and Print >At 21.39 -0400 1999.04.08, Dave Johnson wrote: >>I've been working on other things for a while and I am >>now getting back to working with MacPerl. One thing has >>always mystified me. Why does Shuck not have a Print >>command? > >Why is the sky blue? :) Rayleigh scattering. :) George ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Thu, 08 Apr 1999 21:11:33 -0700 From: "Mark Yannuzzi" <myannuzzi@aya.yale.edu> Subject: Re: [MacPerl] Mac::Navigation glue - ---------- >From: "Quentin Smith" <macmania@bit-net.com> >To: MacPerl List <mac-perl@iis.ee.ethz.ch> >Subject: [MacPerl] Mac::Navigation glue >Date: Thu, Apr 8, 1999, 2:30 PM > > On the recent topic of Nav Services, I have written a "glue" for the > Mac::Navigation" module. Name the module "NavServices.pl" and put it in your > site_perl folder. To test it, use the following script: > <snip> > $nav = NavGetFile($default, $options, $types, sub {use > Mac::Events;Mac::Events::DispatchEvent($_[1]->event);}); <snip> Thanks for the module, it has clarified some things that I have been struggling with (such is life when trying to learn Mac toolbox programming, C/C++ and MacPerl simultaneously). Namely, I was trying simply to get the NavGetFile dialog to be movable, and resizable. The simplest way I found wa to give it a dummy eventProc subroutine, but the dialog would not always update itself properly. The subroutine: sub {use Mac::Events;Mac::Events::DispatchEvent($_[1]->event);} seems to have cured most of the anamolies I was observing, but not all. A few questions: 1) Why must the use Mac::Events statement appear within the embedded subroutine in order to work properly? I tried placing it at the beginning of my script with my other use statements, and got an error saying DispatchEvent subroutine was undefined. Is this, in general, necessary when calling 'external' module functions/structures in embedded subroutines? 2) What "entity" does DispatchEvent contact to notify the dialog to handle the current event (I assume it is the NavGetFile's handlers that need to be executed), the system? the dialog directly? 3) Has anyone who has tried NavServices.pl observed that the cursor becomes "jumpy", or turns into a MacPerl Camel with a spinning wheel? 4) I have also been using NavPutFile, which displays a movable, resizable dialog by default. It does not suffer from the cursor anamolies that I observe with NavGetFile, and additionaly the shareware Default Folder 3.0.1 modifies the navigation buttons in the dialog as I would expect, which is nice. This does not happen with NavGetFile, and coupled with the cursor problem leads me to wonder whether a) something else needs to be added to the eventProc subroutine, or b) maybe there is a bug in Navigation.pm. Any thoughts? - ---------------------- Mark J. Yannuzzi myannuzzi@aya.yale.edu ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Fri, 9 Apr 1999 00:49:28 EDT From: Awrcomp@aol.com Subject: [MacPerl] Net::FTP Problem Trying to use Net::FTP with MacPerl. At this point my program simply looks like this: #!/usr/local/bin/perl -w use Net::FTP; print "That's all folks!\n"; When run, I get the error messages list below. I'm using the release right off the CD from MacPerl Power and Ease and there is a FTP.pm file in the lib/Net folder. What do I not know? Thanks! Andrew Robinson # Ambiguous use of {index} resolved to {"index"}. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:InternetConfig.pm'; Line 501 # Ambiguous use of {index} resolved to {"index"}. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:InternetConfig.pm'; Line 503 # Ambiguous use of {index} resolved to {"index"}. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:InternetConfig.pm'; Line 509 # Use of uninitialized value. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:Types.pm'; Line 68 # Use of uninitialized value. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:Types.pm'; Line 68 # Use of uninitialized value. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:Types.pm'; Line 68 # Use of uninitialized value. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:Types.pm'; Line 68 # Use of uninitialized value. File 'SuperMac™ HD:Developer:MacPerl :lib:Mac:Types.pm'; Line 56 That's all folks! # Use of uninitialized value during global destruction. ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: 09 Apr 1999 07:25:17 +0200 From: Matthias Neeracher <neeri@iis.ee.ethz.ch> Subject: Re: [MacPerl] Shuck and Print In article <v03102801b3330a537789@[207.86.230.144]>, Dave Johnson <dave_johnson@ieee.org> writes: > I've been working on other things for a while and I am > now getting back to working with MacPerl. One thing has > always mystified me. Why does Shuck not have a Print > command? Because the human lifespan is incommensurate with the task of maintaining MacPerl. Because I'm rarely around printers. Because I prefer pod2ps for printing pod. Because I wanted to make Shuck as small as possible. Matthias - -- Matthias Neeracher <neeri@iis.ee.ethz.ch> http://www.iis.ee.ethz.ch/~neeri "And that's why I am going to turn this world upside down, and make of it a fire so *bright* that someone real will notice" -- Vernor Vinge, _Tatja Grimm's World_ ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Fri, 9 Apr 1999 11:37:54 +0100 From: ajf@afco.demon.co.uk (Alan Fry) Subject: Re: [MacPerl] Mac::Navigation glue Quentin Smith writes Thu, 08 Apr 1999 17:30:54 -0400: [snip] >print &GetFiles("Select some files to open.", undef, qw[TEXT ttro]); [snip] >$nav = NavGetFile($default, $options, $types, sub {use >Mac::Events;Mac::Events::DispatchEvent($_[1]->event);}); [snip] I believe there are two bugs in Navigation.pm which are relevant: 1 Only the first element in the list of types is recognised. The error is in Navigation.pm which inserts spurious white spaces into the list handle ('NavTypeListHandle'). 2 *Any* EVENTPROC in 'NavGetFile()' results in a serious memory leak at about 240K per minute continuously while the dialog is onscreen. Leaked memory is not reclaimed when the window is closed, so that "Out of memory" crashes can occur quite frequently. The first bug is easily fixable (see sister-list [macperl-modules], 31 March, "Using Mac::'...'Modules"), the second is more difficult. Since EVENTPROC has to be called before either PREVIEWPROC or FILTERPROC, neither of these is usable without incurring the memory leak from EVENTPROC. Mark Yanuzzi writes Thu, 08 Apr 1999 21:11:33 -0700: >Has anyone who has tried NavServices.pl observed that the cursor becomes >"jumpy", or turns into a MacPerl Camel with a spinning wheel? > >This does not happen with NavGetFile, and coupled with the cursor >problem leads me to wonder whether a) something else needs to be added to >the eventProc subroutine, or b) maybe there is a bug in Navigation.pm. Any >thoughts? I think the cursor behaviour is associated with bug 2 -- MacPerl is busy eating pointer space. I would like to tinker with Navigation.xs to see if (however unlikely) I can do anything to improve it. However my attempts to build the evisting Navigation.xs have all failed at the 'compile' stage. I'm pretty sure I have not got the 'typemap' right. If the 'typemap' for Navigation.xs could be made available it would be a great help. Alan Fry ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ End of MacPerl-Digest V1 #39 **************************** ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to ==== macperl-digest-request@macperl.org