[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Drag & Drop Text Selection to Droplet Question



> Hello all,
> 
> The other day I posted a question and it was answered very quickly - I
> appreciate it!  Here I go again with another similar but different question.
> Todays question is:
> 
> How does MacPerl process a text selection that has be dropped on a droplet?
> 
> Can this be done?  Does the Mac handle the selection as a file
> (type/creator) or some chunk of memory?

You cannot directly drag a text selection onto a droplet.

You can, however, drag a text _clipping_ onto a droplet and it will be
seen as a file.

TEXT resource 256 will contain the text of the clipping.

Sample droplet:

#!perl -w

use Mac::Resources;
use Mac::Memory;

foreach $IN (@ARGV) {
  print "\nFile: $IN\n";

  $rs = OpenResFile $IN or die $^E;
  $dh = Get1Resource "TEXT", 256 or die $^E;
  print $dh->get;
  CloseResFile $rs;
}

close IN;

__END__

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch