December 2, 200421 yr Heres the jist of my script: --tell current record of window 1 pull some variables ---tell application "Finder" do finding of files, pattern search etc return value XXX (a string of text) ---end tell ---Tell application "FileMaker" set cell foobar to XXX ---end Tell --end tell The set cell foobar fails EVERY time. (its a text cell) It quietly doesnt set the cell. When ive tried adding explicit commands to the active window etc i get the "data in use" error or "field not found" message. The problem has to be either my syntax or filemaker, as i have coded the script to put the value XXX into text editors, email program etc. Filemaker isnt setting the ******* cell. Whats wrong with my tell FIlemaker step? PS This simple script on its own always works!!!: --tell current record of window 1 set cell foobar to whatever --end tell
December 2, 200421 yr ...two things: - a filemaker cell called foobar must go into "" or be referneced as a number say cell 3 - if the cursor stands in the field somewhere, a filemaker issued Commit Record is required --sd
December 2, 200421 yr Author The cell foobar is in "".... and the filemaker Commit Record should go where? Above the applescript in a seperate step? Did that, it failed. Below the applescript in a seperate step? Did that, it failed too. The cursor DOES appear in the field by the way....
December 2, 200421 yr The cursor DOES appear in the field by the way.... To rule this out try to click outside to field. One more thing I actually noticed, was a syntax: return value XXX (a string of text) I would have said i like this: Set XXX to result set XXX to XXX as text --sd
December 2, 200421 yr Author I dont think I've explained well....the problem is NOT the result of the tell Finder routine....I can put the variable into any number of other programs, display it in a pop window - anywhere EXCEPT in a Filemaker cell where i need it!! To show this, I tried chaning the section ---Tell application "FileMaker" set cell "foobar" to XXX ---end Tell to ---Tell application "FileMaker" set cell foobar to "dog" ---end Tell expecting to see the word "dog" appear in the correct cell. Guess what, it doesnt. I tried a set cell statement asking for a number - same result, failure. The applescript is NOT entering values to the database for reasons that continue to escape me.
December 2, 200421 yr Author Additional piece of weirdness: Hitting Cmd-I on the targetted cell reveals that the variable XXX IS PRESENT?: So how can it be indexed but not present in the cell itself??
December 2, 200421 yr Author HAVE CRACKED IT (bloody stupid filemaker - anyone would think they are pc users) the necessary step is to explicity tell filemaker to goto the target cell first, adding the necessary record to be added.... ---Tell application "FileMaker" go to record whatever go to cell "foobar" set cell "foobar" to "dog" ---end Tell Purrrr
December 2, 200421 yr go to record whatever and Hitting Cmd-I on the targetted cell reveals that the variable XXX IS PRESENT?: Ahhh! Thats the problem If you aren't telling which record to fill data into, is it done in the first record in the table, I thought you had an indigestable error message??? --sd
December 7, 200421 yr pjdoodd: This is always how Filemaker / applescript has always worked and you might consider reading the the Apple Events Reference which is installed with your copy of Filemaker. I believe the expression is RTFM. You MUST tell Filemaker explicitly what you want it to do. If you want the data to go into the current record, say so. You do NOT have to GO to the record and as a matter of fact you don't even need to see the record; the window can be hidden and it will still work. Your expression should look something like this: copy "some data" to cell "your field" of current record
Create an account or sign in to comment