You can fix scripts?

I had these three script, their job very well, but not in the cell, you can fix it:

Text 1:

00 / / indent to the left: whether, firstLineIndent: 8 mm
01.
02.Markus var curDoc = app.activeDocument;
03.
04.the if (! app.selection.length) {}
05 var paragraphs = curDoc.stories.everyItem () .paragraphs;
06.}
07.immolation else if (app.selection.length == 1 & & app.selection [0] .hasOwnProperty ("on base")) {}
08. var paragraph = app.selection [0] .paragraphs;
09.}
10 {} else
11 alert("Something wrong with your selection!");
12 exit();
13.}
14.
15.paras.everyItem () .firstLineIndent = "8 mm";

Text 2:

01 / / indent to the left: whether, firstLineIndent: 0
02.
03. var curDoc = app.activeDocument;
04.
05.Marco if (! app.selection.length) {}
06. paragraphs var = curDoc.stories.everyItem () .paragraphs;
07.}
08.my else if (app.selection.length == 1 & & app.selection [0] .hasOwnProperty ("on base")) {}
09 var paragraphs = app.selection [0] .paragraphs;
10.}
11 else {}
12 alert("Something wrong with your selection!");
13 exit();
14.}
15.
16.paras.everyItem () .firstLineIndent = "0 mm";

Scenario 3:

01 / / indent to the left: 8 mm, firstLineIndent:-8 mm
02.
03. var curDoc = app.activeDocument;
04.
05.Marco if (! app.selection.length) {}
06. paragraphs var = curDoc.stories.everyItem () .paragraphs;
07.}
08.my else if (app.selection.length == 1 & & app.selection [0] .hasOwnProperty ("on base")) {}
09 var paragraphs = app.selection [0] .paragraphs;
10.}
11 else {}
12 alert("Something wrong with your selection!");
13 exit();
14.}
15.
16. for (var i = 0; I < paras.length; i ++) {}
17. var curPara = paragraphs [i];
18 if (curPara.leftIndent == 0) {}
19 curPara.leftIndent = "8 mm";
20.}
21 curPara.firstLineIndent = "-8 mm;
22.}

Harvey,

a warning is not an error. Try this one:

// left Indent: whatever, firstLineIndent: 8 mm

// das aktive Dokument
var curDoc = app.activeDocument;
// Anzahl der ausgewählten Objekte
var nSel = app.selection.length;

// wenn nichts ausgewählt ist
if ( nSel == 0 ) {
    // alle Textabschnitte im Dokument
    var allStories = curDoc.stories.everyItem();
    // alle Absätze in Textabschnitten
    var paras = allStories.paragraphs.everyItem();
    // alle Absätze in Tabellen (wirft Fehler, wenn es keine Tabellen gibt!)
    try {
        var parasInTables = allStories.tables.everyItem().cells.everyItem().paragraphs.everyItem();
    }
    catch (e) {
    }
    makeIndent( paras, parasInTables );
}
// wenn etwas ausgewählt ist
else {
    // Hilfszähler
    var probCtr = 0;
    // Eine Schleife durch die Auswahl
    for ( var n = 0; n < nSel; n++ ) {
        var curSel = app.selection[n];
        // der Typ der aktiven Auswahl
        var selType = curSel.constructor.name;
        // prüfen, ob Text (inkl. Tabelle) oder Textrahmen ausgewählt ist
        if ( curSel.hasOwnProperty ( "baseline" ) || selType == "TextFrame" ) {
            var paras = app.selection[n].paragraphs.everyItem();
            try {
                var parasInTables = app.selection[n].tables.everyItem().cells.everyItem().paragraphs.everyItem();
            }
            catch (e) {
            }
        }
        // falls nur eine Tabelle ausgewählt ist
        else if ( selType == "Table" ) {
            var parasInTables = app.selection[n].cells.everyItem().paragraphs.everyItem();
        }
        // wenn eine Zelle ausgewählt ist
        else if ( selType == "Cell" ) {
            var parasInTables = app.selection[n].paragraphs.everyItem();
        }
        // falls etwas anderes ausgewählt ist
        else {
            // Hilfszähler wird hochgezählt, Schleife aber nicht abgebrochen
            probCtr++;
        }
        makeIndent( paras, parasInTables );
    } // end for
    if ( probCtr == n ) {
        // der Hinweis erfolgt nur, wenn die Auswahl gar nicht passt. Ansonsten werden "falsche" Objekte einfach ignoriert.
        alert ( "Something wrong with your selection!" );
        exit();
    }
} // end else

