Skip to main content
mikes26326174
Inspiring
January 15, 2020
Question

German umlauts in filename

  • January 15, 2020
  • 2 replies
  • 894 views

Hi,

I am using extendscript to place images into the document. I extract the filename from a script label and then I place the image.
The problem is, when the filename contains an umlaut, I get an 'object is invalid' error.

Any ideas how to work with files that contain umlauts ?

This topic has been closed for replies.

2 replies

Community Expert
January 16, 2020

Hi Mike,

Jongware is absolutely right.

To compare actual file names with stored strings you could use regular expressions to "normalize" the names.

 

Just to give you an idea see Martin Fischer's cleanUmlaut function :

http://www.hilfdirselbst.ch/gforum/gforum.cgi?post=367606#367606

 

You should extend this to other composits if you are working with French file names.

 

Regards,
Uwe Laubender

( ACP )

 

// EDITED

Jongware
Community Expert
Community Expert
January 15, 2020

You (probably :)) get an 'object is invalid' error because the file you are looking for is not found, so first thing to check is: is that file not found because the label is wrong, or is the label correct but the filename is somehow different? Do not trust your eyes! Use the power of computing to show you what value each of these has! Perhaps (it's just a guess, and most likely wrong, but just to indicate why you cannot rely on your eyes only) the character + umlaut in your script label is a single character code, but in the filename it is composed of a base character plus a separate accent.

 

If you can find out what the difference is between the expected and actual filename, you can adjust one of them (I assume the script labels come from somewhere else) or simply add a few minor lines of code to change one to the other.