Re: FileMaker styled text
Re: FileMaker styled text
- Subject: Re: FileMaker styled text
- From: EBI Aktivitet <email@hidden>
- Date: Mon, 16 Jun 2003 12:54:32 +0200
Den 03-06-14 23.56, skrev "Kai" <email@hidden>:
>
> OK, here is the code that is giving me trouble. The first sample works fine,
>
> and text style is preserved, the second sample reads from a Unicode text
>
> file, and now the text style in FM is changed.
>
>
[snip]
>
>
> --Sample 2, text style changed--
>
>
[snip]
>
>
> try
>
>
>
> --open file to read
>
> set theFile to open for access alias theFileToRead
>
> set theUpdateRecords to (read theFile as Unicode text)
>
> close access theFile
>
>
>
> --Convert from Unicode to text
>
> set theUpdateRecords to theUpdateRecords as text
>
>
Try replacing that last line above with:
>
>
-------------------------------------------------------
>
>
set {text:theUpdateRecords} to theUpdateRecords as text
>
>
-------------------------------------------------------
Fantastic! It works :-) Big thanks to all of you who helped!
However, I'm getting greedy now...
1. Kai, would you like to give an explanation on how and why your
{text:theUpdataeRecords} works? In my way of seeing this, the Style class
should still be preserved in theUpdateRecords, but maybe (obviously) I got
it all wrong...
2. Since you showed us how to get text without style (sorry, no pun
intended) into FM, I started wondering how to control the style as well.
This is what I did (checked the archives this time, finally got in...). Also
tried a number of methods to control style, with no luck at all.
--This works
tell application "FileMaker Pro"
tell database "Test.fp5"
set theTextAndStyle to cell "Text" as styled text
end tell
end tell
-->Result
STXT{
ktxt:31232,
ksty:styl(+0001000000000013000E38E000000012AAAA00000000;)
}
--This works, sample taken from list archive (slightly modified)
tell application "FileMaker Pro"
tell database "Test.fp5"
set theTextAndStyle to cell "Text" as styled text
end tell
end tell
set theStyle to (theTextAndStyle as record)'s +class ksty;
set theText to (theTextAndStyle as record)'s +class ktxt;
--End of script samples
With the last script I can now play with theStyle and theText, but I've not
managed to get them back into a styled text. As soon as I think I got the
syntax looking reasonable, script editor crashes... I did find a reference
to an OSAX that claimed to do the job, but since I'm only playing, it would
be fun doing this without an OSAX.
Any good ideas?
Best regards,
Adim Lundin
--
EBI
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.