Save as a Script with the path and the preset name

Hello

LiveCycle version: 8.2.1.4029.1.523496

The purpose of the script that I have is to save the livecycle form in a predefined directory and using the values to a text field in the name of the file.

The script is placed in an output on a field event using javascript as follows:

this.saveAs ("/ c/Forms/Template/Leave Application"+ Applicants_Name.rawValue".pdf" ");

The script does not work.

Can someone please learn about some fixed my script?

Any help will be most appreciated.

The only way for a SaveAs is so confident at the level of the Script files.

Create a javascript (Config.js) file in the Javascripts directory (usually C:\Program Files\Adobe\ Acrobat x.0\Acrobat\Javascripts, where x = the version of Acrobat you have installed).  In the .js file, put something like

SaveAs Function1

var mySaveDoc = {app.trustedFunction (function (doc)}

app.beginPriv ();

var myPath = "/ c/temp /" + "WhateverNameYouLike" + ".pdf";

saveAs is the only privileged code that should be placed

with beginPriv/endPriv

doc.saveAs ({cPath: myPath,})

bCopy: true,

({bPromptToOverwrite: false});

app.endPriv ();

});

Call the function as event.target.mySaveDoc (event.target); the use of javascript in a mouse, an event for a button.

I hope this helps.

Tags: Adobe LiveCycle

