Re: FileMaker styled text
Re: FileMaker styled text
- Subject: Re: FileMaker styled text
- From: EBI Aktivitet <email@hidden>
- Date: Sat, 14 Jun 2003 14:40:09 +0200
Den 03-06-13 11.57, skrev "Kai" <email@hidden>:
>
on Fri, 13 Jun 2003 04:45:15 +0100, I wrote:
>
>
> When a cell is given a new value, it normally adopts the text style defined
>
> (in layout mode) for that field. However, if the style in a particular
>
> record has been altered (in browse mode), and you want to retain the
>
> modified style, you could try going to the cell first...
>
>
BTW, if that doesn't fix the problem, you may have an issue with Unicode or
>
styled text from the source of your new value. In that case (and if you
>
haven't already done so), then follow up on Gary's advice.
>
>
And if _that_ doesn't work (or perhaps even if it does), let us know. (Since
>
a symptom may sometimes be attributed to a variety of causes, it's generally
>
easier to diagnose when the offending code, or a snippet that replicates the
>
problem, is included.)
Feel ridiculous, but I couldn't follow Gary's advice, since the list
archives wouldn't let me in... Tried the same user/password as for my list
administration, but no luck!
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.
--Sample 1, text style preserved--
tell application "FileMaker Pro"
tell database "Test.fp5"
set cell "text" to "ABC123"
end tell
end tell
--Sample 2, text style changed--
set theFileToDownload to
"//Exporter_till_sfoto.se_FLYTTA_EJ/SFF_MedlemWWWUppdatering.txt"
set theFileToRead to ((theFileToDownload as POSIX file) as text)
set savedTextItemDelimiters to AppleScript's text item delimiters
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
set AppleScript's text item delimiters to tab
tell application "FileMaker Pro"
tell database "Test.fp5"
set cell "Text" to text item 1 of ((paragraph 1 of
theUpdateRecords) as text)
end tell
end tell
--finally, reset the text item delimiters:
set AppleScript's text item delimiters to savedTextItemDelimiters
on error m number n from f to t partial result p
--also reset text item delimiters in case of an error:
set AppleScript's text item delimiters to savedTextItemDelimiters
try
close access theFile
end try
--and resignal the error:
error m number n from f to t partial result p
end try
--
Regards, Adim Lundin
_______________________________________________
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.