Filemaker finding a recorld

Hi all,

Hopefully my final hurdle on this script!

I am trying to update the entries for the files I have processed. It works fine for the first one but does not repeat the find to find the second one from the version list.

set JobNumber to 88888
set countFileIn to 2
set VersionList to {"Prem", "WEL"}
set lprLocalName to "Printer"
set FilemakerTimeStamp to "18/06/2013 04:34:00"
set lprZPwd to "ZipFilePassword"



tell application "FileMaker Pro"
	
	--Check to see if database is already open, if not then open.
	if database "CTP_Log_17" exists then
		go to database "CTP_Log_17"
	else
		getURL "fmp://192.168.11.111/CTP_Log_17"
		delay 2
	end if
	
	--Finds the job record in filemaker
	tell database "CTP_Log_17"
		do script "Go to job log"
		delay 1
		show (every record whose cell "Job Number" = JobNumber)
	end tell
	
	--Gets the unique serial number of the job record
	tell document "CTP_Log_17"
		set SerialNumber to get data cell "Serial Number"
	end tell
	
	tell database "CTP_Log_17"
		do script "Go to Version Sheet"
		delay 1
	end tell
end tell

repeat with i from 1 to countFileIn
	set VersionName to (item i of VersionList)
	tell application "FileMaker Pro"
		do script "Go to Version Sheet"
		delay 1
		tell database "CTP_Log_17"
			show (every record whose cell "Job Log Rel" = SerialNumber and cell "CTP Artwork Name" = VersionName)
			end tell
			find
		end tell
		tell document "CTP_Log_17"
			set cell "Outwork Printer" to lprLocalName
			set cell "Artwork Sent" to FilemakerTimeStamp
			set cell "FTP PAssword" to lprZPwd
		end tell
	end tell
end repeat

tell application "FileMaker Pro"
	do script "Go to job log"
	delay 1
	show (every record whose cell "Job Number" = JobNumber)
end tell

If any of you kind people could help me out that would be great.

Cheers
Andy

Not sure exactly what you’re trying to do. Maybe of help: There is a difference between “cell” (a field on a specific record) and a “field” (a list of all the data in a particular field in the found set). A found set can be referred to as a document. You can go to a particular layout and step thru the found set and set cell values if that’s what you’re trying to do.

On this command

tell document “CTP_Log_17”
set SerialNumber to get data cell “Serial Number”
end tell

try

tell document “CTP_Log_17”
set SerialNumber to get data cell “Serial Number” of current record
end tell

What my over all script is doing is as follows:

Ask the user for a job number
Take the user to the job folder and get them to select a file/s that need to be uploaded to an outwork printer (can be multiply files)
Zip those files up
upload to FTP site
mark each version in filemaker that it has been uploaded. This is where I am struggling with the repeat as it needs to find each version and mark it from the originally selected PDFs. Currently it only does the first version (PDF selected)

I have all the steps listed so far working correctly its just this last bit in filemaker that is not playing nicely with me.

Cheers
Andy

HI

Without trying this out there are some things that dont feel right.

This part of the script might work if the following is tried (in the comments)


 tell application "FileMaker Pro"
       do script "Go to Version Sheet"
       delay 1
       tell database "CTP_Log_17"
           show (every record whose cell "Job Log Rel" = SerialNumber and cell "CTP Artwork Name" = VersionName)
           end tell
           find  --not sure why this command is in as the show command will find the record
       end tell
       tell document "CTP_Log_17"  --go to layout theLayout  would be a better way of Filemaker finding the layout on which the info you need is on
           set cell "Outwork Printer" to lprLocalName  --of current record
           set cell "Artwork Sent" to FilemakerTimeStamp  --of current record
           set cell "FTP PAssword" to lprZPwd   --of current record
       end tell
   end tell


I feel that the tell document “CTP_Log_17” line is only returning the info for the first record in that document

Hi all,

Thanks for the replies.

I have finally figured it out.

I needed to put the line:

show (every record whose cell "Job Log Rel" = SerialNumber and cell "CTP Artwork Name" = VersionName)

in a tell table bit for it to perform the show which results in it finding one record only.

Cheers
Andy