FindChangeByList script question, re: when a style is part of a group of style

Hello

I use script FindChangeByList InDesign and run into a problem.

Here's the line of problem:

grep {findWhat:"^."} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent"), changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style

What I'm trying to do, it's each paragraph in shape with the style called "Body2.TextIndent" which is in my style sheets in a group called "text".

This line does not work for me; I get a JavaScript "Error #17.". Error string: the variable name expected. »

Please note that I CAN get this line to work just fine if I use a style that is NOT in a group. For example, this line works very well for me:

grep {findWhat:"^."} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style

The problem is apparently that the FindChangeByList script does not like style groups. I found it by internet Google and found this link:

http://www.listsearch.com/InDesign/thread/index.Lasso?17986

Can anyone help?

Thank you.

What version of InDesign are you using?

The following line works for me on CS3, Mac.

grep     {findWhat:"^."}     {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent")}     {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true}     //Change everything to Text.indent2 style

Kasyan

Tags: InDesign

Similar Questions

  • Action script question on a loop to a part of the line of the time

    Hi all!

    You have another question about an action script editing in Adobe Flash. Earlier this year, I asked for help to set up a script of action where the video itself would start when the user hovers over the scene and loops from the beginning to the end.

    Now, I need to adapt it so that instead of a loop all the way back to the beginning, it goes rather to the points later in the animation (for example, say 10 seconds in) rather than backwards to the beginning.

    The Script that was created for me it was:

    FLV.source = "Flash.F4V";
    flv.autoPlay = false;

    flv.autoRewind = true;
    flv_btn.addEventListener (MouseEvent.ROLL_OVER, rolloverF);
    flv_btn.addEventListener (MouseEvent.ROLL_OUT, rolloutF);

    function rolloverF(e:Event):void {}
    FLV. Play();
    }
    function rolloutF(e:Event):void {}
    FLV. Stop();
    }

    flv.addEventListener (Event.COMPLETE, completeF);

    function completeF(e:Event):void {}
    FLV. Play();
    }

    Now, I think that what needs to be changed is the autoRewind = true section, but being a complete novice, I don't know where to start. I've seen articles online on a goto command, but my attempts to change the code did not work properly. Any ideas?

    use:

    FLV.source = "Flash.F4V";
    flv.autoPlay = false;

    flv_btn.addEventListener (MouseEvent.ROLL_OVER, rolloverF);
    flv_btn.addEventListener (MouseEvent.ROLL_OUT, rolloutF);

    function rolloverF(e:Event):void {}
    FLV. Play();
    }
    function rolloutF(e:Event):void {}
    FLV. Stop();
    }

    flv.addEventListener (Event.COMPLETE, completeF);

    function completeF(e:Event):void {}
    FLV. Seek (20);  use the right time

    FLV. Play();

    }

  • Is there a script to apply a certain style to thousands of words arranged in a list?

    Hello, I tried to use FindChangeByList, but I do almost all the work of collage every word on the legs, so I might as well apply the styles to the hand.

    So my plan is to apply the same style to near 11 000 words that appear in a book. These words are for most of the names and marks, and they appear throughout the whole of the text, it would be quite tedious to manually apply this style.

    I have these words put aside in a list.txt

    Anyone know if I could use it in any script and apply the style automatically?

    Like I said, sticking each word in FindChangeByList is out of the question, just like applying style verbatim, it would still...

    ... Thank you!

    Piece of cake. Since you do not specify, this script assumes that your text file is called "list.txt" and is located in your folder (line 1) user documents, and your style is a Style of character called "yourStyle" (line 9).

    textFile = File(Folder.myDocuments+"/list.txt");
    if (textFile.open("r") == false)
    { alert ("yeah ... that file does not exist"); exit(0); }
    strs = textFile.read ();
    textFile.close();
    strs = strs.split("\n");
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    app.changeGrepPreferences.appliedCharacterStyle = app.activeDocument.characterStyles.item("yourStyle");
    while (strs.length > 0)
    {
    app.findGrepPreferences.findWhat = "\\b"+strs.pop()+"\\b";
    app.activeDocument.changeGrep();
    }
    
  • Why the tableStyle script not working, when the other two are

    Hi, please can you help and thank you in advance. I'm puzzled. As you can see, I am new to scripting - a glance through the 15 pages on the forum showed me how the news - and I want a workflow in which I put the styles and then use in this case, "appliedTableStyle" to connect to the appropriate table.
    My question is why this style of table script not work and appear in the palette? (when the two scripts below paragraphs and cells are) I tried the doc.tableStyles.add and the doc.tableStyle.add. Please show me where I'm wrong, or a better alternative. Thank you.
    docTest = app.documents.add)
    table_styles (docTest)
    cell_styles (docTest)
    para_styles (docTest)
    function table_styles (doc)
    {
    with (doc)
    {
    //try {doc.tableStyles.add
    try {doc.tableStyle.add
    ({
    name: "tableGLOBAL."
    bodyRegionCellStyle: doc.cellStyles.item ('cellGLOBAL'),
    headerRegionSameAsBodyRegion: true,
    bodyRowCount: 10.
    headerRowCount: 1.
    })
    }
    catch {} (_)
    }
    }
    function cell_styles (doc)
    {
    with (doc)
    {
    try {doc.cellStyles.add
    ({
    name: "cellGLOBAL."
    appliedParagraphStyle: doc.paragraphStyles.item ('paraBodyGLOBAL'),
    topInset: 0,
    leftInset: 0,
    bottomInset: 0,
    rightInset: 0,
    verticalJustification: VerticalJustification.CENTER_ALIGN,
    firstBaselineOffset: FirstBaseline.LEADING_OFFSET,.
      })
    }
      catch (_){}
    }
    }
    function para_styles (doc)
    {
    with (doc)
    {
    try {doc.paragraphStyles.add
    ({
    name: "paraBodyGLOBAL."
    appliedFont: "Arial,"
    firstLineIndent: 0,
    justification: Justification.LEFT_JUSTIFIED,.
    pointSize: "6 pt."
    main: '8 '.
    })
    }
    catch {} (_)
    }
    }

    Your trial... construction of capture hides the real error - during the development of a script, you can not use.

    When I removed it, ID has reported only with the message quite without value

    "Error string: this attribute is not defined for the table styles.

    Source: ts = doc.tableStyles.add({")

    without saying what attribute... Try one by one, I found this particular result: you cannot initialize 'headerRegionSameAsBodyRegion '... Probably because you cannot initialize without a header first, and you don't "do" again because you always initialize the entire style.

    But this workaround works:

    ts = doc.tableStyles.add({
     name: 'tableGLOBAL'
     , bodyRegionCellStyle: doc.cellStyles.item( 'cellGLOBAL' )
     , headerRowCount: 1
     , bodyRowCount: 10
    });
    ts.headerRegionSameAsBodyRegion = true;
    
  • How to write the script to apply the character style?

    Hello

    I'm on a Macbook pro and without a numeric keypad, so I can't assign a shortcut to character styles. I heard a roundabout solution where you can assign a shortcut to a script that applies the character styles. Can anyone write this script?

    My character style is called "features"bold. "

    I am new to scripting, sorry if this is a stupid question.

    See you soon

    Hello

    1. save this code as a file inside your Script Panel folder .jsx

    2. apply a shortcut using the menu Edit: shortcuts...

    Option to choose:

    • suggest you choose an option 'background': 'Text', so you can use several shortcuts that are occupied in other contexts.
    #target indesign
    if (app.selection && app.selection[0].hasOwnProperty ("baselineShift") ) {
      var cName = "Features bold";
      var mCstyle = app.activeDocument.characterStyles.item(cName);
      if (mCstyle.isValid)
           app.selection[0].applyCharacterStyle(mCstyle);
      else
           alert ("CharStyle: " + cName + " not found");
      }
    else
      alert ("Some text supposed to be selected...");
    

    Jarek

  • I am currently working on a site that has the integration of Paypal which includes the page redirects (confirm or cancel). My goal is to have the implementation of site with a layout for desktop, Tablet and phone. My question is when I have a redirect pag

    I am currently working on a site that has the integration of Paypal which includes the page redirects (confirm or cancel). My goal is to have the implementation of site with a layout for desktop, Tablet and phone. My question is when I have a redirect page should I create a separate provision of the page for each device or just a provision of office that fits all three screen sizes? I hope that if the html page has the same name of the device (query) is automatically detected. Help with the help of Adobe Muse CC

    By Payal integration, you mean paypal html button? or etc payment gateway configuration? If this is a configuration of the gateway to your site domain name then a single page with any structure will work, but if you use the button code for all associated formats then you will need to create separate pages for all.

    Thank you

    Sanjit

  • Hi ya'll! I'm still learning how to navigate my way with Lightroom. (Last time I wrote, I got a few responses that work.) Thank!) Now, I have another question. When I try to copy photos to my external hard drive to a CD/DVD, no matter if the make

    Hi ya'll! I'm still learning how to navigate my way with Lightroom. (Last time I wrote, I got a few responses that work.) Thank!) Now, I have another question. When I try to copy photos to my external hard drive to a CD/DVD, no matter if do leave LR or my car, I get the message; "Disc burning is not supported by LR on this computer." I've tried everything I can think of, so, I thought I'd see if anyone can find out if there is something I can do. Or could it be that my computer just can't handle it? Help! So frustrating!  I have a Lenovo PC, I don't know if that makes a difference. Any ideas? Thanks a lot for your help!

    You burned discs with other programs using this computer? Are you sure that you have a drive that will burn the disks?

  • Script to add a domain user to the local Administrators group raises the error "the network path is not found."

    I have a Windows Server 2008 R2 domain and a Windows XP Pro workstation that has been attached to the domain and then disconnected. I am trying to create a VBS script to add a domain user to the local Administrators group.

    I log on my computer as a local administrator and run the following script:

    Dim oNetwork: Set oNetwork = WScript.CreateObject ("WScript.Network")
    StrPC Dim: strPC = oNetwork.ComputerName
    Dim OGroup: Set oGroup = GetObject ("WinNT: / /" & strPC & "/ directors")
    Dim OUser: Set oUser = GetObject ("WinNT://domainname/username")
    oGroup.Add (oUser.ADsPath)

    This script returns the error "the network path is not found."

    However, I am able to go into control panel > user accounts > enter the user name and the domain name > click Next... > choose the administrators of the 'other' group and the user name will be added to the local Admin group.

    The same script runs without error if it is launched after logon on the workstation with a domain administrator account.

    How can I get my script runs without error, when you are logged into the workstation as a local administrator?

    Best regards, Andy

    The code that I used came from here. If the syntax of the Add method is passed to oUser.ADsPAth to "WinNT: / /" & domainname & "/" & username, the script works correctly.

    Therefore, the modified script:

    Dim oNetwork: Set oNetwork = WScript.CreateObject ("WScript.Network")
    StrPC Dim: strPC = oNetwork.ComputerName
    Dim OGroup: Set oGroup = GetObject ("WinNT: / /" & strPC & "/ directors")
    Dim strUser: strUser = "WinNT://domainname/username."
    oGroup.Add strUser

    Thanks to Qasim Zaidi to show the code of work here.

    Best regards, Andy

  • When using on the part of the family can they others besides Organizer individual payments?

    When using on the part of the family can others besides the Organizer make individual payments without using the card of the organizers?

    Family sharing makes it easy for up to 6 people in your family share each other iBooks, iTunes and App Store purchases without sharing accounts.

    "Pay for purchases with the same credit card families and approve kids' expenses directly from the device of a parent." And share photos, a family calendar and more to help keep everyone connected. »

    Implement the family sharing - Apple Support

  • I get e-mails and others are told that my mail box is full. When I send emails part only cross. Get error 450.

    say it error 450

    I get e-mails and others are told that my mail box is full.  When I send emails part only cross.

    Said e-mail message settings for your outgoing e-mail needs must be configured.  Time Warner told me 21/2
    hours later that it is a problem of Ms.
    They also tell me that the 'properties' in need of repair email.
    Dear God can someone help me?

    Your 'server' mailbox is full.

    Click on the Menu button. Options | E-mail accounts | Properties | Advanced. Uncheck: Leave a copy of messages on the server.

    Close and open WLMail. If the problem persists, log on to the Road Runner Webmail site and remove messages from the Inbox it.

    Windows Live Mail Forum
    http://windowslivehelp.com/forums.aspx?ProductID=15

  • Trying to reinstall my Windows XP home edition and my keyboard does not work when I reached the part where I have to type my name and organization

    Original title: reinstalling Windows

    I am trying to reinstall my Windows XP home edition and when I reached the part where I have to watch myself and my organization my keyboard does not work and I can't type my name or to the next step.

    Hello

    1. did you have backed up your data before attempting to reinstall Windows?
    2. do you have other devices connected to your computer outside of the mouse and keyboard?

    If so, I suggest that you remove any external devices, then try reinstalling Windows.

  • Essbase server showing in Shared Services, but displays do not when you try to assign roles to groups.

    Hello

    11.1.1.3 version

    SSP Essbase server shows but for all groups roles has beed deleted.

    When I try to re - assign particular group roles, I realized that Essbase server does not show in the left pane.

    This means essbase struck with Shared Services? If so can you please let me know the steps to register again?

    I know to remove the instance Essbase Shared Services and new Externalize user will do, BUT can you please let me know y at - it problems doing?

    In the morning today only we are facing this problem.

    Thank you

    Alain

    Hello

    Problem has been resolved. Worked with Oracle and review Essbase.

    It is corrupt and possibly RDBMS openldap.

    Solution: Manually (via MaxL) has deleted all requests for services shared and deleted essbase server then outsourced to the users to register with Shared Services.

    Thank you

    Alain

  • Newbie script question: how to change a story in a particular style

    I am new to scripting and I'm getting to know the built-in script FindChangeByList. (I use InDesign CS4 for Windows.) I use the excellent script to find tapes of changes by Martin Fisher (modified by Kasyan Servetsky). It works brilliantly, but I have a question. I want to add a string of FindChangeList who take an object any selection or history and put it all in a style particular (the real name of my style is "Body2.TextIndent"). This should be the best thing to do, but as a newbie, I'm puzzled. The only thing I could come up with was to find 'any character' and replace it with the style I wanted, so something like this:

    text {"findWhat: ' ^?} "} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, wholeWord:false, caseSensitive:false} //Transform the history in the Body2.TextIndent style

    This does not work, but it's very, very slow. I guess the program must change all the characters of the style I want, that's why it takes so long. Is there a faster and more efficient way to write this? Yet once, I'm just trying to turn the story into a particular style. Obviously, this could be done in two clicks in correct InDesign, but I want to integrate this into the syntax FindChangeByList.

    Thank you!

    P.S. is there a difference in the use of FindChangeByList in the Javascript version compared to the version of Visual Basic? I took the version of Visual Basic to chance and that's what I use.  (I use the script to find tapes of change to develop my strings, as I indicated above.)

    Of course, this could be done in two clicks in correct InDesign, but I want to integrate this into the syntax FindChangeByList..)

    Why do you want to use FindChange for this? It is horribly inefficient. Whence this requirement? Or you just want to tell you want to do in a script, not that it must be a FindChange script?

    The paradigm of right in the scripts here is the same that interactively - set the appliedParagraphStyle for each of the selected paragraphs, a loop on those paragraphs. Do not do operate at the level of the character and do not use FindChange.

  • Firefox is having "Script" questions (no response) und eventually Flash issues?

    Okay, downloaded Firefox for the first time like a year yesterday. It worked perfectly, oh, how I missed it. I hate using Google Chrome with a fiery burning passion.

    However, although it worked perfectly yesterday, I have not downloaded anything or has any plug-ins/extensions, whatever.

    Today, however, I can go on www.google.com (on firefox), but if I try to go on my site banks, Habbo.es, or something like that, all the sudden Firefox decided to hang. It freezes und I get that annoying "(ne répond pas)" upstairs. " I have to shut completely out of the browser, open und renounce session restore.

    Some websites is okay, however, it seems that many of them are not.

    I get a script error message, this day for Neopets.com , which displayed was "lookout.bluecava" or something like that. Asked if I wanted to wait for script to respond or if I wanted to stop him. Whatever it is, it ends with closing me und on return from google.

    Ask this question, I had to re - download google chrome, und log in from this browser since Firefox is not even want to support right now, it's own support forum! Stuff of crazy, right?

    In any case, since it is having a problem with "script", I went to java, made sure I had the java update installed on my computer, then I made sure that I got the update java plugin. Und I even downloaded java 64 bit for him as well, the 7u45 or something else.

    So, my java on my comp und firefox browser are apparently up to date, und the thing of the add-on for Firefox to check if the plugins are up to date says that they are all up to date.

    Still having the issue. At the time where I go to imvu or another site that has this issue, it freezes for 10 seconds und that's all she wrote.

    So I'm not really wanting to go back to Google Chrome for another year, I miss the hell out of Firefox.

    To add: the question that I have now with Firefox is the same problem, I had a year before, when I had to uninstall firefox und go with Chrome in the first place.

    But, since yesterday it was normal when I installed it, I thought it was fixed. Wrong in less than 24 hours.

    Before I submitted this, I decided to jump on Firefox und try something.

    I disabled the Shockwave Flash und plugins Shockwave Director. Now, Firefox works again.

    so.

    He asks me if I want to install the 'flash' plugins needed to view content on the page (I used Neopets.com trying after disabling the Shockwave), but still runs.

    So, what should I do for flash? Or better yet, what is happening with it?

    I downloaded the flash yesterday in a half hour startup of Firefox after you download it. Und it worked very well for hours.

    I turned off the computer, he packed up, went home, back to work, hop on the net und BAM. All the shock wave suddenly is having problems with Firefox when nothing was done he commit? Is not supposed.

    Other info:
    Windows 7 Home Premium on HP laptop.

    Well, I don't know what was the root cause of the problems I had. But I had a friend completely erase my computer und installation Windows 7 Professional on this topic. Und now, I no longer have problems with Firefox about flash. It's purr in this Department.

  • SPI 8451 - in script mode. When stops in VI?

    Hello

    I use the pilots to control the area 8451 in script mode.

    My question concerns the situation when I send the script to the SPI to run box. When the VI will come out? At the present time, the script is sent to the box or when at the moment is sent in the box?

    See you soon,.

    K.

    Hi K,

    Sorry for the confusion. I read the manual and it says it returns success or failure depending on the course of execution. As a result, I expect that the VI should end once the order has been executed, or sent out of the box.

    The link for the manual is here: http://www.ni.com/pdf/manuals/371746d.pdf

    The information that I mentioned is on the page 12-21, or 289 in Adobe Reader.

    I hope this helps

Maybe you are looking for