Two remarks:

1. It seems to me that the following scriptlet is not a
proper Apple Script:
   "set stxt to the clipboard as styled text
     set stxtRecord to another data of stxt but type is record
     set txt to <<class ktxt>> of stxtRecord
     set stl to <<class ksty>> of stxtRecord
     stl"
My proposal: Write this script in a way that anyone can run it.

2. Inside Macintosh, Text Manager,
contains a comprehensive description of text styles; maybe
that could be helpful.




Nobumi Iyanaga wrote:

> Hello,
>
> I want to read and process StyledText data that I will get from the
> clipboard in MacPerl.
>
> I know that StyledText data can be splitted in to a record of "ktxt" data
> and "ksty" data.  The following AppleScript script:
>
> set stxt to the clipboard as styled text
> set stxtRecord to another data of stxt but type is record
> set txt to <<class ktxt>> of stxtRecord
> set stl to <<class ksty>> of stxtRecord
> stl
>
> returns something like this:
>
> <<data styl000F00000000000D000A00030100000A0000000000000000000...>>
>
> I have a MacPerl script which gets the 'styl' resource from a file (of
> SimpleText type), and analyses it (it is a friend of mine who wrote this
> script); what I would like to do is:
>
> write an AppleScript script (or a Frontier script) which would...:
>
> 1.  get some StyledText data from the clipboard;
> 2.  split this data into a TEXT data and a styl data
> [------ These steps are done by the above script]
> 3.  pass them to a MacPerl script in this way:
>     tell application "MacPerl"
>        set res to do script {scriptPath, TEXT_data, styl_data} mode Batch
>     end tel
> and get the result.
>
> Is this possible?  I would appreciate any thoughts.
>
> Thank you very much in advance.
>
> Best regards,
>
> Nobumi Iyanaga
> Tokyo,
> Japan

Reply via email to