Moving files after running the script?

I am running an external script and try to get it to move the indesign files on the completion of a task. Back on the mac in Applescript, it was easy enough, but how do I do it in javascript on PC? Do I need to run a VBScript using doScript and if so, what it should look like or should I write an external application to manage the process?

Unlike the ACE or VB, JS has no move command - you must copy the file first, and then delete the original. But this results in the loss of creation, date of modification, labels, etc of the original files. I wrote a function to solve the problem. See the function move the files here.

Kasyan

Tags: InDesign

Similar Questions

  • batch file to run the script to report

    Hello

    How to create a batch file to call my script essbase report.

    Thank you!

    Hello

    you create a MaxL script that calls the report script. When it does not, you create a batch file that launches the MaxL script.

    MaxL example: export sample.basic database using fichier_journal '' $ARBORPATH/App/Sample/Basic/asym.rep' ' of data_file ' home/month2.rpt ";

    The batch file called essmsh.

    Kind regards

    Philip Hulsebosch

  • How to close all windows after running the SaveAsPDF script?

    I ran into the problem where I adjusted the SaveAsPDF script to backup my PDF files with a preset specific PDF I use. But after executing the script, all newly created PDF files are open in illustrator and I have to close it manually one by one, choose if I want to 'Save' or 'do not save' (even if they are already registered). I would like for them to close right after that the PDF is created.

    I've added in the script:

    if (myFile.open("w")) {
      myFile.close(SaveOptions.DONOTSAVECHANGES);
      }
    

    Who's going to run the script and close the files, but for only 3 of the 10, I opened. The 7 remaining won't be saved or converted to PDF. Is there something wrong in my script or anything else that I can try to solve this problem?

    Here is my complete script:

    /** Saves every document open in Illustrator
      as a PDF file in a user specified folder.
    */
    
    
    // Main Code [Execution of script begins here]
    
    
    try {
      // uncomment to suppress Illustrator warning dialogs
      //app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    
    
      if (app.documents.length > 0 ) {
    
    
      // Get the folder to save the files into
      var destFolder = null;
      destFolder = Folder.selectDialog( 'Select folder for PDF files.', '~' );
    
    
      if (destFolder != null) {
      var options, i, sourceDoc, targetFile;
    
      // Get the PDF options to be used
      options = this.getOptions();
      // You can tune these by changing the code in the getOptions() function.
    
      for ( i = 0; i < app.documents.length; i++ ) {
      sourceDoc = app.documents[i]; // returns the document object
    
      // Get the file to save the document as pdf into
      targetFile = this.getTargetFile(sourceDoc.name, '.pdf', destFolder);
    
      // Save as pdf
      sourceDoc.saveAs( targetFile, options );
    sourceDoc.close();
      }
    
    
      alert( 'Documents saved as MarkPreset PDF' );
      }
      }
      else{
      throw new Error('There are no document open!');
      }
    }
    catch(e) {
      alert( e.message, "Script Alert", true);
    }
    
    
    /** Returns the options to be used for the generated files.
      @return PDFSaveOptions object
    */
    function getOptions()
    {var NamePreset = 'MarkPreset'; 
      // Create the required options object
      var options = new PDFSaveOptions();
      options.pDFPreset=NamePreset; 
    
    
      // See PDFSaveOptions in the JavaScript Reference for available options
    
      // Set the options you want below:
    
    
      // For example, uncomment to set the compatibility of the generated pdf to Acrobat 7 (PDF 1.6)
      // options.compatibility = PDFCompatibility.ACROBAT7;
    
      // For example, uncomment to view the pdfs in Acrobat after conversion
      // options.viewAfterSaving = true;
    
      return options;
    }
    
    
    /** Returns the file to save or export the document into.
      @param docName the name of the document
      @param ext the extension the file extension to be applied
      @param destFolder the output folder
      @return File object
    */
    function getTargetFile(docName, ext, destFolder) {
      var newName = "";
    
    
      // if name has no dot (and hence no extension),
      // just append the extension
      if (docName.indexOf('.') < 0) {
      newName = docName + ext;
      } else {
      var dot = docName.lastIndexOf('.');
      newName += docName.substring(0, dot);
      newName += ext;
      }
    
      // Create the file object to save to
      var myFile = new File( destFolder + '/' + newName );
    
      // Preflight access rights
      if (myFile.open("w")) {
      myFile.close(SaveOptions.DONOTSAVECHANGES);
      }
      else {
      throw new Error('Access is denied');
      }
      return myFile;
    }
    

    Try this change

    for (i = 0; i< app.documents.length;="" i++="" ) ="">

    for (i = app.documents.length; i > 0; i--)

  • "Cannot run the script at line 1. File or folder does not exist. »

    Whenever I have start AfterEffects, I get an error as he is looking to find my recent projects.  The error is as follows: "unable to run the script at line 1. File or folder does not exist. "I haven't changed the location in one of my project files.  It's the same external drives that I use for months.  When I click on OK the same window opens several times and then finally the historic window opens completely blank and empty.  I am able to reopen projects however since the RECENT PROJECTS drop in the top bar.  It is a very strange and disturbing behavior.  In addition, I always use 13.7.2 because when I go to update it is impossible to connect and gives me this error.  I sat with Adobe support for an hour today, and we couldn't understand.  As I am in the middle of major projects, I decided to not update, but this error at startup is very worrying.  Someone has an idea of what could go wrong or how I can fix this?

    Thank you very much for your time.

    -Fredo

    Screen Shot 2016-07-06 at 7.21.26 PM.pngScreen Shot 2016-07-06 at 7.21.11 PM.png

    Ok!  Just got a response and an Adobe technical support solution.  The problem is that there is a problem with these versions of sequels (and I found the same problem in first to my horror this morning as well!) and the last couple Mac OSs.  The solution is to close the window "library".  It is then normally.  Apparently they fixed in the last update, but I found the same problem on my second computer, which has been updated.  Anyway, if anyone has this problem, close your cc library window.  Voila.

  • All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.

    All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.

    Script launched in until OS user 'A' on the 'A' server which launches sqlplus, then connects to a remote database through a service of tnsnames.ora as another user of the database and the results of this script are spoulées on the server "A".

    The file queued on the old server is written with rw-rw-r: read write user, group read the writing, reading and possession header that is the user of the OS. The file queued on the new server is written to rw-r-r user: reading writing, reading group, public reading and ownership oracle: dba.

    "" The user then has no privileges to modify the file and continue the process of transmitting the file, editing and deleting the file for the next set of commands. This allows us to keep the possibility to migrate to the new server we are unable to process orders.

    $ORACLE_HOME/bin/sqlplus - s user/password@prd1 @./script/CustomScript/R12_OM_UFPC-oracle.sql

    Background: old server running 4.8, Oracle 10.2.0.4 OEL

    New server running OEL 6.5, Oracle 11.2.0.4

    Tested so far:

    File and update umask to 0002 instead of 0022 is now generated as rw-r-r. However, the property is still oracle: dba.

    Update of ownershipt of $ORACLE_HOME/bin/oracle.exe of oracle: oracle (edi added the user to the oracle group) and chmod 6751 oracle.exe. This created several problems where crucial scripts, that is to say of sqlplus failed to run.

    Added! chmod 755 output.file.name - OS user 'A' is not allowed to change to mod.

    Added! command cp MV output file and that generated the file as a user of the operating system: oracle. It is a potential work around in case of emergency, but the developer would have to rewrite the countless scripts.

    Any ideas?

    I have reproduced the behavior of the old server and am able to spool a file via sqlplus under OS user. No changes have been made on the remote database server. All the changes have been on the new server hosting a small 11.2.0.4 database on a server running OEL 6.5 32 - bit OS.

    (1) removed the sticky bit $ORACLE_HOME/bin/sqlplus using chmod u-s, g-s, o - s suggestion of Billy ~ Verreynne

    (2) modified the main group for the 'oracle' user match the user operating system applications, while maintaining membership in the groups 'oracle' and 'dba '.

    -We are dealing with here EDI processes, so the Group was called edi.

    (3) modified property of the files tnsnames.ora and listener.ora for oracle: edi

    (4) restart the receiver

    (5) disconnect / reconnect

    Script runs as expected, the output file contains the correct ownership and permissions.

    Thank you all for taking a look and offering options.

    -Josh

  • Unable to run the script

    Hello

    I'm playing with host character, and so far I love it.

    However after exporting my scene and then trying to import using the AE

    New model of character animator Recording.jsx

    whenever I try to import the XML file, I get an error - Impossible to run the script on line 61.

    I'm doing something wrong?

    Thank you

    Hi Phil... After you run the script, select the first PNG file from the exported sequence. The title bar for the import dialog box has similar instructions, but it is true that it is easy to miss.

  • ' Run the Scripts of "give a problem to create the domain portal

    Hi all.

    I'm new to weblogic portal development. Was trying to create my basic example of portal in weblogic_portal_10.3.4 with the help of the documentation. I get by running scripts when I was creating the field. I followed the procedure below please help me if you find any problem with my steps.

    1. downloaded and installed Weblogic_Portal_10.3.4 in my environment of windows 7.

    2. start eclipse for weblogic portal.

    3 open prospective portal in eclipse.

    4. click on the Server tab and selected 'Oracle WebLogic Server 11 GR 1 material (10.3.4)'

    5 open "Domain Configuration Wizard"

    6 selected the option button "create a new Weblogic domain.

    7. in the next screen to "generate an automatically configured domain to take in charge the following products.

    selected radio button "Weblogic Portal 10.3.4"

    8. in the next screen given DomainName

    9. the next screen provided that the password/confirm password for the administrator user

    10. in the next screen select JRocket SDK and development_mode for my domain.

    11. in the next screen just left all the default configurations for data sources. (not the data source is selected in their boxes)

    12. in the screen following just clicked the button 'Next' and 'OK' on my popup

    13. in this screen "p13nDataSource" is selected on my top left area of the window, all 3 SQL files are selected for data loading.
    Clicked on * "run the script."


    At this point, I get an error saying: "60839-CFGFWK: database Load Failed!




    java.lang.Exception: SQLException when you run the file file:/C:/Oracle/Middleware/wlportal_10.3/p13n/db/derby/seq_drop_tables.sql
    at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:183)
    to com.oracle.cie.wizard.domain.gui.tasks.JDBCConfigGUITask$ LoadDatabaseThread$ 1.run(JDBCConfigGUITask.java:1673)
    Caused by: java.sql.SQLNonTransientConnectionException: java.net.ConnectException: error connecting to server localhost on port 1527 with Connection refused: connect.
    at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException (unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLException (unknown Source)
    at org.apache.derby.jdbc.ClientDriver.connect (unknown Source)
    at com.oracle.cie.domain.jdbc.JDBCConnectionTester.createConnection(JDBCConnectionTester.java:272)
    at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:154)
    ... 1 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException: error connecting to server localhost on port 1527 with Connection refused: connect.
    to org.apache.derby.client.net.NetAgent. < init >(Unknown Source)
    at org.apache.derby.client.net.NetConnection.newAgent_ (unknown Source)
    to org.apache.derby.client.am.Connection. < init >(Unknown Source)
    to org.apache.derby.client.net.NetConnection. < init >(Unknown Source)
    to org.apache.derby.client.net.NetConnection40. < init >(Unknown Source)
    at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection (unknown Source)
    at org.apache.derby.jdbc.ClientDriver.connect (unknown Source)
    at com.oracle.cie.domain.jdbc.JDBCConnectionTester.createConnection(JDBCConnectionTester.java:273)
    at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:154)
    to com.oracle.cie.wizard.domain.gui.tasks.JDBCConfigGUITask$ LoadDatabaseThread$ 1.run(JDBCConfigGUITask.java:1674)
    Caused by: java.net.ConnectException: connection refused: connect
    at java.net.PlainSocketImpl.socketConnect (Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket. < init > (Socket.java:375)
    at java.net.Socket. < init > (Socket.java:189)
    at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:206)
    at org.apache.derby.client.net.OpenSocketAction.run (unknown Source)
    to org.apache.derby.client.net.NetAgent. < init >(Unknown Source)
    at org.apache.derby.client.net.NetConnection.newAgent_ (unknown Source)
    to org.apache.derby.client.am.Connection. < init >(Unknown Source)
    to org.apache.derby.client.net.NetConnection. < init >(Unknown Source)
    to org.apache.derby.client.net.NetConnection40. < init >(Unknown Source)
    at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection (unknown Source)
    at org.apache.derby.jdbc.ClientDriver.connect (unknown Source)
    at com.oracle.cie.domain.jdbc.JDBCConnectionTester.createConnection(JDBCConnectionTester.java:272)
    at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:154)
    to com.oracle.cie.wizard.domain.gui.tasks.JDBCConfigGUITask$ LoadDatabaseThread$ 1.run(JDBCConfigGUITask.java:1673)


    CFGFWK-60839: database load failed!









    Please help me if you find any problem with the steps I took to create my weblogic_portal_domain.

    I followed the steps mentioned in the: http://docs.oracle.com/cd/E15919_01/wlp.1032/e14252.pdf to create my domain name to start the development of portal.

    Those are the WLP 10.3.2 instructions. But the 10.3.4 instructions in the tutorial (http://docs.oracle.com/cd/E26806_01/wlp.1034/e14252/setup_dev_env.htm#i1014619) are bad, too.

    In 10.3.4 with derby, Run the Scripts doesn't work; He still needs to work the other database (Oracle, SQL Server, etc.). Instead, for the derby, just create the field, accepting any dialog boxes warning on databases that arise. After that finish in the field directory, run create_db.cmd (for Windows) or create_db.sh (on * nix and Mac). It should create the derby database files in the field and includes everything you need.

    I'll send a note to get the updated documentation.

    Greg

  • When you run the script via VMware tools when power changed, some commands in script (as a copy) has failed.

    I came across a very strange question. I tried to create some custom vmware scripting tools, such as a new .bat file. This file contains a large number of orders, mostly as copy command "copy file://\\192.168.172.5\abc.exe c:\. ». I set this file as a custom script for Script event - power on guest operating system. Everything goes well with the bat file when I tested it. But after that I changed the State of power to power on, all other commands work fine except the copy commands in the bat file. Why? How can I make it work? Of course the problem of network. And that makes me very confused.

    Hello

    First copy the files on local disk was OK.

    If this works for local disk, but not to a network drive, then hit you indeed a permissions issue any.

    But if I run the script with tools VMware service script, the commands of copy (of the remote shared folder) failed while other controls worked well. I'm quite confused.

    In fact, it is easily explained. The VMware tools service (Yes, it's a service) runs under the account Local system and by default, the local system account has no access to the network for security reasons. You can change the user of the service runs under and see if that solves your problem (very likely)

    To do this, go to computer management (right-click icon desktop, select 'Manage') and open Services and Applications, service page, locate the VMware Tools service in the list. Select properties, log on to the page tabs and change account at your own Local System account. Restart the service and it should work.

    --

    Wil

    _____________________________________________________

    Visit the new VMware developers at http://www.vi-toolkit.com wiki

  • TypeError: try to run the script compilation and go on a 'mistake' in scope cleared when message returns the transfer through images for each image. Does not affect viewing.

    TypeError: try to run the script compilation and go on a contour

    Above the error message appears when moving between images - back and forth. By clicking on the OK button removes the error message and there is no apparent problem. The window that appears refers to a JAVA Script Application (I guess that FIREFOX is the application?)

    -> Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems

    Check and tell if its working.

  • Restore files after restoring the image using Windows backup

    Running W7 pro 64-bit. Had the problems of virus/malware, finally restored my discs from image system, dated 2 weeks ago and then restore backup files dated Windows from yesterday.

    When I go to save / restore my files, the update does not list a backup happened 2/14, the date of the restored image. When I go to manage Windows backup disk space, and then select backup period to remove the last date is 3/1, when I did the last backup. The date & time system is running with a date of 3/2.

    How can I fix it?

    Hello

    Thank you for visiting Microsoft Community.

    As I understood it, you experience the problem with changes to date during the restoration of files after restoring the image using Windows backup on the system.

    Certainly, I understand your concern.

    I suggest refer you to the articles below and check if that helps.

    Backup and restore: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows/back-up-restore-FAQ#1TC=Windows-7

    Restore files from a backup

    http://Windows.Microsoft.com/en-us/Windows/restore-files-backup#1TC=Windows-7

    Note: The article above will help you restore backed up version of the files that are lost, damaged, or changed accidentally. You can also restore files individual, groups of files, or all files that you have saved.

    Recovery and data backup

    https://msdn.Microsoft.com/en-us/library/bb727010.aspx?f=255&MSPPError=-2147217396

    I hope this information is useful.

    Please let us know if you need more help, we will be happy to help you.

    Thank you.

  • Cannot run the script line of 3712

    CFFO todo o principle pra instalar o ft_Toolbar 2, very ao open o after ele cylindrical o erro cannot run the script online 3712. undefined is not and the object. O that pode ser?

    You should find the forum for any product it is and post your questions there.

    Here is a link to a page that provides links to all of the Adobe forums...

    The Forum links page: https://forums.adobe.com/welcome

  • Access error of data while running the script in the script fdm workbench Editor

    Hello Experts,

    I get the error when I run the script in the script of fdqm established client.this editor is the error

    -2147467259 data access error and he navigates the error on line 30 on this script «Set rsAppend = DW.» DataAccess.farsTable (strWorkTableName).

    Please return me asap where I should charge peoplesoft data to one of my database of planning through fdm.

    Thanks in advance...

    You will need to build a script for integration that is an import Script that allows you to import data from SQL in FDM.

    When you create your import format, you will need to configure it with the file Type = Script and then assign the script of integration as an Expression. Assign your import format to the location that you use to import data.

    Then you can test it by going to the import stage and clicking the import button. FDM will run the integration script and data import by running the SQL query that you have defined.

    To the contrary, "Data Pump" import Scripts are used as import expressions in the import formats

    You can run a script to integrate the customer that this script requires input parameters that are passed only when then FDM import step is executed. If you want to see the raised error open the errorlog FDM. You will only be able to run this Workbench script when you want to debug data is being extracted, but in this case, you will need to comment code that inserts the data in the table. Don't forget that the work table is a temporary table that is created when you click on the import button and if you run Workbench this table does not exist

  • Run the script in photoshop indesign plugin

    Hello

    first of all, sorry for my English, second I am new in indesign plugins creation (before I made some scripts)...

    I would like to know if it is possible to create a kind of indesign plugin which can run the script on specific psd file photoshop.

    If it isn't, you can create the program that allows you to control the indesign and photoshop?

    I don't know where to start...

    Thank you.

    ExtendScript has a path called "BridgeTalk" to call scripts in applications.

    Your C++ plugin, you should first invoke a script in InDesign and then using BridgeTalk remotely invoke other applications.

    There are some documents on BridgeTalk in the Guide of the JavaScript tools available in the Help menu of ESTK.

    There was also some related discussions and examples in the forum script.

  • Run the Script on the Open Document event

    OK so I know about the spectacle of afterOpen and I think I understand how to use it, however, I do not understand how to open to a specific document.

    I don't want this script runs on all the documents that I opened, I would like to incorporate into a document and then run it whenever I open this document. Is this possible?

    Maybe run the script in the script label?

    Or I just put a script in the start Panel, and then create a session script that checks the name of each document open and then runs the script, if I have a match?

    Thank you

    As you chart put it in the startup scripts folder

    //startup script
    #targetengine "session"
    main();
    function main(){
        var myEventListener = app.eventListeners.add("afterOpen", excuteScriptLabel);
    }
    
    function excuteScriptLabel(myEvent){
              //The parent of the event is the document.
              var myDocument = myEvent.parent;
        if (myDocument.constructor.name == "Document") {
            if (myDocument.label != "")
                app.doScript(myDocument.label, ScriptLanguage.javascript);
        }
    }
    

    Then try this line on a document and save it, and then open the same file and a few others, you will notice that this code only run on this document:

    app.activeDocument.label = "alert (\"Yes\");";
    
  • Red field when I try to run the script with 10G

    I recently installed 10G XE. I am able to create a new user and was trying to run a script for JustLeeBooks on the site of Thompson Course Technology books. I downloaded the files on my computer and then entered the new user and viewed and downloaded the script. The area where appears the script is all red. When I click on run, nothing happens. This script box are red like that?

    I can click on remove and delete the script, but I can't seem to run the script.

    What should I do to run the script for my database class?

    Thank you.
    Vicki

    Hello

    Pre installed Apex XE is quite old and does not take in charge all new browsers.
    Did you try to use other browsers?

    You can also upgrade Apex
    http://www.Oracle.com/technetwork/developer-tools/Apex/upgrade-Apex-for-XE-154969.html

    But be aware that you lose the database management features. But you can make those for example with the SQL Developer as above shows link.

    Kind regards
    Jari

Maybe you are looking for

  • 31.1.2 Thunderbird will not download emails, nor completely closed

    Recently updated Thunderbird updated to 31.1.2. Soon, I noticed that it would not download email. With the help of "Getmail" caused his departure (green progress bar goes above all to the end), but the stalls. He did not get to ask the password (as b

  • Connection (enable WebService) error - CM1415fnw (latest firmware)

    Hello I bought amazing HP LaserJet Pro CM1415fnw color multifunction, yesterday. So my quest began: (1) installed the latest drivers on Mac OS X 10.6 (2) connect the printer to the desktop external network WiFi (AirPort Express with DHCP and static I

  • Upgrade to El Capitan and Photos

    I have an iMac with OS X 10.8.5 2010.  I use iPhoto ' 09 v.8.1.2 for a library with 28 826 photos (67 GB). I want to upgrade to El Capitan.  I bought a copy of Photos for Mac and iOS: The Missing Manual to try to prepare. First step of the author for

  • Communication series-1073807339 error

    Hey all,. I know that this type of question has been asked several times before, but I have browsed the forums and have been unable to solve my problem after working hours. To be honest, I don't know what the problem is. The program was working fine

  • When you try to access some programs, Windows Vista will stop and then restart

    There are some windows programs that I can't access because my computer says that windows has stopped working then he says looking for a solution and then he says: restart windows. I can't access my programs and features to remove some programs I thi