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

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

Recommended Posts

  • Newbies
Posted

Hey all,

I've got a fm database I use in my role as editor at a magazine. I built a db to track all my contacts with companies, as well as track and format articles that go online, or in the print mag.

Our emedia Content Management System sucks, and chokes if many standard characters are present in a field when filing a story using the web interface. Generally I just screen out the trademark symbols and reg symbols (the most common offenders) by hand, but the volume of work has increased, making that harder for me to do.

I made a simple script that searches for the trademark and registration symbols (using find/replace), but I'm having some trouble thinking of a good way with scriptmaker (without invoking an applescript) to get rid of curly quotes. I can copy/paste a curly into the find/replace dialog box, but it won't accept it because it treats the curly as being the same as a straight quote, and therefore being the enclosing character in the find dialog.

Going out of my mind on this. It would save me a lot of work. Better solutions would be appreciated.

Posted

Hi David,

The solution is to use escape characters.

Your find becomes: """ (where the second " is a begin-curly quote).

The replace becomes: """ (where the second " is a non-curly quote).

You can do the same to find and replace end-curly quotes. I've tested this and it works without problems on a simple (1 field) table.

Be sure to make backup of your database before you test this.

Hope this helps!

Cobra

Posted

You both should update your Profile so that we know which platform, OS and Version of FileMaker you are using. The link is below your names.

Cobra, You must be using v7, as the Escape characters do NOT work in version prior to v7.

David, if you are using an earlier version, the easiest approach to this problem is to use a Global Fields for the curly and plain quotes, then use them in your Replace Calculation or script:

Substitute(Substitute(Some_Text,

g_curlyLeft, g_Plain),

g_curlyRight, g_Plain

)

I forgot you need a field for both.

HTH

Lee

Posted

Hi David,

Here is a calculation that will work using just the quotes:

Substitute(Substitute(YourField,

"

Posted

Hi Jimmy & David,

If using FMP 6 you should be able to do the Perform Find/Replace script step without any problems (either via a script or directly from FileMaker's Edit menu). Simply cut and paste the curly quotes into the find field and type a " into the replace field (you have to do one script step each for start and end curly quotes).

The trick here is to ensure that "Use Smart Quotes" is turned off in the document preferences before doing a find/replace. If you turn this off, all subsequent data typed into your database (as well as the find/replace that you're attempting) will not use the curly quotes.

Note, however, that data copied and pasted from an application that uses curly quotes will retain the curly quotes (hence, the need to run the script or do a manual find/replace periodically).

The fact that David had a problem with this seems to suggest he's using version 7. Version 6 will happily accept curly quotes and " (without a paired end-quote) in the Perform Find/Replace script step.

From memory, FMP 5 did not have a Perform Find/Replace script step (if it did, however, I'm pretty sure the functionality would be the same as FMP 6...FMP 7 is where things changed significantly).

Hope this helps!

Cobra

This topic is 7403 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.