• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Exporting a text field from Filemaker into a text or rtf file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exporting a text field from Filemaker into a text or rtf file.


  • Subject: Exporting a text field from Filemaker into a text or rtf file.
  • From: Gregory White <email@hidden>
  • Date: Thu, 26 Jul 2007 17:01:56 +1000

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.

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Exporting a text field from Filemaker into a text or rtf file.
      • From: Malcolm Fitzgerald <email@hidden>
  • Prev by Date: Re: Index list from the Finder
  • Next by Date: Re: AppleScript-Users Digest, Vol 4, Issue 347
  • Previous by thread: Re: Index list from the Finder - with Size
  • Next by thread: Re: Exporting a text field from Filemaker into a text or rtf file.
  • Index(es):
    • Date
    • Thread