Save in batch (javascript)

We have a batch sequence that contains an execute javascript. It basically reads a specific file (not the selected pdf) to get a list of values, searches the selected pdf for these values, creates a report of found values and saves the report as a new pdf (different filename) in the same directory as the selected pdf.
It works correctly in 1 directory. When I run the batch sequence against a file in a different directory I get an error:
Processing error: NotAllowedError: Security settings prevent access to this property or method.
I've determined that the error is occuring when the report save is happening.
It happens whether the save is done in the batch javascript or via a trusted function. The trusted function is located in a .js file in the same directory as the global.js and  global.settings.js.
if the save is in the batch it is as follows:
var Rfilename = this.path.replace(/\.pdf$/, "_batchcreated.pdf");
var RDoc = new Report();
use writeText to add lines of text.
RDoc.save({ cDIPath: Rfilename});
if using the trusted function the batch has:
var Rfilename = this.path.replace(/\.pdf$/, "_batchcreated.pdf");
var RDoc = new Report();
use writeText to add lines of text.
var sdoc = mytrustedSaveDoc(RDoc,Rfilename);
the .js file has:
var mytrustedSaveDoc = app.trustedFunction( function (mydoc,myfilename)
    app.beginPriv();
    mydoc.save({ cDIPath: myfilename});
    app.endPriv();
})  // end trusted function

The doc property .path (this.path) returns the path and filename. So it is returning the path and file name of the selected pdf.

