Skip 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.

Quotation marks in a calculated AppleScript

Featured Replies

Hello, the following is the essence of a problem I need to resolve. The code is AppleScript 

display dialog "Hello \"world\" " 

This code needs to run in FMP18 as a calculated applescript.

image.png.aead9334bd20459f7284dced4987a41f.png

I tried:

Perform AppleScript [display dialog \"Hello "world" \"] 

Perform AppleScript [display dialog \"Hello \""world"\" \"]

Perform AppleScript [display dialog \"Hello "\"world"\" \"]

Perform AppleScript [display dialog \"Hello \""world\"" \"]

and other permutations of 1 backslash and 2 quotation marks cause the calculation to be unsavable b/o error.

Perform AppleScript [display dialog \"Hello \"world\" \"] results in "A identifier can’t go after this “"”." -- after the calculation is saved. (Yes, "A identifier")

Perform AppleScript [display dialog \"Hello \"\"world\"\" \"] results in A “"” can’t go after this “"”. -- after the calculation is saved

and an error message of -2740.

Can anyone help me please?

Spoiler

 

 

image.png

Edited by Asu
added last line

Enter this into FileMaker's calculation dialog ( in the 'Calculated AppleScript' dialog ).

"display dialog \"Hello \\\"world\\\"\""
  • " - opening quote required for text in FileMaker
  • display dialog - applescript command
  • \" - escaped quote mark reduces to a " when evaluated by FileMaker.
  • Hello - the string to appear inside the quoted string being fed to the AppleScript.
  • \\ - an escaped backward slash, that reduces to a single backward slash when evaluated by FileMaker.
  • \" - an escaped quote, that pairs with the previous backward slash, to open the string to pass to the AppleScript command.
  • world - string for inside the escaped quotes to feed into AppleScript.
  • \\ - an escaped backward slash, that reduces to a single backward slash when evaluated by FileMaker.
  • \" - an escaped quotation mark, that pairs with the previous backward slash, to form an escaped quotation mark to pass to AppleScript.
  • \" - another escaped quotation mark to close the string to pass into the AppleScript command.
  • " - closing quote required for text in FileMaker.

 

Visually it looks like this ( red characters reduce down when evaluated in FileMaker 😞

"display dialog \"Hello \\\"world\\\"\""

The easy way to solve such problems is to:

1. Enter the "native" version of your AppleScript into a text field:

display dialog "Hello \"world\" " 

2. Open the Data Viewer and enter:

Quote ( YourTable::Textfield )

3. Paste the result into your calculated AppleScript formula:

"display dialog \"Hello \\\"world\\\" \" "

 

Edited by comment

  • Author

Thank you, guys!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.