Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

trouble with calculated AppleScript; escaped quotes

Featured Replies

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

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

  • 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

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

  • 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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.