Re: Small FileMaker script needed!!!
Re: Small FileMaker script needed!!!
- Subject: Re: Small FileMaker script needed!!!
- From: Cornwall <email@hidden>
- Date: Tue, 23 Jul 2002 21:43:30 -0700
At 12:42 AM +0200 7/24/02, Milos Urosevic wrote:
>
I need probably small script that will export current record to a
>
tab-delimited text on desktop, always with same name that will overwrite
>
existing file without prompt.
At 9:02 PM -0400 7/23/02, Tim wrote:
>
Actually you can use FileMaker scripting to achieve this much easier. First
>
do the export as you wish it to be. Then create a FMP script to "export
>
records" checking the without prompt box and save to file boxes.
Additional FMP script steps are needed to isolate the current record
if it is a member of a set of records. Otherwise you get the entire
found set of records exported. Probably have to do a find step using
some unique identifier in the record. Then, if you were working with
a found set at the outset, you might like to get that back after the
export.
I don't know. That is starting to sound too hard. Perhaps there is a
much easier way(?), but this AppleScript should do it (if I
didn't miss anything).
tell application "FileMaker Pro"
cells of current record returning theList
end tell
set AppleScript's text item delimiters to "%$#"
set theTxt to theList as text
set AppleScript's text item delimiters to return
set theList to theTxt's text items
set AppleScript's text item delimiters to ""
set theTxt to theList as text
set AppleScript's text item delimiters to "\""
set theList to theTxt's text items
set AppleScript's text item delimiters to "\"\""
set theTxt to theList as text
set AppleScript's text item delimiters to "%$#"
set theList to theTxt's text items
set AppleScript's text item delimiters to "\",\""
set theTxt to theList as text
set theTxt to "\"" & theTxt & "\"" & return
set filePath to (path to desktop folder as string) & "Wangdoodles "
try
close access filePath
end try
try
set fRef to open for access file filePath with write permission
set eof of fRef to 0
<<event rdwrwrit>> theTxt given <<class refn>>:fRef, <<class wrat>>:<<constant rdwreof >>
close access fRef
on error
close access fRef
end try
-- "<<" and ">>" are (ASCII 199 and 200).
Corny
_______________________________________________
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.