Text taken from Safari webpage "looses" its line breaks in Filemaker

I need to parse bibliographic database text (in MARC like format) in my Filemaker database

so I wrote the following script and some variations

tell application “Safari”
set BibSource to text of document 1 as text
activate
end tell
tell application “FileMaker Pro Advanced”
set data cell “xBiblioCode” of current record to BibSource as text
activate
end tell

It works… except the fact that whatever I tried I loose all the line breaks…

Strange enough, when I copy & paste the date Applescript has put in my Filemaker record, in a text editor (TextWrangler)
the line breaks once more appear…

Somehow my guess is this has to do with setting delimiters or whatever (and I am a low level applescripter in all this)

Anybody who can tell me what I do wrong ???

below is text example

Uw kommando was

zoeken [of] (alle woorden) Logan cop. 2004 The alphabet effect

Er zijn 626632 treffers.

Dit is treffer 2.

0000 11
0200 0003:20-06-04
0210 1001:22-03-05 16:15:13.000
0230 1001:25-01-05
000K utf8
000A 0
5300 1001
0500 Aax4
0100 265095085
2000 1572735228cloth
2001 1572735236
pbk.
2040 2004051516
1500 /1eng
1100 2004 $ cop. 2004
1111 Db
1200 Bf
1700 /1us
4204 Includes bibliographical references and indexes
4000 The @alphabet effect : a media ecology understanding of the making of
Western civilization / Robert K. Logan
3000 Robert K.@Logan1939-
4030 Cresskill, N.J : Hampton Press
4060 xiv, 265 p
4062 23 cm
4061 ill
4170 The @Hampton Press communication series $ Media ecology
4180 #loga#!248066625!The @Hampton Press communication series, Media ecology
5500 <0>Alphabet % History
5500 <0>Writing % History
5500 <0>Civilization % History
5401 !07866067X!Schrift
5402 !078428793!Alfabetten
5403 !078478103!Culturen
5404 !078958687!Het @Westen
5431 !088143147!Geschiedenis (vorm)
5030 P211 - .L7298 2004
5010 #22#411
5301 !077592433!02.01 geschiedenis van wetenschap en cultuur
4900 25-01-05 07:58:03.000
0247 utf8
3430 !271404345!Robert K. Logan (1939-)
7001 22-03-05 : obUMk–9
7900 22-03-05 16:15:13.000
0248 utf8
7800 428019900
4864 pbk
7100 UBM: H 05-237 @ u
4702 e
4702 cat.: 25-01-05
4702 contr.: 25-01-05

Browser: Safari 312
Operating System: Mac OS X (10.3.9)

I’d try converting all the line ends to a character that FMP recognises as a line end (either return or ASCII character 10), Tjebbe ” perhaps something like this:


to convert_line_ends(txt, char)
	set tid to text item delimiters
	set text item delimiters to char
	tell txt's paragraphs to set txt to beginning & ({""} & rest)
	set text item delimiters to tid
	txt
end convert_line_ends

tell application "Safari"
	set BibSource to my convert_line_ends(text of document 1 as text, return)
end tell


Thanks
an awful lot!
I tried your script and it worked flawless
I have the text neatly as in the origina; and can start writing my Fielmaker Pro+Troi text plug-in scripts to generate neat bibliographical data…

tjebbe