Skip to main content
Participant
February 20, 2023
Answered

Error while placing a file with file name containing French accents or Polish characters

  • February 20, 2023
  • 1 reply
  • 1443 views

Hi,

I work on Windows 10 + InDesign CS 6. When I try to import (place) a file which filename contains French accents, e.g.:

 

redressée.jpg

Cédric.psd

 

I get an error message "Either the file does not exist, you do not have permission, or the file may be in use". LockHunter software does not detect any process that could lock this file.

 

Removing French accents from file name "é-->e" solves the problem. 

When I edit the filename and replace the original "é" with the same "é", but I type it, it solves the problem as well.

 

However, with hundreds of linked files editing their names is not a solution at all.

 

The problematic files come from MacOS system.

 

Can you help me with that? Thanks!

 

 

This topic has been closed for replies.
Correct answer Robert at ID-Tasker

Both - the error appears when:

- I try to fix the link using the Links tools - relink,

- I try to place the file using CTRL+D.

 

This "é" was just an example of French letter, I get the same error with other characters, like ô in "tôlé".

 

I've made an experiment: I've changed the "original" é in the file name with "my" é - I've just typed it in the file name - and the problem disapeared. So, this must be an issue with Mac-PC migration and I'm looking for a solution for multiple files. 


Then you need to replace 'e' in the script provided with "your" e with the accent - in:

 

myFiles[i].rename(myFiles[i].name.replace('e%CC%81', 'e'))

 

I bet it should work like this:

 

myFiles[i].rename(myFiles[i].name.replace('e%CC%81', 'e%CC%81'))

1 reply

rob day
Community Expert
Community Expert
February 20, 2023

However, with hundreds of linked files editing their names is not a solution at all.

 

Hi @JAGaaaa , You might be able to batch rename the files via Javascript. This would replace any é characters with e in the file names of the selected folder:

 

//get files in selected folder
var f = Folder.selectDialog("Select the folder containing the images", ""); 
if(f != null){ 
    var myFiles = f.getFiles(); 
}

var nn
for (var i = 0; i < myFiles.length; i++){
    myFiles[i].rename(myFiles[i].name.replace('e%CC%81', 'e'))
};   

 

Before:

 

After:

JAGaaaaAuthor
Participant
February 20, 2023

Thanks, it changes the file names (and its great). I know some third party software that can do the same job, however, using JS from InD to do that is an impressive idea.

But still I will need to manualnny link the new names in the InDesign document - any ideas how to deal with that?

Robert at ID-Tasker
Legend
February 20, 2023

So you have an INDD document - already created on Mac - with links with accents in the names ? Not that you need to place them for the 1st time? 

 

I'm pretty sure @rob day can quickly modify 1st version of the script to rename and relink 😉