Select the text block to get the content, save and close Windows - Java -.

Hi guys!

I made some scripts for Photoshop and now I'm doing something for InDesign, but this one is Kind ' more difficult.

Let me explain it to you:

I this 'model' document, it is a file where I have all positions and points for "merge data" do his work. And he does it perfectly, I can create all the fine merged documents, the solution that im working for is to get one of the fields that the "merge data" is completed to be the file name, and then save the file and close it.

This text box is going to be the name of my file that has a special paragraph Style which is unique on the document, I don't know if it's useful.

Oh sure, once the work is done by the fusion of data where the script should start now I have something like 15 (do not forget that it is a random number, depends on how many references I have in my Data Source) ready documents save and close.

I have yet to get started, looked for examples, but nothing came to my mind, any help?

Thanks guys and I ask you to apologize for grammar mistakes, I'm Brazilian.

CyA!

And he crashed right into the first record where I messed up it?

I thought I was pretty clear when I said:

I didn't notice you had wrapped all in a while loop. Who's going to make the problem worse. Which does not seem that this would cause a problem?

Why did you do that? I told you to use:

var i, name, doc;
for (i=0; i   doc = app.documents[i];

And you changed anything else that I not tell you to do:

while (app.documents.length) {
  doc = app.documents[0];
  var i, Ref, doc;
  for (i=app.documents.length-1; i>=0; i--) {
    doc = app.documents[i];

It is the cause of some, but not all of your problems. Why did you do that?

In all cases, your entire script should look like this (decrement loop):

var i, Ref, doc,
    Pasta = Folder.selectDialog("Selecione a pasta de destino dos arquivos.");
if (Pasta == null) { exit(); }
if (app.documents.length == 0) { exit(); }

for (i=app.documents.length-1; i>=0; i--) {
    doc = app.documents[i];
    Ref = doc.textFrames.itemByName("Modelo").contents;
    app.activeDocument.save(new File(Pasta.fsName+"/"+Ref+".indd"));
    app.activeDocument.close();
}

Or, as this (operation on the active document):

var i, Ref, doc,
    Pasta = Folder.selectDialog("Selecione a pasta de destino dos arquivos.");
if (Pasta == null) { exit(); }
if (app.documents.length == 0) { exit(); }

while (app.documents.length) {
    doc = app.documents[0];
    Ref = doc.textFrames.itemByName("Modelo").contents;
    app.activeDocument.save(new File(Pasta.fsName+"/"+Ref+".indd"));
    app.activeDocument.close();
}

While we are here, please note that the use of "exit()" may be unreliable, especially as scripts get fat. You will probably find it best to use the "return", although it has different semantics.

Tags: InDesign

Similar Questions

  • to refine my question. The Lasso tool does not work.  When I select the content aware lasso shrinks and nothing changes.  Help please.

    to refine my question. The Lasso tool does not work.  When I select the content aware lasso shrinks and nothing changes.  Help please.

    A simple reset will often be the case if a tool becomes awkward. Go to this link, then select the lasso tool:

    Difficulty of tool

  • Printer all in one HP3520 - how to select the wireless network and enter the WEP key?

    According to print my wireless network is detected.

    How to connect the! @# % printer $ fo the wireless network and enter the WEP key?

    Instructions on the HP site tell me to selet NETWORK on the printer control panel.  Well, there's a way to select the NETWORK from the control panel.  It is not an option for him.

    I downnloaded and installed the latest drivers.

    I have restored the default settings.

    How to select the wireless network and enter the WEP key?

    All of HP's instructions seem to be for a newer printer with a touchscreen.

    I want that the printer is connected to my main computer via the USB port.  I want to be able to print wireless phones and tablets.

    My 3520 is not a 'touch Screen' and it has wifi.

    However, the following work:

    Try to open the HP Deskjet 3520 icon, open the utilities tab, click on convert USB wireless, by following the steps on the screen.

    This leads me to believe that ONLY the wireless doesn't work.  I know now that the part of the sentence "Convert USB to wireless connection" is supposed to mean "works like USB and wireless.

    Thank you for your help

  • I lost my laptop screen after trying to set my display properties. I get the Dell logo and Microsoft Windows XP, then a blue black screen... but I can hear loader behind it. What gives?

    I lost my laptop screen after trying to set my display properties. I reformatted recently, everything seemed to work, I loaded SP2 who gave me the poor quality screen while trying to fix it. Now, I get the Dell logo and Microsoft Windows XP, then a blue black screen... but I can hear loader behind it.  What gives?

    I lost my laptop screen after trying to set my display properties. I reformatted recently, everything seemed to work, I loaded SP2 who gave me the poor quality screen while trying to fix it. Now, I get the Dell logo and Microsoft Windows XP, then a blue black screen... but I can hear loader behind it.  What gives?

    Start the computer in safe mode (press F8 continuously immediately after power and don't worry beeps when you press the button) and let it boot without a network.  Once there right click on the desktop and then click Properties.  Click settings and the value of the monitor mode (640 X 480) VGA or SVGA (800 X 600).  Accept the changes and restart the computer.  You should have a mediocre screen, but you should see it now.  Download and install the appropriate drivers for your video card in the laptop to the web site of the manufacturer of the laptop.  Install the drivers and then you should be able to set the display of the laptop to the correct native resolution for your computer monitor (must be in the documentation of the laptop).
  • Select the crop tool, and then select a ratio (based on the name of the file)

    I have a lot of files that when I their culture that they need a specific report. Currently, they are stored in the tool.

    I wish I could make a shortcut so that it selects the crop tool and the report to the file name. I can understand the file name information.

    i.e. Fr10 = a 2:3 Ratio

    or

    20 = 3:4

    There is no need to crop the image simply select the tool.

    I found this to select the tool

    The beginning is the same.

    if (app.documents.length > 0) {
        var myDocument = activeDocument;
        var fileNameNoExtension = myDocument.name;
        
      fileNameNoExtension = fileNameNoExtension.split( "." );
        
      if ( fileNameNoExtension.length > 1 ) {
          fileNameNoExtension.length--;
        }
    
        fileNameNoExtension = fileNameNoExtension.join(".");
        
        var BrandString = fileNameNoExtension.substr(0,4);
      
      }
    if (/^(FR10|WA35)$/.exec(BrandString)){
        var the_x_Ratio =2
        var the_y_Ratio =3
        }
    

    2016, use it at your own risk.

    #target photoshop

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

    myDocument var = app.activeDocument;

    var originalRulerUnits = app.preferences.rulerUnits;

    app.preferences.rulerUnits = Units.PIXELS;

    var width = myDocument.width;

    var height = myDocument.height;

    var rel = 1;

    If (myDocument.name.indexOf ("AB10")! = - 1) {var rel = 0,666};

    If (myDocument.name.indexOf ("CD10")! = - 1) {var rel = 0.75};

    If (myDocument.name.indexOf ("EF10")! = - 1) {var rel = 0.8};

    If (myDocument.name.indexOf ("CH10")! = - 1) {var rel = 0,833};

    try {}

    // =======================================================

    var idCrop = charIDToTypeID ('Crop');

    var desc3 = new ActionDescriptor();

    idT var = charIDToTypeID ("T");

    var desc4 = new ActionDescriptor();

    var idTop = charIDToTypeID ('Top');

    var idPxl = charIDToTypeID ("#Pxl");

    Desc4.putUnitDouble (idTop, idPxl, 0);

    var idLeft = charIDToTypeID ("Left");

    var idPxl = charIDToTypeID ("#Pxl");

    Desc4.putUnitDouble (idLeft, idPxl, (width - height * rel) / 2);

    var idBtom = charIDToTypeID ("Btom");

    var idPxl = charIDToTypeID ("#Pxl");

    Desc4.putUnitDouble (idBtom, idPxl, height);

    var idRght = charIDToTypeID ('Rght');

    var idPxl = charIDToTypeID ("#Pxl");

    Desc4.putUnitDouble (idRght, idPxl, (width - height * rel) / 2 + height * rel);

    var idRctn = charIDToTypeID ("Rctn");

    Desc3.putObject (idRctn, idT, desc4);

    var idAngl = charIDToTypeID ("Marko");

    Bryan var = charIDToTypeID ("#Ang");

    Desc3.putUnitDouble (idAngl, Bryan, 0.000000);

    var idDlt = charIDToTypeID ("Dlt");

    Desc3.putBoolean (idDlt, false);

    var idcropAspectRatioModeKey = stringIDToTypeID ("cropAspectRatioModeKey");

    var idcropAspectRatioModeClass = stringIDToTypeID ("cropAspectRatioModeClass");

    var idpureAspectRatio = stringIDToTypeID ("pureAspectRatio");

    Desc3.putEnumerated (idcropAspectRatioModeKey, idcropAspectRatioModeClass, idpureAspectRatio);

    var idCnsP = charIDToTypeID ("CnsP");

    Desc3.putBoolean (idCnsP, true);

    executeAction (idCrop, desc3, DialogModes.ALL);

    } catch (e) {};

    //

    app.preferences.rulerUnits = originalRulerUnits;

    };

    Edit: Using the indexOf can be problematic and if-clauses are inelegant, then a switch clause would be probably better.

  • My nail of the thumb in bridge always have evidence the adjustments I make to RAW files. Now, for the first time they have not. However when I select the images adjusted and open them in CS6 adjustments are there. I restarted the bridge and PS, and I rest

    My nail of the thumb in bridge always have evidence the adjustments I make to RAW files. Now, for the first time they have not. However when I select the images adjusted and open them in CS6 adjustments are there. I restarted bridge and PS, and I restarted the computer (Mac). Still the same problem.

    I thank assani, but it wasn't the answer. The problem was, I finally understood, that the "option for generation of quality and preview thumbnails" wasn't on "high quality" as it usually is. I have no idea how this happened as I never change this option.

    Thanks a lot for your help.

    Mitchel Gray

  • I'm not able to select the cloud, polygons and drawing markup tools lines connected to this end.

    I recently installed Adobe Pro XI. I can't select the cloud, polygons and lines connected markup drawing tools. I can see them, but they are greyed out so I am not able to choose them.

    I am running Windows 7 64 bit on an Asus ZenBook laptop.

    Any help would be really appreciated.

    Kind regards

    KF Panda

    This touchscreen laptop is capable?

    If this is not the case, check if you have the Touch preference in Adobe Acrobat active XI.  If you, then turn off.

  • HH.exe crashes - lost connection to the online help and Support window

    HH.exe crashes - lost connection to the online help and Support window

    SYSTEMATICALLY, FOR MONTHS, WHEN I SEARCH WINDOWS HELP I got THE MESSAGE.

    "You have lost your connection using Windows and Support website. . Try to connect again. "
     

    Windows Error Reporting shows several times:

    1. HH.exe hangs and does communicate with Windows
    2. MsSearch TerminateProcess & #x000d
    3. ApphelpSoftBlock & x000d #.

    I have no problem connecting to Windows Web sites otherwise or to other sites on the web.

    Can someone tell me how to fix this?

    (I'm running VISTA 32 bit)

    Hello

     
    This behavior is caused by a corrupted or damaged HH. DAT file.

    This may occur if Antivirus or a firewall, you have installed the program it blocks.
    http://Windows.Microsoft.com/en-us/Windows7/turn-Windows-Firewall-on-or-off
    http://Windows.Microsoft.com/en-us/Windows7/disable-antivirus-software
    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks
  • I opened a word from Windows Mail document, changed using Word 2007, you press on save and close the document. Now I can not find where he saved.

    original title: Windows Mail ate my file

    I opened a word from Windows Mail document, changed using Word 2007, you press on save and close the document.  Now I can not find where he saved.  I tried the search function in Vista, but it can not find the file either.  I tried to re - open the file in the email, but I just get the original version.  Can anyone suggest where it might be?

    Thank you very much

    Eamonn

    Once you open a Word attachment in an email, you must save it to your HARD drive until you make changes. If you do not, the changes are lost, but the original attachment is still with the e-mail.

  • I got a message that my Windows 7 is not genuine. What steps to follow to format the hard drive and install Windows 7 Home Premium 64 Bit?

    I took my office for repairs after that my motherboard has given. I did an upgrade and the repairman had my re - installed Windows. I know evil to fix my Internet security software and discovered a list of other problems with missing or corrupt files. After inspecting my system, I discovered that the repairman installed Windows with a product key is counterfeit.

    I have my legitimate Windows 7 Home premium disc and product key. How to re - install Windows 7, because windows fitted by repairer are Home Premium 32 Bit, and Windows I have are Home Premium 64 Bit.
    I would like to do a full install of Windows, I backed up all my data and have all the product keys of software installed on my desktop. What steps to follow to format the hard drive and install Windows 7 Home Premium 64 Bit?

    Boot from the DVD 64 bit Windows 7

    To learn how to change your BIOS options to boot from the DVD drive, the following tutorial:

    http://notebooks.com/2011/05/05/How-to-load-BIOS-and-change-boot-configuration/

    Click Install now

    Accept the license agreement

    When the option is displayed to select a type of installation, click (Custom advanced)

    Click on drive Options

    Select the disc/s click on Delete

    Click new

    Click on apply

    Click OK

    Click Format, and then click next to proceed with the installation

    Skip entering your product key Windows 7 and complete the installation.

    When you reach the desktop, click Start, right-click on computer

    Click on properties

    Scroll down to the Windows Activation

    Click the link x days before activation.

    Click on the link that says: "show me other ways to activate.

    Enter the product key

    Click next

    Select the Activation of the phone

    Click Next when you enter your key page

    Select your country

    Click Next, call the number listed

    Be sure to explain your situation to the Appeals Officer.

    Provide the installation generated when ID requested by the call agent

    They give a confirmation ID in return, enter it

    Click next to complete the activation.

    If you have problems, use the phone activation:

    How to activate Windows 7 manually (activate by phone)
     
    1) click Start and in the search for box type: slui.exe 4
     
    (2) press the ENTER"" key.
     
    (3) select your "country" in the list.
     
    (4) choose the option "activate phone".
     
    (5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
     
    (6) explain your problem clearly to the support person.
     
    http://support.Microsoft.com/kb/950929/en-us

  • Save and close not ask to increase the version more

    I don't know what I did or what I maybe changed, but suddenly when I make a change to something in one of my workflows (change a line in a script for example element), when I click on save an end, vRO impeccable, save and close, but not what I want.

    Before, I'd always get a prompt asking if I want to increase the version of the workflow or not. How to bring back this behavior? I can't understand what I can fact to turn it off.

    I'm running the unit vRO 6.0.3

    Thank you

    Open the vRO-customer-online tools (above, right)-online-online tab user preferences: Workflows-online version of workflow increase when you click on save and close

  • I have FSX Accelerator and after 30 min, he thanked me to play the trail version and closes.

    I installed FSX accelerator and mine, took the code authentenfication OK.   But after 30 min, he thanked me to play the trail version and closes.  I reinstalled I its own dir. root thing. copatability mode and run as admin also does not fix it.  I even bought new disks with new code and it will not fly!

    Hi Bob,

    Refer to this link and check if it helps.

    Solve problems with activation for Microsoft games problems and mapping programs

    http://support.Microsoft.com/kb/960480

  • When I try to install Adobe Creative Cloud stops, stops at halfway of the installation point and closes. (The download is also very slow) can someone help me please? Thank you!

    When I try to install Adobe Creative Cloud stops, stops at halfway of the installation point and closes. (The download is also very slow) can someone help me please? Thank you!

    Please, try the following steps:

    Guinot

  • Use VBA and Excel to open Dreamweaver HTML (CS5), search and replace text, save and close

    I would use VBA and Excel programmatically open numbered Dreamweaver HTML (CS5) and find and replace text in the view code in these files, save and close them.

    I have 5000 associations between find: x 0001 and replace: y0001 in an Excel sheet.

    I have written VBA but do not know how to open, close and save the code in the .html files view. Please... and thank you...

    [email protected]

    I use ASP.net for backend coding, I use PHP. If you want to stay with Microsoft technologies, and then you would like to use ASP.net. and a Microsoft server.

    When you have a Web site that contains many pages with similar content structure, the practice is to store all content and all variables in a database. It is possible to create a site that has hundreds of 'pages', with many variations in the pages, so they don't all look like clones, and yet all this might be based on a single web page. A website as Amazon.com has millions of 'pages', but may actually have only a dozen basic page structures.

    Convert what you now have a system like this would be a fair amount of work, but it's the way to go now.

  • I get messages that support and problems Windows has stopped working. and also that I have no more memory on line 2. What can I do to fix this?

    I get messages that support and problems Windows has stopped working.  I told myself that I will advise if a solution is found, I get another box saying that I have to close becausse that Windows does not work.  I also get messages that I have not more memory on line 2.  What can I do to fix this?

    Hello

    1. could you give us the exact error message?
    2. Once you get this error message? This is when using Internet Explorer?

    In the meantime, check out the articles below and check. Try to increase the size of pagefile.sys and check.
    http://support.Microsoft.com/kb/2267427

    I hope this helps.

Maybe you are looking for