I am creating a new Applescript Studio application so that my users can submit a tech request that will be entered into a database I have created. The interface is simple. The person just enters a username and problem into a respective text field and then selects a priority from a combo box. The code I use to enter the information into the database is as follows:
tell application "FileMaker Pro"
set theRecord to create new record at the end of the records
try
if theName is not "" then
set cellValue of cell "userName" of theRecord to theName
else
set theName to cellValue of cell "userName"
end if
if theProblem is not "" then
set cellValue of cell "problem" of theRecord to theName
else
set theProblem to cellValue of cell "problem"
end if
if thePriority is not "" then
set cellValue of cell "priority" of theRecord to theName
else
set thePriority to cellValue of cell "priority"
end if
on error
delete theRecord
tell me to display dialog "FileMaker refused to insert the new entry." buttons {"Abort"} default button 1
return
end try
end tell
When I click the submit button on the application, i get the following (very unhelpful error: NSReceiverEvaluationScriptError: 4 (1).
Any help would be appreciated