Behavior difference from script to droplet

I have the following script:

tell application "FileMaker Pro Advanced"
	tell document "xyz.fp7"
		activate
		tell table "Table"
			tell (every record whose cell "Customer" = "ABC Hardware")
				set orderList to cell "orderNumber"
			end tell
		end tell
	end tell
end tell

set currentOrder to "12345"

if currentOrder is not in orderList then
	do something
else
	do something else
end if

For this example, “12345” is in orderList

The script works perfectly as a script.

However, as a droplet, the if statement seems to have an issue seeing the orderList, and just processes straight through as if the order number is not in orderList.

Any idea why it would work as a script. But, not as a droplet?

hi scott

I don’t have file maker, but you may try wrapping the if statement in a tell block maybe.

tell application "FileMaker Pro Advanced"
if currentOrder is not in orderList then
   do something
else
   do something else
end if
end tell

Thanks for the reply, but the if statement is independent of Filemaker.

The catalogOrders list looks like:

{"69782", "69788", "69803", "69811", "69861", "69876", "69880", "69562-R", "69861-R", "69893", "69910", "69912", "69931", "69936", "69941", "69949", "69956", "69957", "69987", "69999", "70010", "70023", "70033", "70041", "70043", "70045", "70065", "70075", "70105", "70118", "70138", "70139", "70155", "70158", "70159", "70161", "70162", "70163", "70173", "70188", "70192", "70198", "70199", "70209", "70240", "70250", "70256", "70257", "70262", "70277", "70278", "70298", "70310", "70324", "70327", "70335", "70354", "70374", "70379", "70385", "70414", "70428", "70455"}

I’m simply trying to find out if currentOrder is not in this list.

You’re not telling us what you’re putting inside your open handler. My guess is you’re doing the FM stuff there, but not the comparison. In that case, you need orderList to be either a property or global variable.

Well, I had actually thought of that and put it into the globals late yesterday. It still had no effect.

However, everything I am trying to do with this list happens within the open handler.

The script would be:


global orderList

on open theItem
tell application "FileMaker Pro Advanced"
   tell document "xyz.fp7"
       activate
       tell table "Table"
           tell (every record whose cell "Customer" = "ABC Hardware")
               set orderList to cell "orderNumber"
           end tell
       end tell
   end tell
end tell

set currentOrder to "12345"

if currentOrder is not in my orderList then
   do something
else
   do something else
end if
end open

Now, I’ve added “display dialog orderList” anywhere prior to the if statement, and it will display the list properly. I can also get it to display the proper count of the items in orderList. It’s only the if statement that does not execute properly.