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.

Featured Replies

I've been sending data from Filemaker to iCal but have found a problem: any field that has a ! or " in it causes an error in the Applescript to err and to stop.

I'm wondering how can I escape these characters in Filemaker? Or more importantly, how do you search/replace a quote within field contents without going character by character?

I've tried:

Substitute( Cal::Notes; """; """ )

but that doesn't actually do what it implies.

  • Author

I've been passing a lot of information back and forth between applications with Applescript. Unfortunately, when fields contain stuff like double-quotes, single-quotes, German or other Greek/special characters, Applescript doesn't like it one bit; it will result in an error and won't do what it's intended to do.

I remedied this problem by creating a custom script that takes all un-likable characters and either eliminating them or replacing them with friendly characters (u with ü, 3.14 instead of π, etc).

This script also escapes double-quotes and single-quotes, both in ASCII and in font-style curly quotes.


Substitute( Text;

[ "‘"; "'" ]; // Replace beginning curly single-quote to generic ASCII '

[ "’"; "'" ]; // Replace possessive/ending curly-single quotes to generic ASCII ' 

[ """; """ ]; // escape ASCII double-quotes

[ "“"; "“" ]; // escape first curly double-quotes first

[ "”"; "”" ]; // escape second curly double-quote second



[ "à"; "a" ]; // OPTION ` + a

[ "è"; "e" ]; // OPTION ` + e

[ "ì"; "i" ]; // OPTION ` + i

[ "ò"; "o" ]; // OPTION ` + o

[ "ù"; "u" ]; // OPTION ` + u

[ "á"; "a" ]; // OPTION e + a

[ "é"; "e" ]; // OPTION e + e

[ "í"; "i" ]; // OPTION e + i

[ "ó"; "o" ]; // OPTION e + o

[ "ú"; "u" ]; // OPTION e + u

[ "!" ; "." ]; // SHIFT 1  (don't ask me why but Applescript doesn't like exclamations points, even with  as an escape char)

[ "¡"; "" ]; // OPTION 1

[ "™"; "TM" ]; // OPTION 2

[ "£"; "pounds" ]; // OPTION 3

[ "¢"; "cents" ]; // OPTION 4

[ "∞"; "" ];  // OPTION 5

[ "§"; "" ]; // OPTION 6

[ "•"; "*" ]; // 8 (no 7 since that is ¶ and is a paragraph

[ "ª"; "" ]; // OPTION 9

[ "º"; "" ]; // OPTION 0

[ "≠"; "<>" ];  // OPTION =

[ "«"; "" ]; // OPTION+backslash

[ "…"; "..." ];  // OPTION semicolon

[ "æ"; "ae" ]; // OPTION quote

[ "≤"; "<=" ]; // OPTION <

[ "≥"; ">=" ];  // OPTION >

[ "÷"; "/" ];  // OPTION ?

[ "œ"; "oe" ]; // OPTION q

[ "∑"; "[sum]" ]; // OPTION w

[ "®"; "[Registered]" ]; // OPTION r

[ "†"; "" ]; // OPTION t

[ "¥"; "" ]; // OPTION y

[ "ü"; "u" ];  // OPTION u + u

[ "ë"; "e" ]; // OPTION u + e

[ "ä"; "a" ];  // OPTION u + a

[ "ï"; "i" ];  // OPTION u + i

[ "ö"; "o" ]; // OPTION u + o

[ "ÿ"; "y" ]; // OPTION u + y

[ "â"; "a" ]; // OPTION i + a

[ "ê"; "e" ];

[ "î"; "i" ];

[ "ô"; "o" ];

[ "û"; "u" ];

[ "ø"; "o" ]; // OPTION o

[ "π"; "3.14" ]; // OPTION p

[ "å"; "a" ];  // OPTION a

[ "ß"; "ss" ]; // OPTION s

[ "∂"; "" ]; // OPTION d

[ "ƒ"; "[forte symbol]" ];  // OPTION f

[ "©"; "[Copyright]" ]; // OPTION g

[ "˙"; "'" ]; // OPTION h

[ "∆"; "" ]; // OPTION j

[ "˚"; "" ]; // OPTION k

[ "¬"; "" ]; // OPTION l

[ "Ω"; "[omega]" ]; // OPTION z

[ "≈"; "[approx=]" ]; // OPTION x

[ "ç"; "c" ]; // OPTION c

[ "√"; "[checkmark]" ]; // OPTION v

[ "∫"; "" ]; // OPTION b

[ "ñ"; "n" ]; // OPTION n + n

[ "õ"; "o" ]; // OPTION n + o

[ "ã"; "a" ]; // OPTION n + a

[ "µ"; "u" ] // OPTION m



)



MakeApplescriptSafe.zip

  • Author

Well, since Applescript doesn't like any special characters (Greek, German ü, single-quotes, double quotes, etc) I decided to make a function to make ALL characters Applescript-friendly.

My custom function escapes all types of quotes and replaces special characters with their equivalent (u vs. ü or 3.14 vs. π).

The problem that I was having above escaping the double-quotes, I realized there are ASCII straight-double quotes, and font-style curly double-quotes. So my script escapes all types of quotes and fixes special characters. The custom function is posted at the link below.

Hope this will help someone else in the long-run!

http://fmforums.com/forum/showtopic.php?fid/130/tid/199335/pid/308902/post/last/#LAST

since Applescript doesn't like any special characters (Greek, German ü, single-quotes, double quotes, etc)

Perhaps you should post your script, before jumping to conclusions.

Do not double post your question.

I have merged your two Threads.

Lee

Edited by Guest

I am not claiming any expertise here but this article says that Applescript it now Unicode compatible:

http://www.apple.com/applescript/features/unicode.html

I searched for iCal Unicode compatibility but could find nothing though it appears there were big changes in Leopard.

  • Author

I do in fact run Leopard. My client runs Tiger and he was having difficulties, too.

Nono, comment, I didn't jump to conclusions. I definitely took my time to figure out what was happening. I did some pretty extensive testing (on Leopard) with individual characters+Applescript and made notes of all of the characters that didn't work from Filemaker to iCal. Since I couldn't get any of the above characters in the script to work, I made the function according to my findings.

Still, I'm not sure why my function was moved from Custom Function Library? It's a function I wrote that I figured should be with the other custom functions. Sorry if I was out of line...?

B)

Well, all I can say is that I have seen no such limitation in Tiger.

  • Author

Hm, you know what?...I wonder. I am assigning a fields to a variable and then plugging the variable in the Applescript. I wonder if something is happening in the translation between variables and the Applescript.

Still, I'm not sure why my function was moved from Custom Function Library? It's a function I wrote that I figured should be with the other custom functions. Sorry if I was out of line...?

:o

I moved it because you asked a duplicate question concerning it. I can move this whole thread back to the Custom Function Topic, if that is where you prefer it. However, you are getting plenty of responses here.

Lee

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.