Similar Messages

  • Batch JavaScript Fails to Save PDF from XDP

    I generated hundreds of XDP files from a database query and need to merge them with a PDF template.  Using Acrobat Pro 8 interactively allows me to do this by opening the file and then saving it, but I need to do this for hundreds of files.
    So, I created a batch script that would run on all files in a folder and it does run on the XDP file but the form data is not populated in the PDF.  Batch mode seems to be different than Interactive mode when dealing with xdp files.
    Can I make this batch script merge the xdp form data into the PDFs?  Is there a different or better way to do this?
    Thanks.
    Peter
    In addition to just letting the batch process save the files, I also tried to save from a JavaScript "command" in the batch process.
    /* Save the document */
    app.execMenuItem("save");

    I tried that first (without the save), but the resulting PDF had no form data from the XDP.  That's when I added the save.
    The merging seems to fail when run from batch, but it works fine when I open and then save the file in Acrobat Pro or Reader.
    Is there a command in the batch processing that is necessary to move the data from the XDP to the resulting PDF?  Will the proper Save command do the trick?  [I left work early due to our snow so I can't try this myself.]
    --Peter

  • How to specify the saving path pdf by a "saveas" button in Javascript?

    Hello,
    Firstly, I use LiveCycle ES3 designer on PC. I created a form with a button executing a Java script that opens a dialog box "save as ..." like this:
    \ \ Script save-as \ \
    app.execMenuItem ("SaveAs");
    I would like to predefine a file path to open the dialog box that opens by default on the current location of the file "C: \ export \" for example.
    Could someone help me telling me the code and nomenclature to be used for this?
    I know Livecycle use XFA language and can use the "myDoc.saveAs ();" but I do not know how :-/
    I found this post in this forum but I don't understand how to use this code directly with a click event on a button
    http://forums.adobe.com/thread/685920
    There is also a tutorial here but I can not seem to apply
    http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
    Thank you in advance for your help :-)

    Try putting this script in the click event of the button
    Hidden_Text_Field_Path.rawValue=this.somExpression;
    This ought to work using either FormCalc or JavaScript.  I'm not sure from your description whether you will need to use the full path name for the hidden text field or use a relative one, but that's not too hard to deal with.

  • While executing onLoad in Date_before Save.htm, a JavaScript error occurred

    While executing onLoad in Date_before Save.htm, a JavaScript error occurred, I have looked af the Forum and it tells me to delete Program Files\Macromedia\Dreamweaver CS3\Configuration\Commands and I cannot find these files despite searching.
    I had a text conversation with support at Adobe and they no longe support Dreamweaver CS3!  Has anyone else had a similar problem and if so how was it fixed.
    Regards

    Troubleshooting JavaScript errors in Dreamweaver
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19105#dat
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "jockamo" <[email protected]> wrote in
    message
    news:etpo3o$54c$[email protected]..
    >I have set up some pages to have an automatically
    updating "Last Modified
    >On"
    > date. However, I have been getting 2 error dialog boxes
    every time I save
    > a
    > file, both with the same message: "While executing
    onLoad in
    > Date_beforeSave.htm, a javascript error occurred." In
    looking at some
    > other
    > threads on this forum, I have tried deleting the
    Application Data files
    > "Configuration\SiteCache\SEL Web Site.dws" and
    > "Configuration\WinFileCache-####.dat". I have also tried
    several
    > different
    > date formats, but that didn't seem to change anything.
    >
    > I have not been able to find any threads specific to
    this exact error,
    > though.
    >
    > Any help would be highly appreciated! The site is at
    >
    http://picea.sel.uaf.edu/index.html,
    if that helps.
    >
    > Thanks for your help,
    > Jock
    >

  • To save it in javascript...

    please give me an idea of how to solve this beginnes's error.
    i created a .mxml and a class type .as (\ChartTest\src\generated\webservices\MyArray.as)
    but when i try to debug it i am not able to save it in javascript (AC_OETags.js).
    thanks for your help (soory for my inglés, i am chilean )
    [email protected]

    las .as estan en C:\inetpub\wwwroot\Grafico_Pr01\src\generated\webservices
    este mxml esta en C:\inetpub\wwwroot\Grafico_Pr01\src, descrito a continuación
    importe el web services de impotar wsdl.
    gracias
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="white" viewSourceURL="srcview/index.html">
    <mx:Script>
    <![CDATA[  
    import mx.rpc.events.ResultEvent;  
    import generated.webservices.Accesos;
    import generated.webservices.WSUsuarios;  
    import mx.collections.ArrayCollection; 
    private function Reload():void  
    var urlRequest:URLRequest = new URLRequest(Application.application.url);
    navigateToURL(urlRequest,"_self"); 
    [Bindable]
    private var misUsuarios:ArrayCollection;     
    private function ResultadosUsuarios(event:ResultEvent):void  
    misUsuarios = event.result as ArrayCollection;         
    for (var i:int=0; i<misUsuarios.length; i++)         
      var current:WSUsuarios = new WSUsuarios();             
      current = new WSUsuarios(misUsuarios.getItemAt(i));             
      misUsuarios.setItemAt(current, i);         
    ]]>
    </mx:Script> 
    <mx:WebService id="miWSUsuario" 
    wsdl="http://www.capacitacionlaboral.com/SU2/gerencia/WebServiceEstadistica.asmx?wsdl" 
    load="miWSUsuario.ObtenerUsuarios()" showBusyCursor="true" result="ResultadosUsuarios(event)" />
    <mx:DataGrid id="dataGridAccesos" dataProvider="{misUsuarios}" width="210" height="92" x="10" y="383"
      visible="false"/> 
    </mx:Application>

  • Save multiple Batch settings

    I have two actions, which need to be executed separately through a batch command. Now I continuously have to change the batch settings if I want to execute one or the other action in batch mode. This is because the actions require a different input folder. Is there some way I can save both batch settings, so I don't have to input them each time I use one of the actions? Thanks in advance.

    Thanks Grant and PECourtejoie.
    Grant, I used your approach. I recorded an action on a batch command with the right settings. I duplicated this for each specific input folder and input folder action. Using the Bridge's "image processor" tool is beyond my current grasp of Photoshop. I'll write it down on my "Photoshop things to learn" list .

  • Is there a way in Final Cut Pro 7 to save custom Batch Export settings?

    Is there a way in Final Cut Pro 7 to save custom Batch Export settings?

    Don't think so.  Years ago, I seemed to figure out a way in an earlier version of fcp, but when I tried to recreate it, I couldn't make it work.
    You can send to compressor and save custom presets there.

  • Save results of javascript operation to a plain text file

    Hi,
    How do you save to a file using Acrobat javascript? Not a PDF file - I know how to do that - but to a plain text file.
    I have javascript that searches through a PDF document and generates some output. I can send the output to a Report (in PDF format, obviously) or to the console, but I can't see how to send it to a plain text file, which is what I need.
    Any assistance gratefully appreciated.
    Thanks,
    Tim.

    Ah, great, yes that seems to do what I want.
    However, I get an error ...
    My code is as follows:
    function CreateOutput()
         // assembles text and puts it into the variable: output
         // e.g.:
         output = "Hello, world";
    var output = "";
    CreateOutput();
    this.createDataObject("testfile.txt", output);
    Unfortunately I get this error and I don't understand it!
    InvalidGetError: Get not possible, invalid or unknown.
    Doc.pageNum:6:Batch undefined:Exec
    Obviously I'm doing somethign wrong ... but what?
    Thanks very much,
    Tim.

  • Save As Using JavaScript

    Hello everyone,
    I cant figure out the javascript to have a button do a save as and use content from a field as the new file name. Can anyone help me with this?

    It worked, thank you!
    Now, do you know if there is a way to make this work with an ipad?
    My ultimate goal is to create a workorder form that I can access from my ipad. I already have a button set up to generate a unique work order number. I have used the code from the post you provided to have a button do a save as and use the work order number as the file name. So everything is working exactly how I want it on my computer but I would like the same functionality on my ipad.
    Please let me know if you have any suggestions. Thanks!

  • SaveAs in Batch Input Recorder

    Hi! I'm Cherrie, a newbie. Is it possible to incorporate exporting attached file of an email message to Batch Input Recorder? How?
    Trying to save the file to a local pc automatically as batch input recorder process. However, it always stops where export button is to be clicked as before SaveAs dialog shows.
    Please help.

    Hi,
    It's not possible to save file to local pc if you run your program in background.
    Krzys

  • Javascript question. Possible to save bookmark with javascript in Safari?

    Is it possible to save a bookmark using javascript in Safari?
    In IE I use:
    window.external.AddFavorite(url, title);
    In Firefox I use:
    window.sidebar.addPanel(title, url,'');
    In Safari I have no clue.
    Any thoughts, is it even possible?

    I'm going to call this bookmark function from inside a Flash application and I don't want the URL to be the exact URL that the Flash application has.
    If you have a solution to the problem I would be very happy if you could post it!

  • Is it possible to save a batch of flash 8 files as flash 2004

    I have the pretty arduous task of saving off hundreds of
    flash files as an older version. I wondered if anyone knew if it
    was possible to do this to multiple files rather than me having to
    go through them one by one.
    looking forward to hearing from you!

    melushka,
    > I had a try with autoit but unfortunatly I've never used
    this
    > kind of program so it's all gone over my head!
    I considered a bit before making that suggestion, but I
    believe, in this
    case, it (or something like it) is the only truly automated
    solution.
    > It's a pain that the history within Flash isn't an
    option for
    > save as- that seem to be more my level of computer
    > expertise.
    The History panel is a decent way to be introduced to JSFL,
    actually.
    Steps are recorded automatically and may be saved. When
    saved, they become
    .jsfl files in this folder (Windows) ...
    C:\Documents and Settings\<user>\Local
    Settings\Application
    Data\Macromedia\Flash 8\en\Configuration\Commands\
    They're text files, and can be viewed (and edited) in Notepad
    or any simple
    text editor.
    But as you've discovered, Save As doesn't seem to be an
    option in the
    History panel, and although it is programmable directly, it
    prompts the user
    for input, which means it cannot be completely automated. :(
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Creating a photoshop action to save a batch of images as patterns

    I am trying to use Photoshop actions to script about a thousand image files into PAT files. I am running into a problem with actions when it comes to defining a pattern. The program naturally selects the filename as the name of the pattern when doing it manually, but when I do this while recording an action Photoshop logs the filename used in creating the action and then uses that filename for all sripted patterns. Is there a way to alter that setting to select the current file's name instead?

    You might want to move this thread to the general photoshop forum if tou want an action.  However your not going to be able to do create the action you want for when you record menu Edit>Define Pattern the "Pattern Name Dialog" will pop up and whatever is used in it will be recorded into the action.
    Also Photoshop Scripting DOM does not have a interface for creating and nameing patterns.  However you should bne ale to write a script to do what you want using code generated with Photoshop Scriptlistner Plug-in and modifying the hard coded name to a variable you set with somthing like the active document name.
    Before defining the patern you may be able to see if the name is all ready use for a pattern name so you can add something to the name to avoid duplicateing name.
    ScriptListner Code difine pattern
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref12 = new ActionReference();
            var idPtrn = charIDToTypeID( "Ptrn" );
            ref12.putClass( idPtrn );
        desc14.putReference( idnull, ref12 );
        var idUsng = charIDToTypeID( "Usng" );
            var ref13 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idfsel = charIDToTypeID( "fsel" );
            ref13.putProperty( idPrpr, idfsel );
            var idDcmn = charIDToTypeID( "Dcmn" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref13.putEnumerated( idDcmn, idOrdn, idTrgt );
        desc14.putReference( idUsng, ref13 );
        var idNm = charIDToTypeID( "Nm  " );
        desc14.putString( idNm, "Pattern 5" );      <------ change "Pattern 5" to be a variable
    executeAction( idMk, desc14, DialogModes.NO );

  • Export a batch action/list?

    Is it possible to save a batch action to a file, and then import that action to another user's computer?
    For example, Photoshop has an action list and you can export 1 action or a set of actions, then import it to another machine very easily (using save/load). I would like to do the same thing. If it's impossible, this is a major oversight.
    Thanks,
    Chris

    Batch sequences are saved locally as SEQU files, which can be copied from one computer to another.
    To find out the exact location(s) of these files on your computer, run this from the JavaScript console:
    app.getPath("app","sequences");
    app.getPath("user","sequences");

  • How to 'save a copy' of a pdf?

    I am trying to change the security of the pdf  in which 'extend features in adobe reader' option is enabled. To change this i have to save a copy of a pdf.
    How to save a copy of a pdf  using acrobat sdk or javascript or batch processing?
    I have tried saveAs method in javascript but it doesnt work.
    Please Advice.

    Im trying to save the document in a location, but it is giving me a "Error 3: Bad parameter".
    Here is my code.
    DURING
              ASFileSysReleasePath(fileSys,pathName);
              ASPathName newPathName = ASFileSysCreatePathName(fileSys, ASAtomFromString("D:\\newPdf.pdf"),NULL,NULL);
              PDDocSave(pdDocForExp, PDSaveFull | PDSaveCopy, newPathName,fileSys, NULL, NULL);
              PDDocClose(pdDocForExp);
    HANDLER
               char  buf[256], errmsg[256];
                sprintf(buf,  "Error %d: %s", ErrGetCode(ERRORCODE),      
                ASGetErrorString( ERRORCODE, errmsg,  sizeof (errmsg) ) );
                AVAlertNote(buf);
    END_HANDLER

Maybe you are looking for

  • Playing not selected music in iTunes 9

    Hi all! I imported complete albums in iTunes. Because I do not want to hear the complete album on the go I selected/acitvated some title. The sync parameters for the iPhone are set to "only selected/activated titles". At home I'd like to hear the com

  • Segmentation of Organizations related to other Organizations

    Hi Experts, I am trying to segment Organizations (e.g. Sold-tos) that are related other Organizations (e.g. Buyers). Buyers are not created as contact persons but as corporate accounts as well and are connected to the Sold-to via the relationship "Ha

  • PCMCIA Network card for public network

    Hi All I am going to setup Oracle RAC on my laptops and would like to use PCMCIA netwrok card as public network, but I am wondering if it there would be any issue at all. Could anybody advise please. Thanks Soheil

  • Physical Inventory-Cycle count

    Gurus, I am getting this when use the TC-LI20 Storage bin 1000000073 in storage type 999 does not exist.What should be done.

  • Click a button, wait mc A to finish playing and play mc B

    Hello. I am using Adobe Flash pro CS6 and AS3. Right now I am trying to make a button to play a new mc. There are 2 movie clips. mc A and mc B. What I want to do is my swf is playing mc A but if I click a button, it starts to play mc B, but I want to