December 25, 20196 yr 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. 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 Edited December 25, 20196 yr by Asu added last line
December 25, 20196 yr 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\\\"\""
December 25, 20196 yr 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 December 25, 20196 yr by comment
Create an account or sign in to comment