Similar Questions

  • Save the file with the same name

    How to change the script to save the file with the same name?


    
    
    
    
    //SaveforWebSP.jsx  
    
    
    
    //Save a fixed width image with a size constraint in its original folder  
    
    
     
     
    
    
    
    var docRef = activeDocument;  
    
    
    
    var outputFolder = docRef.path;  
    
    
     
     
    
    
    
    NamesaveRef = new File( outputFolder + "/reference.jpg" );  
    
    
    
    var NewfileRef = new File( NamesaveRef )  
    
    
     
     
    
    
    
    // quality/size constraints  
    
    
    
    var w = 1920; // new file width  
    
    
    
    var MaxSz =  361440; // max. 360Kb  
    
    
    
    var Qlt = 100; // initial quality 100  
    
    
    
    var x = 1; // decreasing step  
    
    
     
     
    
    
    
    // resize the image to the right width  
    
    
    
    docRef.resizeImage(UnitValue(w,"px"),null,100,ResampleMethod.BICUBICSHARPER);  
    
    
     
     
    
    
    
    // Perform the first SaveForWeb Operation  
    
    
    
    ExpWeb(NewfileRef, Qlt);  
    
    
     
     
    
    
    
    // Keep trying to save the file with max. Qlt, but under MaxSz 
     
    
    
    
    while (NewfileRef.length > MaxSz)  
    
    
    
    {  
    
    
          
    Qlt = Qlt - x;  
    
    
          
    NewfileRef = new File( NewfileRef );
     
    
    
          
    NewfileRef.remove();  
    
    
          
    ExpWeb(NewfileRef, Qlt);  // Perform a new SaveForWeb Operation, with slightly lower Qlt  
    
    
             
    if (Qlt <= 40) {  
    
    
               
    alert("The file can't be saved with the desired size AND quality.");  
    
    
               
    break  // break the loop whenever the quality is as low as 50 (this shouldn't need to happen)  
    
    
             
    }  
    
    
    
    }  
    
    
     
     
    
    
    
    var FileSz = NewfileRef.length/1024;  
    
    
    
    FileSz = Math.round(FileSz);  
    
    
     
     
    
    
    
    // close the original file without saving  
    
    
    
    activeDocument.close(SaveOptions.DONOTSAVECHANGES);  
    
    
     
     
    
    
    
    // SaveForWeb Export, with the desired constraints and parameters  
    
    
    
    function ExpWeb(FileNm, Qlt)  
    
    
    
    {  
    
    
          
    var options = new ExportOptionsSaveForWeb();  
    
    
          
    options.quality = Qlt;   // Start with highest quality (biggest file).  
    
    
          
    options.format = SaveDocumentType.JPEG;   // Save Format for the file  
    
    
          
    docRef.exportDocument(File(FileNm), ExportType.SAVEFORWEB, options);  
    
    
    
    } 
    
    
    
    
    

    Change of line 25 to:

     var docName = docRef.name.split('.')[0];
     NamesaveRef = new File( outputFolder + "/"+docName +".jpg");
    
  • Help! Need a script to automatically open files with the same name but in another location.

    Good morning friends,

    So for my work, I need a script to open files with the same name but located in a different folder. But since I'm a total noob when it comes to programming, I can't understand how do. That's what I have in mind:

    -J' I manually open an image.

    -The script will look for a file with the same name in another folder that I've specified.

    -The script will then select the channel CMYK of the second file and copy and paste it into the first file.

    -The second file is then closed without saving the changes.

    I have problems with the part where the script searches for a file with the same name as the opened file. I would really appreciate help. Thanks in advance.

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

    myDocument var = app.activeDocument;

    var Nomdoc = myDocument.name;

    try {var basename = docName.match (/(.*)-.)} [ ^\.] +$/)[1]}

    catch (e) {var basename = thedoc.name};

    var path = / * path of folder to insert as a string here * / + ' / ' + base name + / * insert file extension, including the period as a string here * /;

    If (queue (path) .exists == true) {var otherDocument = app.open (File (path))};

    };

  • Is it possible to store parameters to script with the InDesign file?

    Hello

    I have a crazy idea: it is possible to store parameters to script with the InDesign file?

    In this case the Scripting Guys will be able to store these settings with the file, and when the script runs - he can check if those setting exists - if so - script can run without showing the dialog with the settings... (like all the necessary parameters are stored with the indesign file), and of course we can force InDesign to display the script dialog parameters if run us with the alt/option key pressed when executing this script. Maybe even different scripts will be able to share these settings and interact with each other... We will be able to have the settings will be saved with the file, or temp settings for the document assets or session (till InDesign is closed). With eventListeners and commissioning, scripts, that we will be able to make scripts that would be able to check updates and automatically run when we placing images and text and so on... This can be a set framework of InDesign scripting, allowing to write scripts that use ui and same libraries so we don't have to write everything from scratch every time and just included required libs...

    So here are 2 great questions for now:

    (1) is it possible to store script with .indd file settings

    (2) who is interested in creating InDesign scripting (because it only makes sense if it will use a lot of people)

    PS: I know that it is possible to store settings in an external file, but this time, I'm interested only to save the params with .indd

    The syntax of the function to write the label:

    app.activeDocument.insertLabel('myLabel', 'myLabelValue');
    

    IMPORTANT: If you forget the name of the label, the label is LOST! Really? YES, REALLY!

    The syntax of the function for the reading of labels:

    var myLabel = app.activeDocument.extractLabel('myLabel');
    

    http://indisnip.WordPress.com/2010/07/31/saving-script-data-within-document/

  • where to save the files under options the file name is duplicated how to remove an additional folder with the same name

    Under Options in Firefox, I clicked on save the files under downloads, but the file name twice and an additional file with the same name is created in the folder, i.e.:

    G:\Akbar's Songs\HAMARA DOWNLOADS\HAMARA FORUMS DOWNLOADS FORUMS

    As you can see the file repeats, how can I fix it?

    Also the music files, I download from a site of downloads as a WinRar file and I need to open it. Y at - it an option where the file opens automatically in the folder I chose?

    Thanks a lot for your help.

    Hi Akush, when you install 7 - zip, make itself the default application to open .zip and .rar files. So if you double click on the .rar file, it should open in 7 - zip. If you prefer to decompress immediately, right click the file and look for new 7 - zip items in the menu. I can't think of a way to do this automatically, however.

  • Export PNG with the correct name, for each layer, script file frame foreach

    Hello guys,.

    I am trying to find a script that exports each separately from the layer in PNG, for each image, with the correct name. By example, if the layer is named snail and lies in a forest of group name and is like 6, export this layer as a PNG named forest.snail.06.png (recursion if possible) and this for each layer, for each image...

    I found a software named Layerex, they speak here about layers export Flash | Global Facilitation network

    But I could not find... If you guys know how to do, it would be so awesome...

    Take care

    Simon

    Using jsfl.

  • I can't save a PDF with the same name

    I can't save pdf files with the same name on the network drive in our society. I have full control over this network drive and can do anything create/read/write/change. Other programs work fine, but not Adobe Reader. I can save a pdf file with a different name, but when I try to save as in XI or replace as in DC had an error: the file is read-only or opened by someone else. Save the document under a different name or in a different folder.

    By the way, Acrobat Pro, I got the same message.

    reader_error.png

    Hi igorp74028164,

    Please provide the exact point of the software & OS installed on your system. Also check if it is there any update available for the software after crossing "" help > check updates "»

    Follow this thread to reset the preferences for the acrobat software. : - How to reset preference settings in Acrobat format.

    Also please check if this file is saved to the network drive or local, if its network on Please save it on local disk & then check. Make sure also that this preview pane must be closed in windows Explorer.

    Kind regards

    Christian

  • is it possible to save files in illustrator with the trial version a month?

    is it possible to save files in illustrator with the trial version a month?

    Yes you can, but also easy to ask the question. Download the route and try it

  • I want to buy an iBook. There are 2 different books with the same name, author, and the book cover. They are different number of pages with different prices. Specifically, all the light that we do not see. " How do you know that we purchase?

    I want to buy an iBook. There are 2 different books with the same name, author, and the book cover. They are different number of pages with different prices. Specifically, all the light that we do not see. " How do you know that we purchase?

    I would get one that has 4700 comments already.

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

  • Mix records with the same name of the internal and external space (clip +)

    Hello

    I have a question regarding the reading of 'File': if having a folder on the inside and external space microsd, both are named "graphics". Is it possible to shuffel these 2 files with the same name? There are also a few other folders I want to be included, so I just couldn't use the "play all" option. I don't want to use replay by id3tag because mines are always screwed up and would be a lot of work to mark all the appropriate files in the.

    Thanks for help

    m.

    I've not played with playlists much.

    If ID3 tags are all screwed up, I would use the MP3tag utility to change the label of the kind in "Charts" on internal and external memory, then you access the kind-> just Charts and play at all.  It is probably not an option if your labels are blank and you don't want to ruin you, but it's really quick & easy to do with MP3tag.

    I think that even Windows Explorer (XP/Vista) can change the field type in the batch (select all 'charts' music files, click right properties, summary (Advanced) tab change the field of its kind in "Charts", OK).  I keep the ID3tags 'good' on my PC, but edit on my player according to the needs.

    Just another idea which is really easy if you're not afraid of screwing the ID3 tags.

  • Files and folders with the same name

    I am trying to unzip some files and folders and it works fine on my computer with Windows XP. However, when you use Windows Vista I can't because there are folders and files with the same name. After an internet search, it seems that the only suggestion is to extract the files in separate folders which then would allow them to keep the same name. The problem is I want what they in the same folder and they need to have the names they have.

    NOTE: I do have two files with the same name in the same folder, I have a folder and a file with the same name. I would have thought that this would be acceptable because they are two things separate, and given that it's great under XP.

    All solutions?

    You are right, if I make a file and a text file with the same name, it works fine. However, when I try to extract the files I need it tells me that there is already a file with the same name as the folder. He goes to tell me to choose a new name but my only options are 'try again', 'jump' or 'Cancel '.

    I think I can understand what the problem is. For some reason when you download the zip file, the computer seems to have added a few files side with any format other than "file." It is those who have the same name as the folders as if they were, and they could not be uncompressed because of this. I have no idea whence they came as they appear from nowhere (compared to my XP). I'm trying now unzip the files separately and exclude the strange s 'file '.

    Thanks for your help though!

  • All with the same name and more many nested directories

    Ideas: when trying to install Window7 it cannot be installed because of a folder and its subfolder had the same name... called a duplicate. There is a process to find duplicates files which takes you back to Vista to correct the problem. However my name of the folder's subfolders 28 user/name/photos/images/pictures etc all with the same name. When you try to delete more are added. There were files, but I moved to them but there is now way to delete the files. Strange but true. Help to install Windows 7, they should be deleted.

    First try to run a disk check. Open the computer and right click on the drive,
    choose Properties, Tools tab, and then under check errors click check now and
    Follow the prompts.
     
    --
    ..
    --
    "cjones5" wrote in message news: 8cecad2e-6e5d-49ef-a6ec-e40324ea19f5...
    > Remember - this is a public forum so never post private information such
    > as numbers of mail or telephone!
    >
    > Ideas: when trying to install Window7 it cannot be installed due to a
    > folder and its subfolder had the same name... called a duplicate. There are
    > a process designed to find duplicate files which takes you back to Vista for
    > correct the problem. However my folder name is
    > subfolders user/name/photos/pictures/images etc. 28 all with the same
    > name. When you try to delete more are added. There were some files but I
    > displaced but there is now to remove the files. Strange but true.
    > Help to install Windows 7, they should be deleted.
    >
    > a.. You have problems with programs
    > b.. Error messages
    > c.. Recent changes to your computer
    > d.. What you have already tried to solve the problem
    >
     
     
  • What is the best way to replace an Appasure Agent with hardware new and new computer name?

    What is the best way to replace an Appasure Agent with hardware new and new computer name?

    Thank you that's what I needed

  • LOV cascading if I don't have only one table with the customer name and the name of the product in the ADF.

    Hi Please help me how to use cascade, if I don't have only one table with the customer name and the name of the product in the ADF... I use Jdeveloper 11.1.

    For the client, I used customer VO with client list to fill but to populate the product that I use bind variable PrODUCT_NAME select distinct from TABLE where client_name =: bindCustomer

    so first of all, I need to set the variable of liaison on behalf of the selected customer.

    Can you please tell me how to set this variable binding in this case.

    After you set the LOV to your product attribute, correspondting VO in the LOV will appear under view accessors.

    Change the accessor of the view, you will see the variable binding. Set its value to the customer field of the parent object.

    Visit this link: https://www.youtube.com/watch?v=nXwL2_RP7AQ

    Kind regards

    Elias.

Maybe you are looking for

  • I need assistance with Dolby Home Theater V4.

    Hello. For some reason--on my Alienware 14, audio enhancements for home Dolby cinema stopped working. I wonder what is the cause. I tried to repair the drivers, restart. Nothing worked, anyone can come up with a solution here? Nothing is coming on th

  • Device epson xp - 205 207

    Ho windows 7 64 bit, non riesco ad installare I do driver a find I pilot dello su even epson scanner

  • PC decided after 3 years that windows is not valid...

    I bought a pc with windows 7 and put to level toward 64-bit 3 years ago. He decided today that the version is not valid. There was a number of hard disk failure. How can I find the question correctly. The license number on the pc is too faded as foll

  • New application guard auto starting annoying

    I am new user of Win 7 & I have loaded down the new sat nav App why it auto start whenever I start its very annoying as I close again

  • Install new OS clean, "cannot find boostrap.lua".

    I am trying to create a deployment package for vmware workstation 10.0.4.I followed the instructions documented to retrieve install it and run the Setup file from command line with all switches.  However, we still get "cannot find bootstrap.lua" when