At 22:21 +0900 2001-03-19, Nobumi Iyanaga wrote:
>On the other hand, if there is a way to pass "styl" and "TEXT" data to
>MacPerl as @ARGV data, we would be able to write an AppleScript script
>looking like this:
>
>set stxt to ""
>tell application "Style"
>       set stxt to selection of front document as styled text
>end tell
>
>set stxtRecord to stxt as record
>set txt to <<class ktxt>> of stxtRecord
>set styl to <<class ksty>> of stxtRecord
>
>tell application "MacJPerl"
>       activate
>       set res to Do Script {"my_read_StyledText.pl", txt, styl} mode Batch
>end tell

You could do that with Sigmas Coercions, a free Scripting Addition.

    http://members.home.net/eric-allen-grant/Sigmas-Coercions.sit.hqx

tell application "MacJPerl"
    activate
    set res to Do Script {"my_read_StyledText.pl", txt, styl as hex string}
mode Batch
end tell

In MacPerl, you would have to decode the hex string.

    my $styl = pack 'H*', $ARGV[1];

Gero Herrmann
Niigata, Japan

Reply via email to