Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

trouble with calculated AppleScript; escaped quotes


This topic is 6584 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

This topic is 6584 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.