Tthe error message only states that "Object is invalid" and refers to a line in the script (which cannot possibly be the offending line so the line counting is probably offset)
The core of the script is rather simple, and only translates file paths from Mac to Windows (mixed environment) and then relinks to the appropriate platform.
The file server is Windows, and the Swith server is directly connected to it, same as the Windows clients.
The Script works when run on InDesign, both Mac and Windows, and also runs on the Switch Server, if triggered manually in the InDesign Application that is installed there.
The script also is created to that it can run in windowless mode, if triggered by "doScript", but I cannot get it to run at all in Switch, and I would really appreciate if someone could give some hints to what may be going on.
It is rather a lengthy script so I don't post the entire thing, just the part that actually tries to do anything:
Code: Select all
// Defines the new file path
var $myNewFilePath = '' ;
if ($myOS == "MAC") {
var $myNewFilePath = $myConfig['MAC'] + '/' + $myEndOfFilePath ;
} else {
if ($preferUNC == 'true') {
var $myNewFilePath = $myConfig['WIN_UNC'] + '/' + $myEndOfFilePath ;
} else if ($preferUNC == 'false') {
var $myNewFilePath = $myConfig['WIN_DRIVELETTER'] + '/' + $myEndOfFilePath ;
}
}
// Tries to relink to new file.
var $myStatus = 'false' ;
try {
if (File ($myNewFilePath).exists == true) {
var $myNewFile = new File ($myNewFilePath);
$myCurrentLink.relink($myNewFile);
var $myStatus = 'true' ;
$mySuccessCount++ ;
} else {
$myFailureCount++ ;
}
} catch (error) {
var $myStatus = 'false' ;
$myFailureCount++ ;
}