Apple script problems

Bruce Robertson bfr at
Sun Dec 21 18:41:29 EST 2003

> Actually, as I said earlier in this thread, this is an election
> database and very large; there are 16,000 records with 25 fields per
> record.

OK. Missed that part.
>> 2. You aren't describing the runrev end of things. What is the applescript
>> in RR to make your new record? What data do you need to feed to it?
>> Tell app "FileMaker Pro"
>> Copy every record of document "xyz.fp5" to mydata
>> -- result is a list
>> -- do NOT coerce to string yet
>> End tell

> I'm not having any trouble with the RunRev end. My  problem is
> getting records from FileMaker into RunRev. The Apple Script above
> gives me the same problems. Very slow and eventually results in an
> "execution error" unless the file size is cut down.

Please describe how you are inserting the records into Runrev.

Yes, trying to copy 16,000 records to the clipboard wouldn't be a good idea,
but there are still lots of ways to approach this including getting records
in groups as previously mentioned, getting records with XML queries using
get URL, etc.

Though it isn't a good idea to copy the complete data of 16,000 records to
the clibboard or a variable, getting the ID of 16,000 records and then
working with them individually or in batches isn't a problem.

tell application "FileMaker Pro"
    copy ID of every record to temp
    count of temp
end tell
-- 20,000 record ID in 1 second


tell application "FileMaker Pro"
    copy (count of every record) to rCount
    repeat with num from 1 to rCount by 500
        set endNum to num + 499
        if endNum > rCount then set endNum to rCount
        copy records num thru endNum to x
        my RevAdd(x)
    end repeat
end tell
-- 16,000 records in 27 seconds
-- on my G4/450
-- plus any time for RevAdd

On RevAdd(recList)
-- do your stuff
End RevAdd

More information about the Use-livecode mailing list