September 16, 200421 yr Newbies I'm having a problem entering a value into a FM7 request from applescript. The script I have, basically, is: on run set myfilename to "Testname.mov" tell application "FileMaker Pro 7.0" tell database "EPICPhotographs" show every request delete every request set myrequest to create new request show myrequest set cell "filename" of myrequest to ("==" & myfilename) as string find try return cell "header" of current cell on error return "" end try end tell end tell end run the cell "filename" is a calculated field in the database. when I run this script, I get: "FileMaker Pro 7.0 got an error: Write access denied." when I run: return protection of cell "FileName" of myrequest I get "formulas protected", and when I run: return access of cell "FileName" of myrequest I get "read/write/delete". This is the method of searching I've used in the last n versions of FMP, and it's always worked, until now. how can I make my request modifiable so I can input data into this field? Alternately, I was trying to use : show (records whose cell "FileName" is myfilename) but I don't know how to detect a failed search from Applescript/AppleEvents in this case. Any help would be greatly appreciated! Craig
September 17, 200421 yr Are you doing this inside Filemaker or in an external script? Also, perhaps this is just a type but: return cell "header" of current cell doesn't make any sense. Maybe you mean: return cell "header" of current record You don't need to show the requests. "Alternately, I was trying to use : show (records whose cell "FileName" is myfilename)" Several things at issue here. Unless you SPECIFY database you are referring to the document - the found set. So if your found set doesn't contain any matching records the statement above won't find them. You may want to say get ID of every record of database 1 whose cell "Filename" is myFileName copy result to IDList set foundCount to count of IDList if foundCount = 0 -- do whatever end if
Create an account or sign in to comment