JS doesn't find file on network drive only on local drive
Dear all,
I have an issue with my script. It is a JS for InDesign (CS6) getting data from Excel and generating a InDesign file with links from it. It was working great for two month, no issues. Suddenly, my boss used the script on her computer (a copy of the file, so my file is still 'fine') and it stopped detecting the Excel file path on the network drive.
If I change the first letter to a local drive (and compy the whole folder path) it detects the file and everything runs smoothly?!
Why? The letter of the network drive is correct, I checked the path now 3 times letter by letter, sign by sign, retyped the path, restartet the computer, reconnected the network drive, I have no clue what happened overnight to the script.
This is the "file checking part":
function myFileChecking(){
//Define the file I want to use
ExcelPath = new File("D:/Folder1/Folder_2/Folder3/file.xlsx");
//If NOT (!) the indicated Excel-file exist do the following
if(!ExcelPath.exists) {
alert("Excel Datei ist nicht im Ordner: Speichern Sie ExcelDatei unter file.xlsx im Folder ab.");
//If the indicated Excel-file exist do the following stuff in the else{}
else { // the following lines start the functions, one after the other
myDocSetup();
myMasterPage();
GetExcelData();
myExcelImport();
myTextFrameSetup();
myEnteringExcelData();
} // closing of else
} // closing of function myFileChecking
Same issue with saving the file and exporting it as interactive pdf:
//If the active document has not been saved (ever), save it.
if(app.activeDocument.saved == false){
//If you do not provide a file name, InDesign displays the Save dialog box.
app.activeDocument.save(File("Q:/Folder1/Folder_2/Folder3/InDesignFile.indd"));
}
😧 would be the loval drive, this works.
Q: would be the network drive, doesn't work.
Why?!?!?!?!
Any ideas?!
Best
Cleo