// die Einzüge verändern
function makeIndent( paras, parasInTables ) {
    try {
        paras.firstLineIndent = "8mm";
    }
    catch (e) {
    }
    try {
        parasInTables.firstLineIndent = "8mm";
    }
    catch (e) {
    }
}

Tags: InDesign

Similar Questions

  • Paste in place for the next Master unfunction, you can fix it?

    Hello world

    I got this script, that copies of:

    Paste in Place to specify the Master Page

    I change it to:

    myDialog = app.dialogs.add var ({name: 'Copy to select one item to the next master', canCancel:true});})
    {with (MyDialog)}
    {with (dialogColumns.Add ())}
    staticTexts.add ({staticLabel: "select a master you want to copy in"});
    {with (dialogRows.Add ())}
    mySelection var = dropdowns.add ({stringList: ["master A", "B Master", "Master C", "Maître D", "master", "Master F", "Master G"], selectedIndex:0});})
    }
    }
    }
    If (myDialog.show () is true)

    main() {} function
    If ("copy to the next Master");
    copy_to_next_master();
    }
    function copy_to_next_master() {}
    If (mySelection.selectedIndex == 0) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [0]);
    }
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for future documents' Master A");
    }
    If (mySelection.selectedIndex == 1) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [1]);
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for future documents' Master B");
    }

    If (mySelection.selectedIndex == 1) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [2]);
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for future documents' Master C");
    }

    If (mySelection.selectedIndex == 1) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [3]);
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for future documents master-D");
    }

    If (mySelection.selectedIndex == 1) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [4]);
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for future documents master E");
    }

    If (mySelection.selectedIndex == 1) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [5]);
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for the next master F documents");
    }

    If (mySelection.selectedIndex == 1) {}
    nSel var = app.selection.length;

    for (var i = 1; i < app.documents.length; i ++) {}
    var nextDoc = app.documents [i];
    If (! nSel) {alert ('nothing selected!'); exit() ;}
    for (var n = 0; n < nSel; n ++) {}
    var curSel = app.selection [n];
    curSel.duplicate (nextDoc.masterSpreads [6]);
    }
    }
    Alert ("done. ("\rWhat you select are glued in place for future documents master G");
    }

    but unfunction, you can fix it?

    Thank you

    Teetan

    Hello

    Editing your code - note that the supposed main() function to be

    1. definition and

    2 called

    Compare it with this code:

    #target  indesign
    var
      myDialog = app.dialogs.add({name:"Copy Selected item(s) to chosen Master",canCancel:true}),
      mStringList = ["Master A", "Master B","Master C", "Master D", "Master E","Master F", "Master G"];
    with(myDialog){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Select a Master you want to copy to"});
      with(dialogRows.add()){
      var mySelection = dropdowns.add({stringList:mStringList, selectedIndex:0});
          }
      }
    }
    main();
    
    function main(){
      if (!app.documents.length || !app.selection.length)
      {
      alert( "Nothing selected!" );
      exit();
      }
      if (myDialog.show() == true)
      copy_to_next_master();
        }
    function copy_to_next_master() {
    var
      mChoice = mySelection.selectedIndex,
      mMsg = "Done.\rWhat you select is pasted in place to next documents - " + mStringList[mChoice],
      nSel = app.selection.length,
      mDone = false,
      i,n,nextDoc,curSel;   
    
    for ( i = 1; i < app.documents.length; i++) {
      nextDoc = app.documents[i];
      targetMaster = nextDoc.masterSpreads[mChoice];
      if (!targetMaster.isValid) {
      mMsg += "\rCan't detect " + mStringList[mChoice] + " in a doc: " + nextDoc.name;
      continue;
      }
      mDone = true;
      for ( n = 0; n < nSel; n++ ) {
      curSel = app.selection[n];
      curSel.duplicate( nextDoc.masterSpreads[mChoice] );
            }
      }
    mDone ? alert(mMsg) : alert("Nothing copied");
    }
    

    Jarek

  • Up to version 6.22 of entry and other components HTML texts have been with a width. Now, after installing version 7. The entries have increased in size not more about before defined sizes... You can fix this?

    Up to version 6.22 of entry and other components HTML texts have been with a width. Now, after installing version 7. The entries have increased in size not more about before defined sizes... You can fix this?

    I think it's about the size, just differently than before. See the discussion in:
    https://Bugzilla.Mozilla.org/show_bug.cgi?id=691157

  • Hi, I wanted to know if you can fix the apple screen clock. the clock works perfectly, but the glass broke and how mach

    Hi, I wanted to know if you can fix the apple screen clock. the clock works perfectly, but the glass broke and how much

    Hi Maxi

    Costs vary depending on your location and the model Apple Watch.

    Contact Apple support to establish your repair options, cost and likely delays:

    http://www.Apple.com/br/support/watch/contact/

  • Error - failed to import the certificate - you can fix this here

    I get this message when you try to create a new generation.

    Error - failed to import the certificate - you can fix this here

    I created a new .p12 file, but also a configuration profile. I can't understand why this keep happening. Thanks in advance for any help you can provide.

    This error means that the certificate and the private key in the p12 file don't match. Take a look at this post, which describes in more detail the creation and validation of your p12.

    I have not watched the certificate remains to be seen if this is indeed the expiration date.  Will look at this next...

    Unrelated and probably that your certificate has indeed expired.

  • You can change script function?

    Hello world

    I had this script:

    EN search-replace for MS in the cells

    but only in the active document

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

    var doc = app.activeDocument,
    _tables = doc.stories.everyItem ().tables.everyItem () .getElements ();

    app.findGrepPreferences = app.changeGrepPreferences = null;

    for (var i = 0; i < _tables.length; i ++)
    {
    app.findGrepPreferences.findWhat = "~ =";
    app.changeGrepPreferences.changeTo = "~ _ ';"
    _tables [i] .changeGrep ();
    }

    app.findGrepPreferences = app.changeGrepPreferences = null;


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

    I want to run in all open documents

    Thank you

    Teetan

    I think that you can just change the first line to:

    var doc = app.documents.everyItem (),

    Although I have not tested.

    (By the way, there is no reason for the line of app.findGrepPreferences)

    be in the loop!)

  • I have trouble to add attachments to emails using Gmail, this does not happen with Google Chrome. What do you need?, you can fix it?

    I use the email client Gmail, your browser (Firefox) is very good but has problems when Gmail accessories, mark an error and I should try again once (I do it without success). Should definitely fix this. Thank you.

    The solution was:

    Try to set the Boolean pref network.http.spdy.enabled false on the subject: config page.

    Thanks for trying. Greetings.

  • I AM NOT the LIVEDOCK HELP because of a quality problem with USB keyboards, you can fix it?

    I have a Xperia Arc and I bought an accessory DK10 and I try to use a USB mouse and USB keyboard with it, , but I'm not able to change the language of the USB keyboard-.

    It is a problem of QUALITY because that this limitation is not announced with the product.

    For this reason, I'M NOT to the HELP of LIVEDOCK.

    Y at - it a possiblity that solve you this problem? (for example, by using the language settings and the keyboard of the phone that will use Android)

    This will help many users who do not use U.S. English keyboards.

    I write in this forum because I could not any kind of help in the chat support or support by mail.

    At the time Android supports only English keyboard using an external keyboard, but I know that our developers are looking into this and try to add other provisions of keyboard as well.

  • SSO hosts SSL certificate is unknown. You can fix this since the SSL Certificate tab

    I'm trying to reregiter my vro with sso authentication but I keep running into this error. The certificate has already been imported.

    any idea? Basically, I removed the vro unit and deployed a new and now problems with registration of SSO. I need to remove the plug-in vcenter first vro?

    Screen Shot 2015-09-30 at 6.16.33 AM.png

    Looks like you have imported the ssohost:7444SSO certificate. You must also import the ssohost:443 host SSL certificate

  • 2 days ago, I started having problems with certain websites that worked fine before. They work again very well on other browsers. What happened and you can fix it?

    On the time journal site I used December 19 some of the features stopped working. Firefox does an update? I tried to download Firefox 9.0, but problems persist. At the end of the news is a comment section, but this no longer appears in Firefox. There is a feature of SuDoku Puzzles section which is most accessed through Firefox.

    Reload Web pages, and ignore the cache.

    • Hold SHIFT and click reload.
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Cmd + Shift + R' (MAC)

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Could not import the certificate - you can solve it here

    Hi all

    seems that I'm having a similar problem:

    Re: Error - failed to import the certificate - you can fix this here

    My gap phone signature keys worked a few months - now my key says iOS:

    "Error - failed to import the certificate - you can fix this here" when I Isaiah to compile app

    I find this part a bit confused so please use no baby...

    -I went to https://developer.apple.com/account/ios/certificate/distribution

    and it looks like my prod. CERT and mobile profile available are both still active

    -J' tried to re - download these that have been saved on my computer when I them - go back to the generation gap phone - and he accepted them with my pass

    - then I opened a new I just did-, but has the same problem when I try to build a production application = "error - failed to import the certificate - you can fix that here."

    Q: what should I do to fix this?

    R: remove the CERT in my keychain and their construction everything again from scratch?

    B: should I remove the ACTIVE apple certs and profile mobile available?

    C: something simpler to solve this problem?

    Thanks in advance - Dave

    Should be fixed now.  It seems that you have found a server in our collection that was generations before it was supplied.  Sorry for the inconvenience.

  • How can I stop this &gt; a script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script ends. Script: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionMana

    What is the cause of the WARNING when I open firefox and how can I fix it? > A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script ends.

    Script: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionManager.js:623 <

    This has happened

    A few times a week

    From what I can tell, you have the toolbar installed, and which is known to cause problems. Go in Tools > Modules > Extensions, select the Ask toolbar, click disable , and then restart Firefox.

    If it does not, your troubleshooting details. See using the page of troubleshooting information to help solve the problems of Firefox

  • How can I fix script error Microsoft J and syntax error while playing games?

    Original title: get syntay errort

    When I play iget microsoft j script compilation one syntay error but if I I expect csn still plays games

    Hello

    1. you receive this error when you use Internet explorer?

    Try the following methods to try to get the fixed number.

    Method 1:
     
    Follow the steps in the link and check if the problem occurs:
     
    http://support.Microsoft.com/kb/2528246
     
    Method 2:
     
    If the previous step fails, follow the steps in the link:
     
    http://support.Microsoft.com/kb/308260
     
    Method 3:
     
    You can uninstall and reinstall java and check if the problem occurs. Follow these steps:
     
    Step 1:
     
    Follow the steps in the link uninstall java:
     
    http://www.Java.com/en/download/uninstall.jsp

    Step 2:
     
    After above step to reinstall java:
     
    http://www.Java.com/en/download/help/download_options.XML

    Post back with the results.
  • I have windows live hotmail on Vista.Problem is that this message, 'error on page' appears on the lower left and no emails will be open and I can't change pages. How do you find / fix 'error on page '?

    I have windows live hotmail on Vista. New problem is the error message, 'error on page' appears at the bottom left. As a result I can't open any email or forward to other pages of e-mail. How does a find/fix 'error on page '?

    Hello

    ·        What browser do you use to connect to the internet?

    ·        The issue is with Hotmail?

    If the question is only limited to Hotmail then confirm your request in the forum Hotmail for assistance:

    Windows Live Solution Center Hotmail Portal

    http://windowslivehelp.com/product.aspx?ProductID=1

    If you use Internet Explorer, then you can try the steps from the link and check if it helps:

    What should you do about Internet Explorer script errors?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-should-you-do-about-Internet-Explorer-script-errors

  • Can you crrect my script?

    Hello world

    I had this script:

    //---------------------------------------------------------------------------------------- -------------------

    var paper = app.activeBook,
    _content = [];
    overlap = [];
    for (var I = book.bookContents.length - 1; i > = 0; i--)
    {
    _content.push (book.bookContents [i] .name + "\t" + (book.bookContents[i].documentPageRange.replace(/-[^-]+$/g,"" ")) +"\r");
    If (book.bookContents [i] .documentPageRange is book.bookContents [i - 1] .documentPageRange)
    {
    overlap.push (book.bookContents [i] .name + "\r" book.bookContents [i - 1] .name + "\t" + book.bookContents [i - 1] .documentStartPage + book.bookContents [i] .documentPageRange "\t");
    }
    }
    Alert (overlap. Reverse())

    Alert (_content);
    WriteToFile (_content, overlap);
    function WriteToFile (text) {}
    file = new File ("~/Desktop/Book and page number.txt content");
    leader. Encoding = "UTF-8";
    leader. Open ("w");
    leader. Write (Text);
    leader. Close();
    leader. Execute();
    }
    //---------------------------------------------------------------------------------------- -------------------

    goal is to get the report of contents of book

    and tell me overlop page numbers

    I got the text file:

    ======================================================

    13 notes account.indd 28

    Information.indd company 14 27

    Cash Statement.indd 12 26

    11 equity change.indd 25

    10 profit and loss.indd 20

    09 19 Income Statement.indd

    08 18 auditor Report.indd

    , Report.indd 07 directors' 17

    06 12 CG Report.indd

    , 05 MD and A.indd 7

    03 6 financial Highlight.indd

    Statement.indd of the President 04 3

    02 2 Summary.indd

    01 Contents.indd 1

    ======================================================

    the sequence is backwards

    ======================================================

    (1) communicate still me, the book has overlop page, even the book number has no page number on overlop

    (2) if the file overlop for more than 2 pages or more than two files have overlop page numbers will not fix the alert (overlap.reverse ()) in the report

    (3) the text of the report file has a comma at the beginning of each line

    (4) the sequence is backwards

    I expect the alert (overlap.reverse ()) do not arise if book has no duplication of page number

    You can solve this problem?

    Harvey

    Hi Harvey.

    Try this,

    var book = app.activeBook,  array1 = [], array2 = [],  array3 = [],  _content = "", _overlap = "";
    for(var i =0;i
    

    Kind regards

    Cognet

Maybe you are looking for

  • Firefox 4 beta does not display pages, but seems to load.

    I installed the version beta of Firefox 4, but whenever it opens, I can't see any content. Tabs and toolbars are on top, but the rest of the screen looks like glass and shows just the stuff behind firefox. Also, what seems to be a status bar, (with n

  • Cannot open the store of windows8 on screen

    whenever I click on store windows 8 on the screen.it open.i can even does not have an update

  • BlackBerry smartphones available to upgrade to a plan

    I can't open the App World to my Blackberry storm with Vodafone uk. The error message I get reads as follows: Improve your service to a plan that includes browsing and discover a world of possibilities at Blackberry App World. Contact your service pr

  • ACS 5.2 - disable logging of user test

    Hi all I am looking for the way how disagle a user record. We use a test user to verify the accessibility of the ACS in the large number of switches - this audit newspapers exhausting enough quickly. Is it possible to disable the registration of the

  • Set the screensaver on my digital photos

    original title: screen saver, personal photos, XP vs Windows 7 I don't know how to set the screen saver to display my own digital photos. But in Windows XP, they came with a small folder at the top of the image ID.  I can't find a way to include this