Saving a file to local server with script
I have a script that I use for creating flexographic plates from proofs that were sent to the customer. The thing is, the flat proof shows how the print will look, but the plate needs to be slightly condensed in width to compensate for the slight stretch distortion that happens when a flat plate is wrapped around a cylinder. That's the function of the script and it works great.
After it runs it resaves the file into the source folder. That was mostly a workaround because I eventually had to stop trying to get it to save to the local server and move on. Once I have created plates for a set of prints, I manually drag all the recently saved files into the server. It's something I just got used to doing that way, but now that things have slowed down I'd like to get this fixed. I'd really like the final step of this script to just be to save the file to the local server, perhaps with the word "_plate" concatenated to the existing file name.
var myDocument = app.activeDocument;
var selectedObject = myDocument.selection[0];
//Identify left edge of repeat
var repeatBounds = app.activeDocument.groupItems['repeat'].geometricBounds;
var r1 = repeatBounds[0];
// Get position of selection bounds and create condense ratio
var myBounds = selectedObject.geometricBounds;
var x1 = myBounds[0];
var x2 = myBounds[2];
var rawRepeat = (r1 - x1);
var rawGap = (r1 - x2);
var rawPrintWidth = myBounds[2] - myBounds[0];
var condenseRatio = ((rawRepeat - 21) / rawRepeat) * 100;
var expandRatio = (100/condenseRatio) * 100;
selectedObject.resize(
condenseRatio, // x
100.0, // y
true, // changePositions
true, // changeFillPatterns
true, // changeFillGradients
true, // changeStrokePattern
true, // changeLineWidths
Transformation.LEFT); // scaleAbout
copy();
selectedObject.resize(
expandRatio, // x
100.0, // y
true, // changePositions
true, // changeFillPatterns
true, // changeFillGradients
true, // changeStrokePattern
true, // changeLineWidths
Transformation.LEFT); // scaleAbout
if ( app.documents.length > 0 ) {
myDocument = app.activeDocument;
myDocument.close( SaveOptions.SAVECHANGES );
myDocument = null;
}
So how do I get these proofs (the myDocument in question) to save to the local G drive server once the script runs? Any help would be greatly appreciated. It's really driving me nuts. Have mercy on me, I'm a graphics guy not a coder.
