Hardcode a SaveAs path?

Hello

I have a working script that shows how to save my document as a .jpg file.

It contains the following line of code that generates the jpg saved in the same directory as the psd file.

var filePath = srcDoc.path + '/' + docName + '.jpg';

Could someone please advise me how I hard-code this variable to point to the OS X desktop?

I tried these 2 options - nothing helps:

var filePath = /Desktop + '/' + docName + '.jpg';

var filePath = "/Desktop" + '/' + docName + '.jpg';

Thank you in advance.

var aFile = File ("~/Desktop/Testdateien/Sample.jpg");

This helps you?

Tags: Photoshop

Similar Questions

  • Dynamic file save path

    Hey everybody,

    So, I'm working with a lot of files each day which must be recorded according to their code of lead, which means that there is a folder that contains thousands of subfolders that have the same name as this code of lead on a server.

    Since I was the lead code in the name of the file, try to use it in conjunction with the path of the file to tell illustrator where to save it with Javascript. Also the idea of a dynamic recording path is great for me.

    Here's what I have so far, it doesn't work yet, but I feel like I'm close.

    /*/////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////
    Dynamic Save Path////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////*/
    #target illustrator
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    var sourceDoc = app.activeDocument;
    var sourceName =sourceDoc.name;
    var customerNum = sourceName.substring(0, sourceName.length - 8)
        customerNum
        sourceName = sourceName.substring(0, sourceName.length - 3)
        
    
    //alert(sourceName)
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    alert(customerNum + " Customer # saved")
    alert(sourceName + " File name saved") //end
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    var doc = app.activeDocument;
    var doc_Path = File("I:\GRAPHICS"+ "/" + customerNum);
    
    var substituir_Path = doc_Path+ "/" + customerNum;
    //alert("sourceName: "+sourceName+"\nsourceDoc_Path: "+doc_Path+"\nsubstituir_Path: "+substituir_Path);
    
    function SaveFileAsFXG (dest) {
        if ( app.documents.length > 0 ) {
            var saveOptions = new FXGSaveOptions();
            var fxgDoc = new File(dest);
            app.activeDocument.saveAs( fxgDoc, saveOptions );
        }
    }
    
    var destFilePath = substituir_Path;
    SaveFileAsFXG (destFilePath);
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    alert("done!") //end
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    

    I thought about it, I'd remove too many characters. I go out with this hard-coding in my script because of the way in which name us the files where I work. also I realized that I had left side in there that I didn't need.

    I've also got rid of the dividers that make easeir read here online

    #target illustrator

    var sourceDoc = app.activeDocument;

    sourceName = sourceDoc.name var;

    var customerNum = sourceName.substring (0, sourceName.length - 7)

    customerNum

    sourceName = sourceName.substring (0, sourceName.length - 3)

    Alert (customerNum + "customer # saved")

    Alert (sourceName + "name of the saved file") //end

    var doc = app.activeDocument;

    var File = doc_Path ("I:\GRAPHICS" + "/" + customerNum);

    function SaveFileAsFXG (dest) {}

    If (app.documents.length > 0) {}

    saveOptions var = new FXGSaveOptions();

    var fxgDoc = new queue (dest);

    app.activeDocument.saveAs (fxgDoc, saveOptions);

    }

    }

    SaveFileAsFXG (doc_Path);

    Alert ("Done!") //end

  • How do I keep file path to save by default save path during the next run of my vi?

    Hi all

    Forgive me if I use the malapropisms of terms here, but what I would like to make is the following:

    In my vi, I need that the user enters a name and path for saving a file. I would like to sort it by default in the path of the file save box the next time this program is executed (the computer may be turned off between runs).

    I did some research online but no available-it can be that I am not describing the problem correctly. Does anyone have any suggestions on how I could go to do this? It seems that it should be something very simple, but it has upset me.

    See you soon,.

    Alex

    For example, you can save it in the system temporary folder (there is a way for this constant!) or next to the executable. If it must be different for each user, place the ini file in the default folder or the default data folder.

    If you have LabVIEW 2009, you have a few more predefined places: have a look at get_system_directory. Simply put the ini compared to one of these locations, and he'll know how to find them later.

  • Safeguarding of documents through scripting: name of the active file Get and set save path/file type

    I am writing a script that will:

    -Do all the invisible layers

    -Make the layer visible ' background'

    -Remove all the invisible layers

    -Save the document as EPS file (leaving the original intact)

    I am new to scripting and I based my script by copying the code of other scripts.

    Here is my code:

    var doc = app.activeDocument;

    var name = doc.name;

    hide var = function () {/ / hide all layers (based on http://forums.adobe.com/thread/644267( )}

    var L = doc.layers.length;

    for (j = 0; j < L; j ++) {doc.layers [j] .visible = false ;}

    }

    masquer();

    loop through all layers

    for (var i = 0; i < doc.layers.length; i ++) {}

    Create the illusrtratorSaveOptions object to set options to HAVE

    var saveOpts = new IllustratorSaveOptions();

    Definition of the IllustratorSaveOptions properties.

    saveOpts.embedLinkedFiles = true;

    saveOpts.fontSubsetThreshold = 0.0

    saveOpts.pdfCompatible = true

    Implemented Variable for the name of the access layer

    var currentLayer = app.activeDocument.layers [i];

    Loop through the layers and make the background layer visible

    If (currentLayer.name == 'Background') {}

    docName = name + currentLayer.name + ".eps";

    currentLayer.visible = true;

    }

    }

    / / Remove the invisible layers (based on http://www.cartotalk.com/index.php?showtopic=7491( )

    var myDoc = app.activeDocument;

    var layerCount = myDoc.layers.length;

    for (var ii = layerCount - 1; ii > = 0; ii-) {}

    var currentLayer = myDoc.layers [ii];

    currentLayer.locked = false;

    var subCount = currentLayer.layers.length;

    for (var subCount - 1; ss = ss > = 0; ss-) {}

    Underlayment var = currentLayer.layers [ss];

    subLayer.locked = false;

    If (subLayer.visible == false) {}

    subLayer.visible = true;

    subLayer.remove ();

    }

    }

    If (currentLayer.visible == false) {}

    currentLayer.visible = true;

    currentLayer.remove ();

    }

    }

    Save the document with a new name

    var saveName = new queue (doc.path + "/" + Nomdoc);

    doc.saveAs (saveName, saveOpts);

    Everything works well except:

    (1) it saves the document under the name of AdobeIllustratorBackground rather than the name of the document

    In addition, I don't know how to tell the script to save in EPS and specify the save location.

    Could someone give me some advice?          Thank you!

    There is an example script in Adobe Illustrator Scripting/CSx/Sample Scripts/JavaScript/miscellaneous/Save as PDF that has all the parts except the EPS Options.

    Go here for the script Guides and references.

    http://www.Adobe.com/devnet/Illustrator/scripting.html

  • set a path to the report manually by using &lt; clientfiledir &gt;

    Hi all

    I'm pretty new to teststand so please forgive me if this is an easy question.

    BACKGROUND

    I'm running a sequence (TestGroup) that contains several sequences (tests) that work as a new execution.  It allows me to produce an individual report for each test (the top-level sequence produces a summary report only).

    QUESTION

    I want each of the reports to be stored in a single folder. I have setup report options to calculate the path of the report by using the following expression "\\Reports\\\\SummaryReport [] []".".

    This works very well for the top level, but that this also applies to the subsequences path is recalculated and is different from that of the upper level.

    CURRENT SOLUTION

    I'm currently moving the report path as a parameter to test sequences, but I find the value of the macro (from the sequence of high level) to build the report path.  Can someone tell me how to get this?

    Another solution is for me to take the path of the current report and the name of the file of this band.  It's a better solution?

    Any help would be great.  Thank you

    G

    Hi Jack,

    I use a whole test sequence (seq) group and a running each of my tests as a new execution.  This means that I can apply a different template to each test (which is needed to support the old style of the previous tests developed by my client) and produce a report of individual test for each test.  Then I clear the list of results when the report was drafted and replace it with a link to the report for the test (I hope that this reduces the risk of running out of memory on long series of tests).

    Each of my 'tests' is indeed a full sequence.

    I was hoping to use something similar to macros to move the report path to each of my tests (or model for the test), but have not been able to find these values anywhere in the report options window.  Ultimately I have to now take the string generated for high level sequence 'group' and make a formatted string and then pass it as a parameter testing (an another headache that had some problems).

    I'm not really a fan of this and think it should be possibel to configure the report options different for each model, that I had to do it manually by hardcoding stuff like path .xsl etc names.

    can someone tellme if it seems like the right approach?

    G

  • Doc, save as, and function of trust

    I read on the forum and the adobe help files. I think I'm close, but given that I have to get my IT Department to help place the js files where they need to go, I thought I would ask the forum if I'm on the right track

    I always have to make sure that the field values will not include any non-compliant characters. They are not empty like forms will come directly from our system pre-populated

    Currently these forms by e-mail automatically (while still hitting the real send button) staff when to go to print the document.  People who receive these forms are right it is a bit difficult to follow up with emails and asked that just the files save to a folder, so they can watch when they have time

    That's what I have for my job to trust propagator.  I guess that's the only js file I need that it takes over the function of trust?

    mySaveAs = app.trustPropagatorFunction (function (doc, path)
    {
    app.beginPriv ();
    doc.saveAs (path);
    app.endPriv (); })

    myTrustedSpecialTaskFunc = app.trustedFunction (function (doc, path)
    {
    Privileged and non-privileged code above

    app.beginPriv ();
    mySaveAs (doc, path);
    app.endPriv ();
    Privileged and non privileged code below});

    I got this code from the help of Adobe

    so I want to have this code in the box to print Document has

    var name = this.getField("FormValues.accountNames_0").value
    = this.getField ("FormValues.folioNumber_0") .value folio var

    myTrustedSpecialTaskFunc (this, "/ w/Public/AccountOpening /" + name + "" + folio, pdf);

    I read where to put the js file because I saw some comments on the forum when you place the js file has changed for those with Adobe X and Windows 7

    Anyone would be able to let me know if I'm on the right track before IT involved me.  I guess I could test the code on my own laptop to see if it would allow me to save the form...

    Thank you

    Read this: Ninja Acrobat: Acrobat 10.1.1 JavaScript changes

    You must manually create folders that are not present, and they must be named correctly.

    It's a good idea to use the valueAsString instead of the value property property to get the values of field, since you are using the results as a string. He will probably not make a difference here, but it's a good habit to get. You also have typo in that last line of code. It should be:

    myTrustedSpecialTaskFunc (this, "/ w/Public/AccountOpening /" + name + "" + folio + ".pdf");

    If there is a chance that they could be, it would be a good idea to make sure that these field value are not empty.

    Also, consider using a try/catch block for the call of doc.saveAs and look at the return value, so you can give users an error message more useful than what will be the value by default if something goes wrong.

    If you need assistance with this, post again.

  • CS6 save the trace appears not

    Hello

    I made a path in photoshop cs6 and you want to save and load it back in, but the save path does not come more from the drop path, make a right click or double click...

    Also I have not seen where I would put the path on my HD and how to load a path in return?

    Pls share how it works.

    Kind regards

    Frank

    When you double-click a way to work a way save as dialog for path name. The path is then stored in the Panel traced and stays there when you save the document.

    However, if you need the path of access to another application, you can goto file > export > traces to illustrator. This will create a file I that contains a path with no line and no fill. Just keep in mind when you view it in another application. It requires a program such as Illustrator to give it a fill and a stroke or.

  • The change of path SharedObjects between 3.4 and 3.5 AIR - now update to 3.7

    Hi all

    We were not aware of the change of SharedObject save path between 3.4 and 3.5, and all the people who have improved their game once the new application went live with lost 3.5 all their game progress data.  However, the NEW people who have downloaded the game had no problem.

    For devices that have improved their game (it was 3.1, now 3.5), SharedObjects have simply stopped working.  They cannot be loaded or saved to disk, and no new sharedobjects cannot be saved in the device-only kept in memory.  Every time that the user starts the game, the game thinks that they are a new user and they lose their progress - including their in-app purchases (consumables).

    We are now rebuilding the app with 3.7 AIR - I just check: someone who has downloaded the game costs with AIR 3.5 work SharedObjects (on the road again/broken). They now lose all their data in progress when they download the update to 3.7 and SharedObjects use once more the old path?

    If so is there a work around for these people?

    See you soon,.

    Peter

    We know what the problem is moving from 3.4 to 3.5, but what I'm asking is what the issues are moving from 3.5 to 3.6 (or in this case, 3.7).

    We have solved this problem now, but the workaround is relatively complicated.  Basically, we copy actual SharedObject binary files in the file system, to get them where we want them to be.  I hope that the paths on iOS do not change in the future!

    SITUATION 1

    Our original app is in the AIR 3.1. The sharedObject is called DATA1

    Those who have updated to 3.5 lost all the progress, and new no SharedObjects have been created

    Now if they update to the latest update 3.7, once more, they will continue to use DATA1 and progress will continue

    SITUATION 2 (the complex)

    People who have downloaded our 3.5 fresh app have SharedObject DATA2

    If now they update to the latest update 3.7, the application tries to use DATA1, therefore potentially to lose all the progress

    But because DATA1 contains no data, we try to manually load the DATA2.sol file from the file using "File" system and manually setting the path where the ground, and we copy DATA2 to DATA1 (if it exists). The player can then continue to progress.

    SITUATION 3

    Those who download the latest version of the app fresh (AIR 3.7) will create new SharedObject DATA1

    Thank you very much for the bug to Adobe, it has caused no end of trouble.

  • How to convert a photoshop shape path in a work path

    Hello, I am about 8 hours to convert a form of photoshop in a way to work in order to put a brush around her border.

    I don't understand why the "trace the path with brush" is grey and not usable directly on the path of the shape itself.

    'Path of loading the selection' is not an option becuse it distorts my way.

    Any help or alternative is apreciated.

    Double click on the vector mask thumbnail form in the Panel traced to save path (path 1 in the screenshot)

    Then make a new layer empty and STROKE option should be available.

  • Confidence function "save under".

    I created the following in the folder "C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Javascripts".js file on my pc.

    Name of the file "MySaveAsPO.js".

    text of script as follows

    / * saveAsPO Script * /.

    mySaveAsPO = app.trustPropagatorFunction (function (myDoc, path)
    {
    app.beginPriv ();
    myDoc = event.target var;
    return retn = myDoc.saveAs (path);
    app.endPriv ();
    });
    myTrustedSpecialTaskFunc100 = app.trustedFunction (function (myDoc, path)
    {
    app.beginPriv ();


    var a = event.target.xfa.resolveNode (".header form1 [0] [0].") NextPONumber [0] ");" //copied (".header form1 [0] [0].") NextPONumber [0] ") an example"
    var AV = Date1.rawValue; //this is the name of one of the fields I would like to add to the record as the file name, although I would use two fields.
    var g = "/ s/AfterHoursLog / ' + av + log".pdf" //the way I am trying to record is a shared drive"S:\AfterHoursLog"

    retn var = mySaveAsPO (myDoc, g);


    app.endPriv ();
    return retn;
    });

    ******************************

    The script I have the button 'save' is the following:

    function calls confidence in the MySaveAsPO.js script to the folder level

    event.target.myTrustedSpecialTaskFunc100 (event.target);


    This does not work for me. What Miss me?  The .js file must be saved in the js folder Reader as well as the end user will use drive to fill the form?

    Any help is greatly appreciated.

    Thank you.

    Hello

    A few things are underway. Here's the .js

    // folder level JavaScript to allow Save As population of file name
    mySaveAs = app.trustPropagatorFunction(function(myForm, path)
    {
         app.beginPriv();
         var myForm = event.target;
         return rtn = myForm.saveAs(path);
         app.endPriv();
    });
    
    myTrustFunct = app.trustedFunction(function(myForm, path)
    {
         app.beginPriv();
    
         var vDate1 = event.target.xfa.resolveNode("form1[0].Log[0].Date1[0]").rawValue.toString();
         //var vTime1 = event.target.xfa.resolveNode("form1[0].Log[0].Time1[0]").rawValue.toString(); // dosen't like the ":" in the time format
    
         var vPath = "/c/Test/" + vDate1 + " Log for shift " + "time in here but it dosen't like the time format"  + ".pdf";
         //console.println("vPath: " + vPath);
    
         var retn = mySaveAs(myForm, vPath);
    
         app.endPriv();
    
         return retn;
    });
    

    The essential is that the saveAs function does not like the ":" in the format of the time and so falls on.

    Also one of the variables has been mistyped.

    The form of one of the lines was missing a ';' and on the other, there were two.

    Good luck

    Niall

  • WVC54GCA - saved to disk NAS.

    I hava a couple of these cameras and they send me email alerts on motion detection.

    Recently, I received a NAS drive. I have changeed the save path in the preferences.

    A folder is automatically created with three subfolders AVI, data and snapshot.

    I've been disappointd noted that there were no recorded AVI files.

    There were several .sef and a file single .smy in the Data folder.

    No snapshot.

    How can I rectify this?

    Hi VeeCee. The WVC54GA does not save to AVI. You can use the Linksys camera software to view .sef files, or you can use conversion software to convert files in AVI format .sef.

  • Best option for creating XML

    Hello

    I am facing problem,

    I have created the XML file, but I can't see it / exit it.

    Please can anyone suggest what's best way to create xml files?

    (1) create xml with DocumentBuilderFactory and then analyze or

    (2) manually create xml hardcoded and save it to the sd card and then access it for analysis.

    I have continuously variable data text in xml files.

    What approach will be following me more?

    Help, please.

    Thank you

    Françoise.

    Why you are unable to view the XML file? How to read as a byte array and look into the debugger? That way at least you can check the syntax of the XML prologue is correct. Then, you can read in as an array of characters using the appropriate encoding and check the syntax of the entire file.

    Regarding the creation of XML code, the best approach depends entirely on what you start with. You have built a DOM model or or do you have custom data structures you want to encode?

    The XMLWriter class in net.rim.device.api.xml.jaxp is not all that useful for generating XML, because it is designed to be used as a Manager when parsing existing XML - it is more than an XML processor to an XML writer. It's not too hard to write your own code to generate XML; a search on the web will be probably some examples of implementation.

    To find out where to keep the XML on the device: the file system, permanent storage, or RMS all work fine. Your basis in the analysis job it will be to open an input stream on what you've stored, create an InputSource of the stream and feed it to one of the analyzers. In general, unless you really need to generate a DOM model, the approach of SAX parser is much more effective. You can create your custom data directly structures as the analysis takes place, rather than going back in a DOM trying to get information. Still, a web search for "SAX compared to DOM parsing" or a similar collection of key words meet a number of good tutorials on how to do this.

    PS After re-reading your original post, I think you may be confused about something. The DocumentBuilderFactory and the SAXParserFactory are tools to transform XML in an internal data structure. You do not use them to go the other way. For this, you are going to have to write your own code, or find others, you can borrow; I don't think that there is something useful in the RIM API. (XMLWriter can be used to move from the existing to the new, equivalent XML, XML, which is not that it would be useful for you.)

  • strange error with configure snapshot controlfie

    If I put the path snapshot controlfile to the db name hardcoded in the path, it works:

    CONFIGURE SNAPSHOT CONTROLFILE NAME TO ' / var/backup/IDB00246/snapcf_%d.f';

    From control file and SPFILE Autobackup 10 December 14
    room handle=/var/backup/IDB00246/controlc-2380395869-20141210-05.ctl comment = NONE
    Control finished and Autobackup SPFILE file to 10 December 14

    RMAN >

    Complete recovery manager.

    But if I put the path using %d, he doesn't seem to like it:

    CONFIGURE SNAPSHOT CONTROLFILE NAME TO ' / var/backup/%d/snapcf_%d.f';

    From control file and SPFILE Autobackup 10 December 14
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03009: failure of command of file control and SPFILE Autobackup on channel ORA_DISK_1 at 15:07:40 10/12/2014
    ORA-01580: error creating control file backup /var/backup/%d/snapcf_%d.f
    ORA-27040: create file error, cannot create the file
    Linux-x86_64 error: 2: no such file or directory
    Additional information: 1

    RMAN >

    Complete recovery manager.

    I can use %d for these two orders with no problems:

    FORMAT 1 CONFIGURE CHANNEL DEVICE TYPE DISK MAXOPENFILES ' / var/backup/%d/dumps%d_%T_s%s_p%p.bus';

    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT for DEVICE TYPE DISK TO ' / var/backup/%d/control%F.ctl';

    Then why can't it be used for snapshot controlfile?

    On the snapshot Controlfile: when RMAN must resynchronize the catalog of recovery with a consistent read version of the control file, it creates a TEMPORARY snapshot control file. RMAN needs a snapshot control file when the resynchronization with recovery catalog or before you perform a backup of the current control file.

    Why you should use variables in a temporary file internal?

    RMAN does not have a snapshot unique to each backup file, RMAN automatically overwrites the file if it exists. You can use the same file and location all the time, for example ' / u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_dborcl.f'

    If I put the path snapshot controlfile to the db name hardcoded in the path, it works:

    CONFIGURE SNAPSHOT CONTROLFILE NAME TO ' / var/backup/IDB00246/snapcf_%d.f';

    You have this file "snapcf_%d.f" not "snapcf_IDB00246.f" in "/ var/backup/IDB00246 / ', because 'CONFIGURE SNAPSHOT CONTROLFILE NAME' does not support variables.

    You must create a file snapshot controlfile name unique for each database.

  • Record in the source Parent folder

    Hello, I am fairly new to After Effects scripting, and I'm doing a script to import files, and then save the project source files for the parent folder.

    But I think that my last line, save path, is not the right wording...

    Unfortunately, I try a lot of things but I can't find the solution. If you can help me, I thank very you much...

    TOM


    This is my code:

    Import folder

    targetFolder var = Folder.selectDialog ('import files in the folder');

    If (targetFolder) {}

    var files = targetFolder.getFiles ();

    for (var i = 0; i < files.length; i ++)

    {

    try {}

    importOptions var = new ImportOptions (files [i]);

    app.project.importFile (importOptions);

    } catch (error) {/ * alert (error.toString ()); * /}

    }

    }

    find my way from the sources

    var PAthProject = targetFolder.parent;

    find sources of myparent path

    var PAthProject = targetFolder.parent;

    Record in the parent folder

    var myNewFile = new queue (PAthProject + "/" + "myNewFile.aep");

    App.Project.Save (myNewFile);

    var PAthProject = targetFolder.parent;  Returns a folder not one object string...

    f is targetFolder.parent;

    f.fsName or maybe. toString() would give a string that you can use to build a path.

    Also be aware of the universal access using slashes... is offered by Adobe with "/" through the platform, but if you use something

    like fsName, who is originally from Windows will give any backslashes. Discover the guide tools for files and the section of folder.

  • Copy the selection into a new document

    Here's a breakdown of what I am wanting to do... any guidance would be appreciated!

    1. the user will select the elements (blocks of text, items, transparent path)

    2. the user will execute a script that will do the following...

    1. open a new document (8.5 "x 11") with RGB color

    2. anything with a color fill should get gray 100% fill applied

    3. anything with an outline of color should get 100% of applied gray race

    4. then save a .ai file and a PDF in the following format...

    #target illustrator
    
    
    var doc = app.activeDocument;
    var fileName = doc.name;
    var jobName = (fileName).substr(0, 11);
    aiFile = "D:\\Jobs\\"+jobName+"\\AI\\Cover Page.ai"  
    pdfFile = "D:\\Jobs\\"+jobName+"\\PDF\\Cover Page.pdf"  
    
    
    var newaiFile = new File(aiFile);  
    doc.saveAs (newaiFile);  
      
    var pdfOpts = new PDFSaveOptions();      
    pdfOpts.pDFXStandard=PDFXStandard.PDFXNONE;  
    pdfOpts.compatibility = PDFCompatibility.ACROBAT5;      
    pdfOpts.preserveEditability = false;  
    var newpdfFile = new File(pdfFile);      
    doc.saveAs(newpdfFile, pdfOpts);
    
    
    
    
    
    
    

    OK, so I got it away square to where the art jury moves selected items. Someone else wrote the code to move the jury art to the selected items, and I modified to fit my needs. So that being said, a big thank you to pixxxel schubser to get the code for the part (found here... ( https://forums.adobe.com/thread/1336506 )

    Here is the code for anyone to see/modify/use!

    #target illustrator
    
    var newDocSet = new DocumentPreset;
    newDocSet.title = "Cover"
    newDocSet.width = (8.5 * 72);
    newDocSet.height = (11 * 72);
    newDocSet.units = RulerUnits.Inches;
    newDocSet.colorMode = DocumentColorSpace.RGB;
    
    var doc = app.activeDocument;
    var selectedItems = doc.selection;
    
    if (selectedItems.length > 0) {
        var newDoc = app.documents.addDocument(DocumentColorSpace.RGB, newDocSet);
        for (var i = 0; i < selectedItems.length; i++) {
            var newArt = selectedItems[i].duplicate(newDoc, ElementPlacement.INSIDE);
        }
    } else {
        alert("nothing selected");
    }
    
    // to move the new document artboard over to the selected items
    var doc = app.activeDocument;
    var selectedItems = doc.selection;
    
        var abIdx = doc.artboards.getActiveArtboardIndex();
        var actAbBds = doc.artboards[abIdx].artboardRect;  
    
        var vBounds = selectedItems[0].visibleBounds;
        vBounds_Li = vBounds[0];
        vBounds_Ob = vBounds[1];
        vBounds_Re = vBounds[2];
        vBounds_Un = vBounds[3];  
    
    if (selectedItems.length >1 ) {
        for (i=1; i vBdsI[0] ) {vBounds_Li = vBdsI[0]};
            if( vBounds_Ob < vBdsI[1] ) {vBounds_Ob = vBdsI[1]};
            if( vBounds_Re < vBdsI[2] ) {vBounds_Re = vBdsI[2]};
            if( vBounds_Un > vBdsI[3] ) {vBounds_Un = vBdsI[3]};
            }  
    
        doc.artboards[abIdx].artboardRect = [vBounds_Li +((vBounds_Re - vBounds_Li)/2-(actAbBds[2]-actAbBds[0])/2), vBounds_Ob -((vBounds_Ob - vBounds_Un)/2+(actAbBds[3]-actAbBds[1])/2), vBounds_Li +((vBounds_Re - vBounds_Li)/2-(actAbBds[2]-actAbBds[0])/2)+(actAbBds[2]-actAbBds[0]), vBounds_Ob -((vBounds_Ob - vBounds_Un)/2+(actAbBds[3]-actAbBds[1])/2)+(actAbBds[3]-actAbBds[1])];
        } 
    
    // save .ai and .pdf file to correct locations, then close the file
    var allDocs = app.documents;
    
    for(var i = 0; i < allDocs.length; i++){
    var fileName = allDocs[1].name;
    var jobName = (fileName).substr(0, 11);
    aiFile = "D:\\Job Number\\"+jobName+"\\AI\\Cover.ai"
    pdfFile = "D:\\Job Number\\"+jobName+"\\PDF\\Cover.pdf"  
    
    var newaiFile = new File(aiFile);
    var doc = app.activeDocument;
    doc.saveAs (newaiFile);
    saveAI();
    
    var pdfOpts = new PDFSaveOptions();
    pdfOpts.pDFXStandard=PDFXStandard.PDFXNONE;
    pdfOpts.compatibility = PDFCompatibility.ACROBAT5;
    pdfOpts.preserveEditability = false;
    var newpdfFile = new File(pdfFile);
    doc.saveAs(newpdfFile, pdfOpts);
    }
    
    function saveAI( path, name, id ) {
      var saveOpts = new PDFSaveOptions();
      saveOpts.compatibility = PDFCompatibility.ACROBAT6;
    }
    doc.close(SaveOptions.SAVECHANGES);
    

Maybe you are looking for