What's wrong with this sript?

Hi I am trying to Open a FILEMAKERPRO script and according to the dictionary this should work but it doesn’t.
Any Help highly appreciated
Thanks


set theDatabase to choose file with prompt "Please locate a FileMaker Pro database"
tell application "FileMaker Pro Advanced"
	open theDatabase
end tell
tell theDatabase
	do script "Open Save Attachment"
end tell

Hi,

some issues:

the do script part must be in the Filemaker tell block
theDatabase is an alias specifier, later it’s supposed to be to be the database object in Filemaker.
You have to assign the database object explicitly to the variable

Try this


set databaseFile to choose file with prompt "Please locate a FileMaker Pro database"
tell application "FileMaker Pro Advanced"
	open databaseFile
	set theDatabase to database 1
	tell theDatabase
		do script "Open Save Attachment"
	end tell
end tell

Thanks Stefan
It now works fine
The purpose of the script is to open images attachment in preview and this happens
The second part of the script is as follows


tell application "FileMaker Pro Advanced"
	set theDatabase to database 1
	tell theDatabase
		do script "CopyStudent_ID"
		do script "Open Save Attachment"
		delay 8
	end tell
end tell
tell application "Preview"
	activate
end tell
tell application "System Events"
	tell process "Preview"
		click menu item "Save" of menu "File" of menu bar 1
		delay 8
		paste
		keystroke return
		click menu item "Close Window" of menu "File" of menu bar 1
	end tell
end tell
tell application "FileMaker Pro Advanced"
	
	tell theDatabase
		do script "Omit"
		delay 3
	end tell
end tell

The script copies the "Student ID field to the clipboard then opens the image in Preview
Still even if I put a very long delay it always gives me this error
System Events got an error: Can’t get menu item “Save” of menu “File” of menu bar 1 of process “Preview”.

How can I save the Preview window as TIFF using the clipboard content as the new Image name?

Thanks

the correct menu item reference is


menu item "Save" of menu 1 of menu "File" of menu bar 1 of process "Preview"

Thanks again
but now the error changed
System Events got an error: Can’t get menu 1 of menu “File” of menu bar 1 of process “Preview”. Invalid index.
In the events I get this
Invalid index." number -1719 from menu 1 of menu “File” of menu bar 1 of process “Preview”

What to do?
The clipboard loads the new file name and the image is on my screen in Preview but the script doesn’t g tp the next step

sorry my fault, try this syntax


activate application "Preview"
tell application "System Events"
	tell process "Preview"
		click menu item "Save" of menu 1 of menu bar item "File" of menu bar 1
	end tell
end tell