CloseDoc is interrupting a batch run script in Acrobat X

I am using a batch script to split a PDF file and then process (send via email) the individual pages.  Because extractPages opens the new page each time it's called, I had inserted a closeDoc referencing the new doc object so that I didn't end up with multiple open pages or crash Acrobat.  The script below worked fine when tested in Acrobat 8, but in Acrobat X I get a Dead Object error, so I've commented this out.  The script below is just a snippet from a larger script, but it does work in A8, all of those variables are defined and have values within the process.
I checked the API and it says:
In versions of Acrobat earlier than 7.0, a document that closes itself by executing this.closeDoc
terminates any script that follows it. In Acrobat 7.0, the script is allowed to continue and to terminate
naturally. However, if the Doc of the closed document is referenced, an exception will be thrown.
I am not referencing the document object called 'send_document' after this call except in if statements that won't be run, is this still an issue, that the doc object is referenced at all?  Would it help to use a different variable name for the doc object in each section of my if/then statement?
Right now I'm being forced to work around it because I can close all the open documents at the end, but Acrobat crashes if we open more than 50 docs, and we do have multipage PDFs with more than 50 pages we need to process.  Does this seem like an error I should report or an issue with how I'm implementing closeDoc?
     send_document = this.extractPages(cnt, cnt) ;
            send_document.mailDoc(
                bUI: false,
                cTo: send_to,
                cSubject: subject_line,
                cMsg: message_text
            send_document.closeDoc(true) ;
Thanks ahead for any clues/help,
JP

Since you're not specifying the cPath parameter of extractPages it does not
return a Doc object, but null, according to the reference file.
Edit: My mistake, it's the other way around...
I've run your code and it seems to work fine (although it didn't go completely smoothly as I still had to manually allow the appliction to email the files).
Have you tried debugging it to see where the "Dead Object error" occurs?

