Folder level javascript.

how can i use getNthPageWord methode from folder level script.

function SaveXml() {
myFun = app.trustedFunction( function()
    app.beginPriv();
if(this != 'undefined')
    try
       for(i=0;i<70;i++)
          var arr= new Array();
          arr=this.getPageNthWord(2,i);
          console.println(arr);
    app.endPriv();
          catch(e){
          console.println("error");
}else
     console.println("undefined");
          console.show();
and i am calling savexml methode in cExec: property of addToolButton.but it is not working please tell where i am making mistake.

Similar Messages

  • Folder level Javascript disabled for a user

    Hi Gurus,
    I created a folder level JS, it works fine on all computer here exept on one. On one computer, the javascript's in the pdf are working but the function called in the folder level script is not executed. (when it works on all the others). The script is in the right folder and the pdf works on other computers. Do I have to enable something in the preferences of acrobat reader 9.1. I checked the settings for JS in edit/preference and they are the same as for the others.
    Thanks for your help guys.

    All the script does it to generate a mail with the mailto function. The Preferences-JavaScript are set as on my pc. So it must be something else. If I email the pdf to my pc, it works, so the pdf form is fine, the script is the same as on my pc.
    --- En date de : Mer 2.9.09, try67 <[email protected]> a écrit :
    De: try67 <[email protected]>
    Objet: Folder level Javascript disabled for a user
    À: "antony clark" <[email protected]>
    Date: Mercredi 2 Septembre 2009, 13h35
    That's why I recommended to make a
    test script, to make sure folder-level
    scripts are working on this machine.
    There's no setting to specifically allow folder-level
    scripts. If they are
    properly placed and JS is enabled then they will launch.
    However, if your script inserts menu items you should make
    sure that this
    option is checked under Preferences-JavaScript, the second
    check-box from
    the top. You should probably check all 4 boxes, just in
    case.
    >

  • Is there a way to respond to Doc/Open events from a folder level javascript?

    I'm wondering if there's a way to respond to Doc/Open events from a folder level javascript. If not, is there a way to programatically add a Document javascript to a PDF upon/after export from InDesign?
    Thanks-
    Jeremy

    Bernd,
    Thanks for your reply. I take what you write to mean that I can add a document-level javascript manually once the PDF is exported. But this is what I'm trying to avoid.
    Ideally, I want to respond to Doc/Open events from a folder level javascript, but I'm not sure if/how I can make an event listener with Acrobat JS. If I can't do that, then I'm looking for a way to programatically add a Document level javascript upon export from InDesign - not manually within Acrobat, once the PDF is created.
    Any thoughts?

  • Need help with folder level javascript to automate "save button" on a fillable form

    I have been racking my brain for the past 6 hours trying to get a simple save button to work.
    Background: I am using Acrobat Pro 11 to create a save button on a fillable form. My intent is for the end users (my team of 3, whos computers I have access to) to be able to fill out the form, click save, and have the filename appended with date and other info and saved to a local folder on their machine.
    I am attempting to take the default form name i.e. Support Call Log.pdf and have three of the feilds within the form generate a new file name. --> Support Call Log_Brad_121_2015
    End users will fill out the form using adobe viwer X.
    Instead of putting the code that I have tried, modified, and tried again and again. I would like to ask for a fresh start and then see if I can locate my error after. I need to know what to put in my folder level script, line for line.
    I also need to know the correct syntax and format to establish a new file name with the extracted feild data, saved to the same exact file path as the original document.
    Any and all help will be greatly appreciated, I am about to go crazy!!!

    Didn't let me do it, invalid. So, here is what I have now changed my button code to:
    //get field value
    var fv1 = getField("Technician:").value;
    var fv2 = getField("Date Received:").value;
    var fv3 = getField("Unit Number:").value;
    // Split Path into an array so it is easy to work with
    var aMyPath = this.path.split("/");
    // Remove old file name
    aMyPath.pop();
    var NewFileName = "Support Call Log" + "_" + fv1 + "_" + fv2 + "_" + fv3 + ".pdf";
    NewFileName = NewFileName.replace(/[\s\!\?\<\>\'\"\*\/\\\=\?\^\`\{\}\|\~]+/g, "_");
    aMyPath.push(NewFileName);
    //save
    mySaveAs(this,aMyPath.join("/"));
    Im still getting the error dialogue box, and nothing shows in my javascript debugger window when I click the button. Seems to be something goofy with my Folder level script:
    var mySaveAs = app.trustedFunction(
         function(oDoc, cPath, cFlName)
              cPath = cPath.replace(/([^/})$/, "$1/");
              try{
                   oDoc.saveas(cPath + cFlName);
                   catch(e){
                                  app.alert("Error During Save");

  • Is it possible to install folder level script automatically by any other application ?

    I want to install  folder level javascript through flex application .is it possible to do this or by any other technology.
    1 way to do is to copy file using file stream of that application but as directory for folder level javascript is protected one therefore file operation give i/o error
    any other solution .

    I do not think any Adobe product will allow you to do this for obvious reasons. '
    You can use any installer program the will perform the installation for users if the users decide to allow your request.

  • Import Text Data to text fields with folder level script

    I am using Adobe 9 professional and have a folder level javascript to import text into existing fields of a pdf.
    There are multiple fields with multiple rows of data to be imported.
    The folder level script is not working (but there are no errors in the console showing when run)
    I have manually tested opening the text file with the following code in the console and the text file opens and populates the text fields, so the text file must be correct:
    this.importTextData();
    The following code is the folder level script which is not working:
    function mailmergeFunction()
    // Import the first row of data from "Mailmerge.txt"
    this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", 0)
    if (typeof cnt == "undefined") cnt = 0;
    this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", cnt++ % 4)
    app.trustedFunction(mailmergeFunction);
    app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
    If anyone can please provide some assistance, it will be most appreciated thanks.

    Working fine now, changed the location of the file path - could have been something to do with having an apostrophe.
    function mailmergeFunction()
    app.beginPriv()
    // Import the first row of data from "Mailmerge.txt"
    this.importTextData("/h/mail merge/Mailmerge.txt", 0)
    if (typeof cnt == "undefined") cnt = 0;
    this.importTextData("/h/mail merge/Mailmerge.txt", cnt++ % 4)
    app.endPriv()
    app.trustedFunction(mailmergeFunction);
    app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
    Thank you for your assistance George, much appreciate your help.

  • How to search "ActiveDocs" in folder-level script

    I am trying to perform a search in an Acrobat folder-level javascript like this:
         function timerCallback() {
              app.beginPriv();
              search.query(searchText, "ActiveDoc");
              app.endPriv();
         app.beginPriv();
         app.openDoc(path_to_my_doc);
         app.endPriv();
         app.setTimeOut("timerCallback()", 5000);
    I use the setTimeOut function to make sure that the document has had enough time to open before I start the search.  The problem is that I get this error:
              GeneralError: Operation failed.
              Search.query:24:Folder-level:App:SearchScript.js
              No active document
    It seems like I can't "see" active documents from a folder-level script.  Is there any way around this?
    Thanks

    A folder-level script can be used for two things:
    - Execute commands relevant to the application as a whole, NOT dependent of
    any specific document (e.g. adding new menu items).
    - Create functions which should be available to any document or script that
    might need them (e.g. formatting a string in a certain way).
    What you're trying to do is neither here nor there. If you want to be able
    to search existing documents, you can use a folder-level function, but then
    you need to call it from somewhere else, like a menu item or a toolbar
    button.

  • Document-level Javascript as Object

    I created a document level script called Utility.
    I want to create methods within this script rather than coding each one separately.
    function Utility()
    this.getFormattedDateOnly=function(pDate) {
      if (typeof pDate == "undefined") {
        pDate = new Date();
      var retval = util.printd("m/dd/yyyy",pDate);
      return retval;
    this.getFldsOnPagenum = function(pPageNum, pDoc) {
      /* returns an array of the form fields who are on or start on a page */
      /* zero based return ; however pPageNum is 1 thru numPages, not 0 -> numPages-1 */
      var currPage;
      var currFld;
      var cnt = -1;
      var ARflds = [];
    CPR("# flds=" + pDoc.numFields+" Type of pDoc:"+ (typeof pDoc));
      for (var i = 0; i < pDoc.numFields; i++) {
        currFld = pDoc.getNthFieldName(i);
        if (typeof currFld.page == "number") {
    CPR("page="+(1*currFld.page+1));
          if ((1*currFld.page+1) == pPageNum) {
            cnt++;
            ARflds.length = cnt + 1;
            ARflds[cnt] = currFld;
    CPR("\n cnt="+cnt);
        } else if ((1*currFld.page[0]+1) == pPageNum) {
          cnt++;
          ARflds.length = cnt + 1;
          ARflds[cnt] = currFld;
      return ARflds;
    var MyUtil = new Utility();
    This is all working fine with the following exceptions:
    1) the methods are not being registered in the Javascript hierarchy listing.
    That's annoying.
    2) "This" is not recognized at the document level....I must pass it as a parameter (pDoc).
    I thought that was strange...I could see it if were at the folder level.
    It appears the document object is out-of-scope !!
    3) currFld = pDoc.getNthFieldName(i);
    The above is failing....sending back a "currFld is undefined" error.
    I don't see the problem....very strange IMHO.
    When I call the getNthFieldName function from the console....no problem.
    What am I doing wrong in the definition here ?
    It appears that what I did has Acrobat functions and document properties out-of-scope.

    I think this would work if you could make the document object a member of the Object being created.
    To do that, a constructor needs to be invoked so that it can instantiate a public property of the Object.
    var MyUtil = new Utility(this);
    inside of Utility I would have:
    this.oPDFdoc =  this;
    thereby transferring a reference to the entire PDF document to my Object.
    Getting this to work would eliminate the need for all of the document-level javascript references.

  • Error Running Doc-Level JavaScript from VBS

    I have the document level javascript function in my PDF document "FillForm()", (see code below).  When I run my VBS code, (see code below) I get the error:  "Run-time Error '438': Object doesn't support this property or method." on the "jso.FillForm" line.  I can execute 'jso.console.Show' without a problem.  What am I doing wrong?  (Oh, and it has to be a document level funtion, and not a folder level function.  And once I get this working, I'll be passing parameters.  I'm using a stripped down function just to get this to work).
    DOCUMENT JAVASCRIPT
    //<Document-Level>
    //<ACRO_source>FillForm</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: Document-Level:FillForm ***********/
    function FillForm()
    var textHolder;
    textHolder = this.getField("dorReturnAddress");
    textHolder.value = "dorReturnAddress";
    textHolder = this.getField("attn");
    textHolder.value = "attn";
    //</ACRO_script>
    //</Document-Level>
    VBS CODE
      Dim wAcro As Acrobat.AcroApp
      Dim dAcro As Acrobat.AcroPDDoc
      Dim jso As Object
      Set wAcro = CreateObject("AcroExch.App")
      wAcro.Show
      Set dAcro = CreateObject("AcroExch.PDDoc")
      dAcro.Open (ThisDocument.Path & "\" & "Worksheet - Template.pdf")
      Set jso = dAcro.GetJSObject
      jso.FillForm
    - Thanks in Advance!

    You can use the function ExecuteThisJavascript. Read more here:
    http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=16431

  • Folder level script? How can I use field value as a pdf filename in save as dialog box

    I read somewhere that if you use a folder level script, you can do things like save a pdf with a specific filename - possibly based on a field name.
    How would one set up a folder level script?
    How do you execute a script from the PDF?
    What code would you use to change the PDF name to the contents of the fFieldName text field?
    Or, is this really just impossible to do?

    The article is interesting.  It suggests you place code like this:
    // Page Replacement Function
    var ReplaceLastPage = app.trustedFunction( function(cPath) {
    app.beginPriv();
    this.replacePages(this.numPages-1, cPath); app.endPriv();
    In the trusted folder.  What is the path of the trusted function(s) that get automatically loaded into Acrobat?
    I assume in the example above, function(cPath) is a function inside of the PDF...

  • Acrobat X Standard User: How can I view PDF metadata from a folder level?

    Hello All,
    This is my first post to this community. I would not be surprised if the answer to my question can be found in a simple search or tutorial. However, I assure you that I have been searching, clicking, reading and even attempting to install new software all morning and have only succeeded in further confusing myself.
    I'm running Adobe Acrobat X Standard on a Windows 7 machine. My job includes the management of legal documents of conveyance. All conveyance instruments have a set of unique identifiers such as the county where the deed was filed, the book and page where it is filed, the type of instrument, and the date it was filed. Historically I have tried to jam all of this information and more into the file name of a pdf. For example: "105_Bk109-Pg188_Assignment_05251950" is the name of a file that I have open right now that indicates an Assignment filed in Crockett County, Texas (code 105) at Book 109, Page 188 and recorded on May 25, 1950. I typically work in folders that contain around a hundred similar documents with all of the fields I have described varying. My objective is to begin moving this information into the metadata or properties of the individual PDFs AND then be able to view those fields in Windows Explorer from the folder level. As I understand it, this is not possible. When I began searching for an alternative solution, I found several references to Adobe Bridge and attempted to install it. The installation failed, but more importantly I am not interested in becoming a CC user as I don't feel like it is necessary for what I am trying to accomplish. I'm not working with HD photos or video.
    So my question is this: Is there a way (that doesn't involve purchasing and learning Adobe Bridge) that I can modify the attributes/metadata/properties of a pdf, and then see the modifications in a folder viewer without opening the pdf? Thanks in advance for your help.

    Thanks for responding. I suspected that my understanding of metadata was incomplete or inaccurate. As I understand it, the metadata for any given pdf can be found by first opening the pdf; clicking File -> Properties, which opens a dialog box titled "Document Properties". The first tab in the dialog box is "Description" and includes the fields File, Title, Author, Subject, and Keywords. The values for these fields are what I'm referring to as metadata. Additionally, from the Document Properties dialog box, clicking on the "Custom" tab allows you to create custom properties and values, which I also considered to be metadata. I have manipulated these fields for a certain pdf as shown in the two screenshots below:
    After making this changes, I saved the pdf and closed it. I then navigated to the folder where the pdf is stored using Windows Explorer. As you can in the following screen shot of WE, that the pdf I have made the changes to is the first in the list. The Windows Explorer columns include: Title, Pages, Author, and Subjects, but their values are all blank and fail to show what I have assigned them in the PDF properties (or what I thought was metadata). As for my custom fields, Windows does not give me any kind of option to display those. Windows inability to display something as simple as the number of pages in the PDF is completely baffling to me.
    My objective is to be able to modify the standard document properties of a PDF with usable information, those being Title , Author, Subject, and Keywords. I would also like to be able to create the custom properties with additional useful information. I would then like to be able to use a file manager, to view the contents of a folder full of pdfs, similar to the screenshot above, and see the properties and custom field values that i have assigned to the pdfs in columns of the list of pdfs. Windows Explorer is the only file manager I have ever used. It's possible that the solution to my problem could be as simple as changing file managers. It may be that what I'm after is not possible at. Any suggestions would be greatly appreciated. Thanks.

  • Document-level javascript quandry

    Ok, completely clueless newbie here whose only coding experience is Access VBA…from a few years ago. Need to write up some Javascript to make this work – that was a month’s worth of a migraine.  I ask for your patience, and would like to ask for forgiveness in advance for any headaches I induce while you try to figure out my problem(s).  Also, I’m not sure how to copy paste images or code examples, but I will do my best.
    So, basic premise:  make a drop-down combo box that will populate another combo box based on whatever was selected in the first box – in this case, 31 items in the ‘Inventory Parts Used’ list, and a total of 427 respective sizes in the other list. 
    YES, I’ve already looked at that http://acrobatusers.com/tutorials/js_list_combo_livecycle1 example, and followed it closely.  Took me forever, but I somehow got it to work. Was very happy.  Only thing I couldn’t figure out was the export value b/c mine wasn’t a number.  But I solved that by putting the CodeID and respective PartSize together (ex: 4-inch Fire Hydrant would show up as "FH-01:  4"). Anyways, I selected that working row and choose the “Place Multiple Fields” option times 15 rows.  Still working.  I’m dancing a jig. Then I tried to check on the code: 
    “Text cannot be displayed in full by the Edit Dialog.  Please use an External Editor.” 
    Uh… So I deleted a row at a time until I could see what my limit was.  I had to pare down 15 rows to a measly 3 rows.  Took me a while but I was able to see where the problem was.  Instead of being written into the Document-Level JS, my array was tied to the first combo box’s Keystroke event on the Field Level.  So when I multiplied the rows, that humongous list essentially had diarrhea.
    I’ve tried to delete that header and keep it to Document Level.   It basically ignored me and keep those lines.  When I did manage to make the <Document-Level> on top, it just didn’t work.
    (    //<AcroForm>
    //<ACRO_source>Row0.InvPart:Keystroke</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: AcroForm:Row0.InvPart:Keystroke ***********/    )
    I’ve searched other forums about the Document-level…. I swear I read a lot of forums that said using Advanced>Document Processing>Set Document Actions>Edit All was ok. Clearly it’s not ok, especially after I found this forum: http://answers.acrobatusers.com/Where-I-enter-document-level-javascript-adding-FormRouter- Calendar-q55527.aspx. 
    So I guess my question(s) is this:  IS that “Edit Document Javascripts” really necessary?  B/c I’ve looked and I don’t have it. I’m using Adobe Acrobat 9 Standard, ver 9.5.5 (and I’m using Windows XP Pro ver 2002 , if that matters).  Is this JS editor only available to the Pro version?  Would it really be a bad thing to just leave it alone as a keystroke event (aside from the unwieldy large, duplicated codes it vomits as a result)? Or maybe, is there a way to code a new row on instead?  I remember seeing an example where you can add more lines as needed, but I can’t for the life of me find it again.
    Thank you in advance for all your assistance.

    * Huh....it just figures... right after I finally give up and post up a question, I would find the answer. =_=;; http://forums.adobe.com/message/4727325#4727325. 
    So, Standard version apparently doesn't have that exalted “Edit Document Javascripts”.  Apparently a way around it is using the Page Open event.  Well, it works - the massive array only shows up once in the editor, and the multiple rows each call the function instead.  Nice. 
    Well, I will leave this up in case someone else can use the reference.  Thanks to anyone who read this and was going to answer me. =)
    Don't suppose anyone knows how to create a code to add new rows instead of having 15 rows straight off the bat?  Or should I make a new post for that?

  • Defining metadata at the folder level.

    We are migrating from Content DB to Webcenter Content 11.1.1.7, using FrameworkFolders.
    Our old Content Management solution (Content DB), allowed us to define metadata on a folder level. For example a group of metadata (a category in Content DB) could be defined and applied to a specific folder. When documents are uploaded, the server enforces the metadata to be populated for all documents uploaded to that folder and all child folders.
    Webcenter Content seems to behave quite differently. From what I can tell, this is set up in the "Configuration Manager" Admin applet. Metadata fields are defined in the "Information Fields" tab. Sets of fields are defined as a "Rule". Roles are enforced on uploaded content through "Profiles". A given profile is enforced by the user of a "Trigger". The trigger is specified to look at a specific field, which is global to everything on the server. This is all documented here: http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#DAFJDCEH
    Having the trigger field be global seems to be very restrictive. We will have several different systems storing content on the server. Isn't this a big limitation of the product?
    How can create a rule to enforce metadata to be populated for all content that is uploaded to a folder?
    Thanks!

    I'd say the answer is: create a folder and assign it a set of metadata (and inherit, if you will).
    I don't think WebCenter Content, or UCM, has a concept equal to the mentioned category as described; i.e. an object that represents a metadata settings that can be assigned to 'something'. There are, however, many concepts that are close:
    - rules/profiles mentioned in the initial posts - a profile (consisting of rules) may correlate to a "content type". It defines what fields make sense for this particular content item, what is required, default, etc. (relationship between fields). The caveat is that profiles define actually just how content items behave in the GUI; (global) rules can enhance also back-end processing (e.g. fill in an automated contentID identifier, if missing), but in reality they don't define data model
    - folders - folders help to define hierarchy on items. As Srinath explained, we can also benefit from propagation of metadata, or inheritance. This is probably the closest concept to the Content DB category, but the holder is not the category, but the folder itself. Keep also in mind that folder is an optional parameter, and metadata inherited from a folder can be overriden for both items and folders
    - in URM, where the categorization is more strict is another hierarchical structure; retention category (which can be assigned other settings, esp. disposition rules, and which can contain retention folders)
    - yet, another concept that might be useful in some use cases are folios; a folio is an item (XML-file) that has its own metadata, and can reference other content items. However, operations on a folio item OOTB does not affect contained content items, and a content item can be referenced by several folios.
    Finally, if no standard concept helps, you may always create your own customization via filters. A filter is a Java piece of code, which can be "hooked" to standard events (like "uploading a file", or check-in as it is called in UCM) and which can do whatever validation you like. For instance, I created a component which checks that an assigned quota on a folder to which an item is uploaded is not exceeded.
    I assume that for your use case, you might be good to go with a combination of folders and profiles (a profile setting can also be assigned to a folder as default metadata). Let us know if you get stuck.

  • DIR Search at Folder Level

    Hi all,
    Is SAP DMS has the functionality to search the document using classification within the Particular Folder.  so far i have only seen the document Search is at classification charateristics or at the Document Text level.
    Pls Let me know, whether Searching at folder level is possible or not?
    Regards,
    S Anand

    hi,
    Find in Structure
    To find the folder in the SAP Easy Document Management structure in which a document was originally created, proceed as follows:
           1. Select a document or folder in the directory structure of SAP Easy Document Management, for example, in the Search
               Result folder.
           2. Choose Find in Structure in the context menu of the document or select the Find in Structure indicator in the search
               dialog  for documents .
               Microsoft Windows Explorer highlights the folder in which you originally created the document.
    Benakaraja
    ??p

  • How do you do document level javascript docopen in acrobat pro lifecycle designer

    You used to be able to do document level javascripts like document open and process parameters from a url to prefill a pdf file. 
    How do you do that in acrobat pro 10 or life cycle designer?
    Thanks in advance
    Dean-O

    Should be the same but it isn't. I have included a screenshot of my tools choices in both my Mac and PC versions - they are totally different.
    Mac version
    PC Version

Maybe you are looking for