Jump to content

repost scripting export from FMPro


This topic is 8549 days old. Please don't post here. Open a new topic instead.

Recommended Posts

It looks like you've set up your script to return a list of records to whatever called the script in the first place, rather than telling Filemaker to just find the records. If there a lot of records in the found set, that would explain the out of memory problem.

I think what you really want to do is this:

code:


tell application "FileMaker Pro"

delete every request

create request

set cell "DiscoveryId" of request 1 to "JEFF FOOTT.00001"

find

end tell


or:

code:


tell application "FileMaker Pro"

-- find all records

show every record of database 1

-- find a group of records

show (every record of database 1 whose cell "DiscoveryId" contains "JEFF FOOTT.00001")

end tell


Now, for the big question. Do you really need to use all this Applescript? Why not just make regular Filemaker scripts to do the finding and exporting?

If you are initiating this from another application, just use the 'Do Script' event and put all of your finds and exports into a regular Filemaker script.

Link to comment
Share on other sites

I am creating a script that will select a series of records based on one field, and export selected fields to one text file (delimited) and all fields to another text file...I am just starting with it and am using the "get" method, and am getting memory errors (108), and cannot figure out why...any help???

tell application "FileMaker Pro"

every cell of current record

end tell

also...

tell application "FileMaker Pro"

cell "Description" as text

every record whose cell "DiscoveryId" = "JEFF FOOTT.00001"

Link to comment
Share on other sites

Well, I want to use AppleScipt for two reasons...first, the find "function" requires a continue once it has returned the results. Secondly, I am wanting to export two different flat files for each search result...one with fewer records than the other and a sub search of that one...i ended up figuring it out, and have included the code below, if anyone could use it...I think that it came out very well...opinions???

tell application "FileMaker Pro"

set CDID_Box to display dialog "Please enter the desired CD to export:" default answer ""

set CDID to text returned of CDID_Box

show (records where cell "CD ROM Number" contains CDID)

set number_of_matches to count records

set target_file_name to

Link to comment
Share on other sites

Regarding the 'continue' after the find, I assume you mean the script pauses when you use the 'find' step in a filemaker script. This is a default option which can be turned off. Just uncheck the pause option that appears at the bottom of the scriptmaker window when you add the find command.

Link to comment
Share on other sites

This post is for Bob Weaver. How did you get your applescript examples to display so perfectly (with all the indents and such)? I have posted applescript examples to this forum by just typing them in. When they display, all the indents are gone. Yours looked very cool!

Link to comment
Share on other sites

This topic is 8549 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.