MACSCRPT Archives

October 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chuck Pelto <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 14 Oct 2008 11:04:17 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (94 lines)
So I've discovered that show every record whose cell....doesn't work  
all that well in the new FMP9a AppleScripting Events.

They've got something called "Find" and the syntax is as follows:

	tell application "FileMaker Pro Advanced"
		
		try
			delete every request
		end try


		try
				
			create request
			set cell cellName of request 1 to cellData
			find
				
		on error errMsg number errNum
				
			set theError to errMsg
				
			set recID to 0
				
		end try

So what do you do when you want to search on multiple criteria? As in  
two fields with two datum?

I tried THIS...

	tell application "FileMaker Pro Advanced"
		
		try
			delete every request
		end try
		
		
		-- find the record we want to update
		
		set xCount to 1
		
		repeat until dataList is equal to {}
			
			set thisData to item 1 of dataList
			set dataList to rest of dataList
			
			set cellName to item 1 of thisData
			set cellData to item 2 of thisData
			
			try
				
				create request
				set cell cellName of request xCount to cellData
				find
				
			on error errMsg number errNum
				
				set theError to errMsg
				
				set recID to 0
				
			end try
			
			set xCount to (xCount + 1)
			
		end repeat
		
		set recID to cell "RecordID" of current record
		
		set recCount to (count of records in current table)
		
	end tell
	
It doesn't work.

Instead of finding the one record I'm looking to find, it finds  
multiple records with the data from the last request only.

If I try a variation where the 'find' is called after all the  
criteria have been loaded, e.g.,

				if dataList is equal to {} then
					find
				end if
				
I get the same results, whatever was the last request criteria entered.

What's the new approach on how to deal with multiple search requests?

Regards,

Chuck

ATOM RSS1 RSS2