Similar Messages

  • How do I run scripts in Acrobat.

    This is simple I know but my only experience is with Indesign and there is an SDK and a pallette that the user selects from. I am not sure if acrobat shares any similarities. Any help or direction would be appreciated.

    Read this:
    http://acrobatusers.com/tutorials/where_js_goes

  • How to interrupt running PS batch or script?

    Is there any shortcut in Photoshop or Bridge to stop running script or batch? I tried the usual suspects like Esc, Ctrl-C, Ctrl-Break and none worked. I am running Dr. Brown Services and by mistake I let it process 850 photographs instead of 34... The script has finished, but I would like to know for next time...
    Thanks!

    you could try to kill the whole application by pressing Ctrl+Alt+Delete and end the task from the Task Manager

  • Running a batch of scripts

    I've got a batch of scripts to run.
    I've run batches of scripts many times but I'm looking for a smarter way of doing it.
    I would like to be able to create a sql script that will run a batch of other scripts - but pass in the connection string.
    At the moment I use a script like this:
    set echo on
    spool cr_run_all
    conn cat1/cat1
    --tables
    @./cr_table_x_cat1.sql
    @./cr_table_y_cat2.sql
    @./cr_table_x_cat1.sql
    @./cr_table_y_cat2.sql
    --indexes
    @./cr_index_x_p_cat1.sql
    @./cr_index_y_p_cat2.sql
    --function
    @./cr_fn_x_cat1.sql
    @./cr_fn_x_cat2.sql
    --procedures
    @./cr_pr_x_cat1.sql
    @./cr_pr_y_cat1.sql
    @./cr_pr_z_cat1.sql
    --packages
    @./cr_pk_x_cat1.sql
    @./cr_pk_x_cat2.sql
    @./cr_pk_y_cat1.sql
    @./cr_pk_y_cat2.sql
    spool off
    exit
    Each script in turn has it's own connect string as the scripts are connecting as different users - cat1 & cat2 - I would like to make each script connect to a particular instance.
    Is it possible to create a sql script to run the other scripts that could pass the connect string for the instance to the scripts?
    This would save me having to put the connect string into each and every script.

    Hi
    You can call connect between scripts:
    @./cr_table_y_cat2.sql
    --indexes
    conn cat2/cat2
    @./cr_index_x_p_cat1.sql
    Or
    conn cat1/cat1
    @./all_script.sql
    conn cat2/cat2
    @./all_script.sql
    Ott Karesz
    http://www.trendo-kft.hu

  • Running a batch process from startup acrobat script

    Hi All,
    Need to start batch process sequence while acrobat is launched.
    Can anyone pls guide how to do this in startup javascript.
    thanks in advance

    can you pls explain how to open batch execute from startup

  • Script to open INDD files, run script, and close

    Hello, I'm looking for a script that will open a folder of Indesign files, open each one, run a selected script, then close each file.
    RIght now I'm using the Batch convert script, to convert INDD to INDD and run the script in between (then I delete the extra INDD file). But I'm trying to eliminate the conversion element, just need the script part of it.
    Anyone have any help? Thanks.

    Here's my whole code if it helps. I'm wondering if the script is moving too fast. I think that the first files are still PDFing while the others are opening and closing. Could that be it? I'm not sure why else the for loop for the PDFing is only working on the first file.
    var myFolder = Folder.selectDialog("Select Input Folder");
    var myIndsnFiles = myFolder.getFiles("*.indd");
    var exportPath=Folder("/").selectDlg("Select PDF output folder:");
    var pdfPreset = "Press Quality";
    for(k=0; k<myIndsnFiles.length; k++)
        app.open(myIndsnFiles[k]);
        var jobNumber = "12345";
            for (aPage=0; aPage < app.activeDocument.pages.length; aPage++)
                app.pdfExportPreferences.pageRange = app.activeDocument.pages[aPage].name;
                app.activeDocument.exportFile (ExportFormat.PDF_TYPE, File(exportPath+"/"+jobNumber+"_"+pad(app.activeDocument.pages[aPage].name)+".pdf"), false, pdfPreset);
                function pad (n) {
                return ("00000"+n).slice(-3);
    app.activeDocument.close();

  • Running scripts in Aperture

    Aperture appears to have the facility to run scripts during the import stage (it's called 'Action' in the import pop up menu), but I'm having problems with it.
    I have successfully run the script below, and have exported the subsequent metadata to the master, which is my aim.
    But I cannot get the script run via this 'Actions' facility during import, even importing into a second library after the 'Object Name' field (called 'Title' by Aperture) has been created in the file and contains a 'space'.
    Can anyone show me what I am doing wrong?
    I found the script at: How can I set the Object Name to the file name on import?
    The post reads:
    AppleScript to the rescue!
    1. Copy the following text into Script Editor:
    tell application "Aperture"
    set selectedImages to the selection
    set tName to name of item 1 of selectedImages
    repeat with i from 1 to number of items in selectedImages
    set this_item to item i of selectedImages
    set tName to name of this_item
    set value of IPTC tag "ObjectName" of this_item to tName
    end repeat
    end tell
    2. Save the script in a sensible place, such as ~/Library/Scripts/Aperture Scripts so that it will turn up in the Script Menu (if it's enabled).
    3. Select a bunch of images in Aperture.
    4. IMPORTANT! You must use Batch Change to put a value into the Object Name tag (such as " "), until you do so the tag doesn't exist for those images and therefore cannot be altered.
    5. Run the AppleScript, it should loop through all the selected versions and put the version name into the Object Name tag.
    Note - the Master File Name isn't accessible via AppleScript, only the Version Name.
    Ian
    P.S. As with all such scripts, test it on a small number of 'spare' versions before doing anything drastic...
    Help!

    I haven't. Have you tried making a droplet to run at the end of the LR export?

  • Error when running script from OTM

    Hi team,
    Customer is trying to run script from OTM but is getting a "JWG file does not exist" error. I found the following metalink note and the customer has verified that the repositories are defined with exactly the same names & paths in OTM & Openscript.
    Scripts Failing To Play Back From OATS Test Manager (OTM) (Doc ID 1587941.1)
    I've also checked the following post in the forums but this doesn't apply to the customer because both the OTM & agent are on Windows:
    https://forums.oracle.com/message/10707963
    Appreciate any pointers
    Thanks,
    Krishna

    Hi Krishna
    Is the agent running as a windows service or started from an interactive batch?
    What kind of script is that? Web, Forms, Siebel, other?
    Are they different repositories or the same? If different, how do you copy scripts from one to the other one?
    Cheers
    JB

  • EMAIL NOTIFICATION ISSUE AFTER BATCH RUN

    Hello All,
    I am having a problem getting email notification after our batch run in FDM.
    This is the following error on the task manager: Failed--2147220975 -  The message could not be sent to the SMTP server. The transport error code was 0x800ccc6d.
    Thanks

    Is the e-mail send in an event script or a custom script. I had issues where the custom script would work, but the event script would not ( i think it may have been because the custom script runs under the FDM user id whilst the event script runs under the windows service id. (Might be wrong, but i think that was the issue) 

  • HELP! adobe reader XI (11.0.09)  hangs on installation (running scripts package)

    adobe reader XI (11.0.09) hangs on installation (running scripts package). I cannot shut my computer down, because the installer won't let it and says "interrupting the install will damage the computer) I just wanted to update from 11.0.07 but it said contents had been changed so I had to reinstall adobe reader. So I am trying but it has been hours.

    Hi andrea02,
    Are you still facing this issue?
    You may try uninstall previous installation copy using Adobe Acrobat/Reader cleaner tool::  http://labs.adobe.com/downloads/acrobatcleaner.html
    Regards,
    Ajlan Huda.

  • Acrobat 8 Pro - how can I backup batch-processing scripts

    Is there a way to backup batch-processing scripts?

    Batch processes are saved locally as SEQU files, with the batch's name being the file name. You can get the path to the folder where they're located by running this code from the JS console:
    app.getPath("user", "sequences")

  • HT4759 can sign into icloud but won`t let me in . says wont open because of long running script . any ideas

    Can sign into icloud but wont let me in . says wont open due to lond running script . any ideas thanks

    Restart your PC and try again.

  • Run Script action not working when verifying bundle

    I have a critical "Run Script" action in a bundle. When verifying the bundle, the script doesn't seem to run and the verify action hangs indefinitely.
    I see the following lines in the ZCM Log:
    Code:
    [DEBUG] [07/21/2011 19:05:48.670] [5880] [runscriptenf] [1] [TeachGH] [Run Script Action] [] [Found script engine cmd.exe. Not using it since cmd.exe does not take parameters.] [] []
    [DEBUG] [07/21/2011 19:05:58.311] [5880] [runscriptenf] [1] [TeachGH] [Run Script Action] [] [Run Script Action - Ended - 7:05:58 PM] [] []
    nothing else is logged after those 2 lines. It seems like ZCM decides not to run the script for some reason, but is still waiting for it to complete? Or is it possible that it has moved onto the next action, but it is hanging there and not reporting it to the log?
    I have no time to troubleshoot right now, will do so in depth tomorrow. Just wanted to get this posted in case anybody has a clue.

    Nevermind, the next action is running, and that is what is hanging, which I doubt is Zenworks fault... Time for some more troubleshooting.

  • "Run Scripts" giving a problem to create portal domain

    Hello All.
    I am new to weblogic portal development. Was trying to create my basic sample portal in weblogic_portal_10.3.4 with the help of documentation. I am getting in running scripts when I was creating the domain. I have followed the below steps, please help me if you find any issue with my steps.
    1. downloaded Weblogic_Portal_10.3.4 and installed in my windows 7 environment.
    2. launched eclipse for weblogic portal.
    3. opened portal prospective in eclipse.
    4. right click on server tab and selected "Oracle WebLogic Server 11gR1 (10.3.4)"
    5. opened "Domain Configuration Wizard"
    6. Selected "Create a new Weblogic domain" radio button.
    7. in the next screen for "Generate a domain configured automatically to support the following products"
    selected "Weblogic Portal 10.3.4" radio button
    8. in the next screen given the domain_name
    9. in the next screen provided the password/confirm-password for administrator user
    10. in the next screen selected JRocket SDK and development_mode for my domain.
    11. in the next screen just left all the default configuration for the datasources. ( non of the datasource is selected in their check boxes)
    12. in the next screen just clicked on "Next" button and "OK" on my popup
    13. in this screen "p13nDataSource" is selected on my left top window area, All 3 SQL Files are selected for loading database.
    Clicked on *"Run Scripts"*
    At this point i am getting an error saying : "CFGFWK-60839:  Database Load Failed!"
    java.lang.Exception: SQLException when executing 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)
         at 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 message 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 message Connection refused: connect.
         at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
         at org.apache.derby.client.am.Connection.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
         at 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)
         at 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)
         at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
         at org.apache.derby.client.am.Connection.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
         at 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)
         at 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 that I am following to create my weblogic_portal_domain.
    I was following the steps mentioned at : http://docs.oracle.com/cd/E15919_01/wlp.1032/e14252.pdf to create my domain to start portal development.

    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 wrong, too.
    In 10.3.4, with derby, Run Scripts doesn't work any longer; it should still work the other database (Oracle, SQL Server, etc.). Instead, for derby, just create the domain, accepting any warning dialogs about databases that come up. After that finishes, in the domain directory, run create_db.cmd (on windows) or create_db.sh (on *nix and Mac). It should create the derby database files in the domain, and include everything needed.
    I'll send a note to get the docs updated.
    Greg

  • HT1222 hi i have a apple imac 27 2009 and i have purchased mountain lion but near the end it says An error occurred while running scripts from the package "mzps6175750011235388779.pkg"

    hi i have a apple imac 27 2009 and i have purchased mountain lion but near the end it says An error occurred while running scripts from the package “mzps6175750011235388779.pkg”
    can you please advise me what should i do to fix this

    Some ideas.
    https://discussions.apple.com/message/20034600#20034600

Maybe you are looking for

  • Regarding Vendor Payment

    Hi All, I have raised Vendor Invoice in F-43. Against to that i made a payment in F-53. But when i checked in FBL1n it is still showing as Open Item not as cleared Item. Can anyone please suggest why it is showing as Open Item? Do we need to do any c

  • Issue monitoring window

    We have an issue tracking system that I am trying to design an issue monitoring window for. I created the popup which has 2 frames: the top is the list of issues, the bottom is the assignments for that issue. The popup is set to refresh every 2 minut

  • WLS 6.1 SP4 available ?

    I heard that there is now SP4 for WLS 6.1. Is this true and if so, when and where is it ?

  • JMF with IPv6

    Hello! I am trying to solve the MediaLocator problem wirh JMF and IPv6. I read the solution for JMF with IPv6 allready brought up in this forum and the article 'http://www.ctie.monash.edu.au/DSS-IPv6/jmf-ipv6.htm', but it is not working. I checked al

  • HIERARCHY Tables TO FIND THE TABLE FOR HIERARCHY

    Hi BW gurus, can u help me to find the table that list all the table name for all hierarchy in finance FI so that I can extract the Custom R/3 hierarchies to BW . i HAVE An example like TKCHW table is hierarchy table for treasury cash management now