November 11, 200619 yr I'm having difficulty setting a variable to the contents of a field in a calculated AppleScript. Any help would be appreciated. Following the mess I have now. The actual script won't be doing "display dialog"; I'm simply trying to get the variable set for now. Part of the escape and quote code was set by FileMaker after using: """" "set theThing to " & "" & myTable::myField & "" & ""¶ display dialog theThing" Ken
November 11, 200619 yr Well there might be a tiny thing in your syntax somewhere found by tinkering enough, but I would instead do like this: Let(tt=Position ( "xxxxxfield1field2field3field4field5" ; Get ( ScriptParameter ) ;1 ; 1 )/6; "set aVar to cell " & tt & "¶display dialog aVar") ...where the position statement include all field names in question padded with x's to give the correct number after the division with the longest field name ...just beware it graps the field from the first record the statement should include "of current record" or similar. The scriptparameter hands the fieldname where the value should be shown from. But I have to question the nessesity of doing it at all, when the: http://www.filemaker.com/help/ScriptsRef-254.html ...more or less does the same, are you using icon display options or trying to avoid the global field for returning values?? It might be beneficial for you to watch this video: http://www.filemakermagazine.com/modules.php?op=modload&name=News&file=article&sid=622&mode=thread&order=0&thold=0 ...hopefully are you subscriper?? --sd
November 11, 200619 yr Author Thanks for your detailed response; it helped to motivate me to push harder. I just figured it out. It is: "set theThing to " & """ & myTable::myField & """ & "¶ display dialog theThing" Regarding the ScriptsRef url, I'm simply using "display dialog" at this point to help debug the first line. I won't be using it in my final script. I've purchased a much older Matt video series; I'll review it to see (but I'm not a subscriber). Ken
November 12, 200619 yr Well I ought to have seen it right away, but I usually shy away form those syntaxes, becuase I think they disturbs the readability slightly! --sd
November 12, 200619 yr Author One slight improvement; I got rid of the part in red; it was redundant. Old way first, then the new, improved version: "set theVoice to " & """ & telephone_automation::computer_voices & ""[color:red]" & "¶ "set theVoice to " & """ & telephone_automation::computer_voices & "" ¶ Ken
Create an account or sign in to comment