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

Re: [MacPerl] floating point params with Mac::AppleEvents::Simple



At 19.49 -0500 2000.03.13, Bill Birkett wrote:
># apply Photoshop unsharp masking filter
># usage: applyPSusm($dobj, $radius, $amount, $threshold);
>sub applyPSusm {
>     # get the parameters
>     my ($dobj, $radius, $amount, $threshold) =3D @_;
>     # build the parameter string
>     my $param =3D "'----':$dobj, " .
>  =A0=A0=09"'^Typ':type(fUnM), prdt:{Rds :doub(@\), Amnt:long(\@), 
>Thsh:long(\@)}";
>     # send the Apple Event
>     do_event(qw/Indy kFlt 8BIM/, $param, $radius, $amount, $threshold);
>}

@ is used for TEXT parameters, not for long or doub.



>The following works fine when the parameters are integer values:
>
># apply Photoshop unsharp masking filter
># usage: applyPSusm($dobj, $radius, $amount, $threshold);
>sub applyPSusm {
>     # get the parameters
>     my ($dobj, $radius, $amount, $threshold) =3D @_;
>     # build the parameter string
>     my $param =3D "'----':$dobj, " .
>  =A0=A0=09"'^Typ':type(fUnM), prdt:{Rds :$radius, Amnt:$amount, 
>Thsh:$threshold}";
>     # send the Apple Event
>     do_event(qw/Indy kFlt 8BIM/, $param);
>}
>
>However, I need $radius to be floating point, which causes the above=20
>routine to >fail.
>
>Any suggestions on how to do this properly?

Try Rds :doub($radius), that may work.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey =3D ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# =3D=3D=3D=3D=3D Want to unsubscribe from this list?
# =3D=3D=3D=3D=3D Send mail with body "unsubscribe" to macperl-request@macp=
erl.org