Re: Exporting a text field from Filemaker into a text or rtf file.
Re: Exporting a text field from Filemaker into a text or rtf file.
- Subject: Re: Exporting a text field from Filemaker into a text or rtf file.
- From: Malcolm Fitzgerald <email@hidden>
- Date: Fri, 27 Jul 2007 12:16:57 +1000
On 26/07/2007, at 5:01 PM, Gregory White wrote:
Hello,
I have a script that saves a text field from filemaker to a text
file. Currently it is saved as text with a .txt extension.
I wish to have the script save the text as .rtf. I can see how to
change the file extension, but I don't know how to do the rest.
Any help would be greatly appreciated.
What's your question?
You can get styled text out of Filemaker or you can get plain text
out. Once you've done that it's a question of what you want do with
it. Is your question "How do I generate an RTF file from the styled
text I got from Filemaker?"
malcolm
Kind regards,
Greg.
tell application "Finder"
set homeFolder to (home)
set D_folder to folder "Documents" of homeFolder
end tell
tell application "Finder"
if not (exists folder "ReferenceWorks Bookmaker" of D_folder) then
make new folder at D_folder with properties {name:"ReferenceWorks
Bookmaker"}
end if
end tell
tell application "FileMaker Pro Advanced"
set {fileName, this_Book} to {get data of cell "FileName" of
current record, get data of cell "CompleteBook_cc" of current record}
end tell
set homeFolder to path to home folder as Unicode text
set BookmakerFolder to homeFolder & "Documents:ReferenceWorks
Bookmaker:"
set this_file to BookmakerFolder & fileName & ".rtf"
-- I have chaned the .txt to rtf.
my write_to_file(this_Book, this_file, false)
on write_to_file(this_data, this_file, append_data)
try
set the target_file to the this_file as text
set the open_target_file to ¬
open for access file target_file with write permission
if append_data is false then ¬
set eof of the open_target_file to 0
«event rdwrwrit» this_data to the open_target_file starting at
eof -- call "write" using raw code: «event rdwrwrit»
close access the open_target_file
return true
on error errMsg number errnum
display dialog errMsg & return & errnum
try
close access file target_file
end try
return false
end try
end write_to_file
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
@pacific.net.au
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden