Question for scripting gurus: GREP search, change case make Smallcaps

I have no knowledge of scripting at all, but this question keeps coming up during training sessions: is it possible to (java)script this:
- Do a GREP search \u\u+
- Change case to lowercase
- Apply SmallCaps (or: apply character style)
this would allow to search for acronyms and change them to smallcaps (or, even better: apply a character style with small caps and tracking)
I know it is easy for OpenType smallcaps (do a GREP search, change to OT smallcaps) but this doesn't really change case. And some fonts used aren't OT.
Anyone?
Would be VERY apreciated!!

But Harbs is a seasoned scripter who knows he'll get flamed if one of his scripts "just does not work" ;)
Well, now that you mention it, the script is not really foolproof. It's a quick and dirty script which I threw together very quickly. It's missing any error checking, some of the variables global, and it's not in a private namespace. These are all things which could cause it to "just not work" ;-)
Here's a more foolproof construct... (and it'll work on the current story if selected, or the whole document if there's no story selected) It will create a new character style if one does not exist and work on character styles within style groups as well. I wrapped the whole script in an anonymous function to give it a unique namespace as well.
(function()
if(app.documents.length==0){return}
var doc=app.documents[0];
// Change the following to your style name!
var character_style_name = 'Small Caps';
try{var range = app.selection[0].parentStory}
catch (err){var range = doc}
//comment out next line if you do not want styles.
var charStyle = GetCharacterStyle(character_style_name,doc);
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat="\\u\\u+";
var finds=range.findGrep();
for (var i=0;i<finds.length;i++){
finds[i].changecase(ChangecaseMode.lowercase);
//comment out next line if you do not want styles.
finds[i].applyCharacterStyle (charStyle)
//uncomment next line if you do not want styles.
//finds[i].capitalization=Capitalization.smallCaps;
function GetCharacterStyle(styleName,doc){
var charStyles=doc.allCharacterStyles;
for(var i=0;i<charStyles.length;i++){
  if(charStyles[i].name==styleName){
   return charStyles[i];
return doc.characterStyles.add({name:styleName,capitalization:Capitalization.smallCaps});

Similar Messages

  • Script or GREP search line for missing quotation marks (opening or closing)

    Hi there,
    I've being trying to figure out a GREP search that will help me find quotations that haven't been opened or closed properly. Does anyone know if there exists a script that will mark/help me find the quotation marks that incorrectly stand alone? A GREP search line would be fine too.
    Following is an example - just to make sure I made myself clear:
    'why is the closing quotation mark missing after the question mark? I asked.
    'I don't know, this line seems to be fine, with opening and closing quotation mark,' I answered.
    Although this line is missing an opening quotation mark.'
    Hope somebody can help me, I'm pretty sure I'm not the first person searching for a solution on this issue - sorry, I'm not to bright with scripting or GREP.
    Thnx.
    Gijs

    As you say, it's not waterproof, but it is really helpfull, thanks. The unclosed quotation are easy to find this way.
    In Dutch we mainly use single quotation marks (double quotation marks are only used for quotations within quotations). This brings an extra dimension to the issue, since the apostrophe and single quotation mark are the same character. So a phrase like ' I'm having problems finding unopened quotations' with your GREP suggestion will mark the apostrophe in I'm as the closing quotation mark.
    So what I'll do is:
    1. find unclosed quotations ‘[^’]+?‘ and mark them with a character style WARNING;
    2. GREP search ’[^‘]+?’ two following closing quotation marks and make them C=100;
    3. GREP search ’[^‘’]+?’ the correct quotations and mark it all K=100;
    4. Do a regular search for '^$ any apostrophe/quotation mark followed by a letter and mark them all K=100;
    5. Do a regular search for any closing quotation mark left in C=100 and manually WARNING-mark the ones that need to be looked at by the editor.
    Step 4 is a bit tricky since any error like 'I agree,'he said (no space after quotation mark) will be marked back to K=100 as well, but those errors I'll probably notice since they're underlined by the grammar control option.
    Thanks again for the help.

  • Finished script: Use grep find/change to fill in a supplied table of contents

    This script is now complete, and has been the subject of most of my previous posts. Just in case anyone wanted to know what the finished script ended as, here it is.
    Thanks so much to all. A lot of really helpful folks on this board are very responsible for the success of this task. This script is to be one of hopefully many in the creation of our records. But it's a huge leap forward. Thanks again to everyone that helped.
    Cheers,
    ~Nate
    Task:
    Automatically find town names in listings, and fill in table of contents template on page 2 accordingly.
    Example of page 2 toc, initially:
    Example of a page of content. The town names are what need to be referenced on the TOC:
    Example of page 2 toc once script is finished:
    Because of the need to include the transaction dates on the TOC (comes as a provided, tagged-text file), a simple Indesign-generated TOC can't be used alone.
    This script uses an Indesign-generated TOC that's on a master page called "T-tocGen" ... It then uses grep search and replaces to grab the needed information, and insert it into the page 2 TOC.
    The script will update a generated TOC and then search for an instance of a page number, and town name. The generated toc lists all included towns in the following format:
    (line start)## tab townName(line end)
    In Grep, this would be (please note, extra \ for \d and \t ... javascript needs that for some reason):
    ^\\d+\\t(.*)$
    After the script gets the info it needs from a found instance of the above, it replaces that line with "---", to prevent that line from being picked up once again.
    The script with then place the needed page number in it's rightful place on page 2, replacing the XX.
    A while loop is used to repeat the above process until there are no longer any instances of "^\\d+\\t(.*)$" present.
    Not every town runs every issue, so once the script is done, it removes all remaining instance of "XX" on the page 2 TOC.
    FINAL CODE:
    TOC replace
    This script will use grep find/change methods to apply page numbers in
    tocGen to the XX's on page2TOC.
    // define the text frame of generated TOC
        var tocGenFrame  = document.masterSpreads.item("T-tocGen").pages.item(0).textFrames.item(0);
    // udpate generated TOC ... store contents in tocGenStuff
        var tocGenStuff = updateTOCGen();
    // set variable for while loop
    var okGo = "1";
    // while okGo isn't 0
    while(okGo.length!=0)
    // get town info from tocGen
    getCurrentTown();
    // replace XX's with tocGen info
    replaceTown();
    // grep find ... any remaining towns with page numbers in tocGen?
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "^\\d+\\t(.*)$";
    // set current value of okGo ... with any instances of above grep find in tocGen
    okGo = tocGenFrame.findGrep();   
    // grep find/change all leftover XXs in page2TOC
    app.findGrepPreferences = app.changeGrepPreferences = null;       
    app.findGrepPreferences.findWhat = "^XX\\t";
    app.changeGrepPreferences.changeTo = "\\t";
    app.activeDocument.changeGrep();  
    // clear grep prefs
    app.findGrepPreferences = app.changeGrepPreferences = null;
    //  functions                  //
    function getCurrentTown()
    // grep options   
    app.findChangeGrepOptions.includeLockedLayersForFind = true;
    app.findChangeGrepOptions.includeLockedStoriesForFind = true;
    app.findChangeGrepOptions.includeHiddenLayers = true;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findChangeGrepOptions.includeFootnotes = true;
    // grep find:  startLine anyDigits tab anyCharacters endLine
          app.findGrepPreferences = app.changeGrepPreferences = null;
          app.findGrepPreferences.findWhat = "^\\d+\\t(.*)$";
    // get grep find results      
    currentGen = tocGenFrame.findGrep();  
    // store grep results content into currentLine
    currentLine = currentGen[0].contents;
    // match to get array of grep found items
    currentMatch = currentGen[0].contents.match("^\\d+\\t(.*)$");
    // second found item is town name, store as currentTown
    currentTown = currentMatch[1];
    // change current line to --- now that data has been grabbed
    // this is because loop will continue as long as the above grep find yields a result
           app.findGrepPreferences.findWhat = "^\\d+\\t"+currentTown+"$";
                  app.changeGrepPreferences.changeTo = "---";
                tocGenFrame.changeGrep(); 
    function replaceTown()
    app.findChangeGrepOptions.includeLockedLayersForFind = true;
    app.findChangeGrepOptions.includeLockedStoriesForFind = true;
    app.findChangeGrepOptions.includeHiddenLayers = true;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findChangeGrepOptions.includeFootnotes = true;
    // find: XX currentTown .... replace with: currentLine
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = "^XX\\t"+currentTown+" \\(";
        app.changeGrepPreferences.changeTo = currentLine+" \(";
    app.activeDocument.changeGrep();   
    function updateTOCGen()
    //set vars ... toc text frame, toc master pag
        var tocGen  = document.masterSpreads.item("T-tocGen").pages.item(0).textFrames.item(0);
        var tocGenPage  = document.masterSpreads.item("T-tocGen").pages.item(0);
    //SELECT the text frame generatedTOC on the master TOC
        tocGen.select();
    //Update Table of Contents by script menu action:
        app.scriptMenuActions.itemByID(71442).invoke();
    //Deselect selection of text frame holding your TOC:
        app.select(null);
    //store contents of toc text frame in variable
        var tocGenText = tocGen.contents;
    //return contents of tocGen
        return tocGenText;

    Thanks for the reply.
    You are correct but the problem is there are three rows, One row is 100% black, the second is 60% black and the third is 40% black. I want to change the black to blue, the 60% black to an orange and the 40% black to a light shaded blue. In the find/change option you can select the tint you want to find and replace but yea.. does work on table cells.. oddly enough.

  • InDesign Scripting or GREP Find/Change?

    Can anyone help me with a script or GREP idea for finding, cutting and pasting the phone numbers at the end of these paragraphs? The first one is what I have and the second is where I would like to get. There are hundreds of these in 4 restaurant directories that I am designing.
    Woodlands (ve) Indian. Weekend buffet. 4078 Jermantown Road. (703) 385-1996. M–F 11:30am–10pm, Sa 11:30am–10pm, Su 11:30 am–9:30pm.
    Woodlands (ve) Indian. Weekend buffet. 4078 Jermantown Road. M–F 11:30am–10pm, Sa 11:30am–10pm, Su 11:30 am–9:30pm. (703) 385-1996.

    You don't need to ask the same question twice. Lets keep all the discussion inthe original topic please,
    http://forums.adobe.com/message/3856456#3856456
    If you are not able to make the anser I provide there work, please provide some details about what is not working, and some before and after screen shots.

  • A question for Tokenizer in a search engine project.

    I am doing a search engine project in Java. The project will need two parts: indexer and query Processer. The class I have includes IndexBuilder.java, InvertedIndex.java, Parser.java, Tokenizer.java, StopWordList.java, Lovinstemmer.java.
    Among above class files, I am not quite understand how Tokenizer works. The following is what I am understanding the scenario of index part works. Please check what I talk about how Tokenizer works, it might be wrong.
    I think Parser object will get the input file, then will deal with the words in the file one by one. FOr example, for the first word in the input file, Parser will contact StopWordList.java and Lovinstemmer.java to get rid of unuseful characters, then pass this changed word to Tokenizer, Tokenizer will then do sth to this words, then return a token( here, token is the words) to the Parser, then Parser will put this token into InvertedIndex.
    Am I right? If I misunderstood sth, please let me know. Thanks,
    James

    It's quite possible that what you say is correct, but why are you asking us? Those classes are not part of the standard Java API, but were written (or at least) specified by somebody else. So ask that person.

  • Using Grep to change case in 2nd of a two word string

    Hello all
    I found out after completing my project that I had made a big boo boo.
    I have multiple (hundreds) 2 word botanical names of plants which are all located after a certain heading style throughout 400 pages.
    The first word in this name is capitalized already. Thats ok. But the second word needs to start with a lower case letter ( Instead of a capital letter like it has now).
    All the 2 word names are seperated by commas.
    Any ideas?
    Thanks in advance
    Lauren

    Hi Peter
    OK
    Example:
    Plant Species: Crambe Abyssinica
    Plant Species Synonyms: Brassica Nigra Var. Abyssinica, Crambe Hispanica, Crambe Kilimandscharica
    The headings Plant Species and Plant Species Synonyms are in a character style "Red Bold"
    These plant names are all styled with a character style called "Index"
    The first heading Plant Species usually only has one 2 part binomial name. In this case the second word 'Abyssinica' needs to start with lower case ( I forgot about these when I posted my request)
    The second heading 'Plant Species Synonyms' usually has more than two 2 word names seperated by commas
    There are of coarse some plants which have no plant species synonyms.
    I was able to create an awesome index with scripting help from this forum (Actually it was you Peter K. with some great help from Peter S. !!)
    In order to be 'correct' though these second words of the plant binomial names need to be lowercase.
    These headings and format repeat hundreds of times
    Does this help clarify things a bit?
    Thanks Peter

  • Bug: Change Case as you Type

    For some reason the option "Change case as you type" (Preferences > Code Editor > Completion Insight) keeps changing. It will remain the same for a while but changes at some random point. Each time I restart SQL Developer it seems to go back to "+Lower Keywords, Upper Identifiers+".
    Here's the information about the current version that I'm using:
    Oracle SQL Developer 3.0.04
    Version 3.0.04
    Build MAIN-04.34
    OS: Windows 7 - 64bit
    Martin
    http://www.ClariFit.com
    http://www.TalkApex.com

    Try to set it right also at Preferences - Database - SQL Formatter - Oracle - Edit - Other - Case change.
    Hope that helps,
    K.

  • Security question are not mine so I can't make purchases

    How can I chose new security questions for iTunes account.
    I can't make purchases.

    Welcome to the Apple Community.
    Start here, and reset your security questions, you will receive an email to your rescue address, then go to manage your account > Password and Security and set your security questions.
    If that doesn't help or you don't have a rescue address, you might try contacting Apple through iTunes Store Support

  • Question When I do a search for an image I only have a limited number of images. There used to be a ton of pictures on my screen and an unlimited amount of pictures to look through. Is there a way of changing this back to the way it used to be???

    Question
    When I do a search for an image I only have a limited number of images. There used to be a ton of pictures on my screen and an unlimited amount of pictures to look through. Is there a way of changing this back to the way it used to be???

    Thanks.  So there's no means of knowing whether a text message has been delivered, not to mention time of delivery.  Perhaps I've gone for the wrong phone.  It might do a lot but seems to miss out on some basics.

  • Questions for GREP gurus

    I have large text files that I have to convert into tab delimited text to import into excel. The information in each "column" is just separated by multiple spaces (so it is not actually a true column) with a paragraph return at the end of each entry. I want to replace the multiple spaces with a single tab stop. I have figured out how to convert most of it except for one issue. at the end of each paragraph there is a one or two digit number preceded by 15 spaces and then another one or two digit preceded by 1 or more spaces (this varies). Kind of looks like this. (space) (space) (space) (space) one or two digit number (space) (space) (space) (space) (space) (etc...) another one or two digit number. I want to eliminate the spaces and just have a tab stop preceding each number and also keep the paragraph return after the last number. I am getting better with GREP searches but this one has me stumped. I can do multiple operations to get close to the results, such as search for multiple spaces and replace with tab stops, then search for multiple spaces again to try to clean it up, but that is kind of messy and imprecise. Any help would be appreciated.
    Thanks
    Randy

    While this isn't going to teach you much — the ID GREP panel has a preset, "Multiple Space to Single Space" — select that, and change the "Change to" to
    \t
    for tab. Refine the scope to "Selection".
    You can deconstruct this GREP if you'd like to see how it works.
    d

  • Excluding a character from "Change to" box that is in "Find what" box in GREP search

    Hello all! I am a first time poster but have been lurking around the forums for a few months. I'm trying to produce an InDesign document for a book I'm putting out, and there is a section where I have the following text:
    |  TAB  |1.|  TAB  |Lorem ipsum dolor etc.
    The text doesn't literally say tab, I jsut wanted to highlight that there is a tab of white-space on either side of the number for the line. This occurs numerous times in numerous chapters in the endnotes section. I want to remove the tabs so that the result is:
    1. Lorem ipsum dolor etc
    2. Lorem ipsum dolor etc
    3. etc etc
    I have identified that the way to find these sections is to use the GREP search function with \t\d+.\t. The + is there because the numbers go into the double digits in most chapters for the references. However, I do not want to remove the numbers, just the tabs. Is there any way to add an exclude feature to the "Change to" window of the search function? I've tried just leaving it as \d., but that literally changes the text to
    \d. Lorem ipsum dolor etc
    That's not good. I'm trying to avoid having to do all of this by hand, and of course by the time I get a resolution I'll probably have been better off doing it manually, but I'm looking toward the future and trying to ascertain the best way of streamlining such a process short of not having that kind of format in the first place when receiving the file from my employer
    Many thanks for your advice,
    David

    Peter,
       Just to affirm your assistance, this worked for me. I still don't understand the advanced search features perfectly, but I got the formatting fixed without having to sift through it manually. I found that replacing with "$2. " (minus the quotes) worked well. However, I noticed that searching for (\d). would turn up a digit followed by ANY kind of punctuation, not just a period. I assume therefore that . must mean something different in GREP than I'm thinking it does. I just wanted to find any digit before a full-stop. At any rate, that is something I can find a table of GREP search terms for. I didn't understand the $2 thing until I monkeyed with it. I'm typing now for future generations of newbies that might stumble upon my post. The $2 ignores the second character in your "Find what" field. So for example, if instead you had two tabs then a digit then a tab, you could search:
    Find what: (^\t)(\t)(\d)(\t)
    Change to: $3.
    This would take any occurrence of two tabs, a number, and a tab and replace with a period, ignoring and therefore not changing at all the number. The $3 is saying "ignore the third search term", in this case, the \d.
    A better approach would be to use +. This means "any time you see one or more occurrences of the searched-for character". This would look something like:
    Find what: (^\t+)(\d+)(\t+)
    Change to: $2.
    Here you are saying "Any time you see one or more tabs followed by one or more numbers and then followed by one or more tabs, ignore the digit, delete the tabs before and after, and add a full stop after the number. This is a very powerful search feature, once you understand what you're doing anyway. Hope that is helpful to someone at some point.

  • Adding GREP search to FindChangeByList script in CS4

    I'm trying to remove numbers from a baseball box score pulled from the Internet.
    The file has 10 numbers across separated by tabs and I only need six of the numbers not all 10
    St. Lucie Mets
    Player,Pos         AB     R     H     2B     3B     HR     RBI     BB     SO     AVG
    Daniel Muno, 2B    4     1     1     0     0     1     1     0     2     .259
    Robbie Shields, DH     4     0     2     1     0     0     0     0     1     .471
    This GREP search works in FindChange in InCopy/InDesign (using CS4)
    (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d)
    This works in the Change field
    $1 $2 $3 $7 $8 $9
    However, when I try to add this to a FindChangeByList script, it generates an error. So my syntax, logic or both is flawed.
    What should I do to fix it?
    grep    {findWhat:"(\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d)"}    {changeTo:"$1 $2 $3 $7 $8 $9"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.
    Thank you,
    Keith

    Hi Jongware,
    Thank you for the reply.
    I tried the double slashes and get an Error 25. So something I'm doing in the Search/Replace portion isn't working.
    However, I did have success with changing a style by using a GREP search. The line below works with the double slashes, just not the Find/Change lines:
    grep
    {findWhat:"\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d"}
    {appliedParagraphStyle:"Z BB Box Exp Batting 07T"}
    {includeFootnotes:true, wholeWord:false, caseSensitive:false}
    //Changes style

  • Updating Dave Saunders find style/change case script

    How can I update a Dave Saunders script from CS1 and CS2 to CS5?
    he wrote a brilliant script which searches for a paragraph style and changes the case to upper or lower.
    However, it was for CS1 and CS2.   I can 't get it to run on CS5.
    it trips up on
      app.findPreferences = null;
    object does not support 'findPreferences'
    here is the script.  thanks for your help!
    //DESCRIPTION: Converts text in designated parastyle to designated case
    if ((app.documents.length != 0) && (app.selection.length != 0)) {
    myDoc = app.activeDocument;
    myStyles = myDoc.paragraphStyles;
    myStringList = myStyles.everyItem().name;
    myCaseList = ["Uppercase","Lowercase", "Title case", "Sentence case"];
    myCases = [ChangecaseMode.uppercase, ChangecaseMode.lowercase, ChangecaseMode.titlecase, ChangecaseMode.sentencecase];
    var myDialog = app.dialogs.add({name:"Case Changer"})
    with(myDialog){
      with(dialogColumns.add()){
       with (dialogRows.add()) {
        with (dialogColumns.add()) {
         staticTexts.add({staticLabel:"Paragraph Style:"});
        with (dialogColumns.add()) {
         myStyle = dropdowns.add({stringList:myStringList,selectedIndex:0,minWidth:133});
       with (dialogRows.add()) {
        with (dialogColumns.add()) {
         staticTexts.add({staticLabel:"Change Case to:"});
        with (dialogColumns.add()) {
         myCase = dropdowns.add({stringList:myCaseList,selectedIndex:0,minWidth:133});
    var myResult = myDialog.show();
    if (myResult != true){
      // user clicked Cancel
      myDialog.destroy();
      errorExit();
      theStyle = myStyle.selectedIndex;
      theCase = myCase.selectedIndex;
      myDialog.destroy();
      app.findPreferences = null;
      app.changePreferences = null;
      myFinds = myDoc.search('',false,false,undefined,{appliedParagraphStyle:myStyles[theStyle]});
      myLim = myFinds.length;
      for (var j=0; myLim > j; j++) {
       myFinds[j].texts[0].changecase(myCases[theCase]);
    } else {
    errorExit();
    // +++++++ Functions Start Here +++++++++++++++++++++++
    function errorExit(message) {
    if (arguments.length > 0) {
      if (app.version != 3) { beep() } // CS2 includes beep() function.
      alert(message);
    exit(); // CS exits with a beep; CS2 exits silently.

    I've adapted seddybell's new script so that it works with paragraph styles instead of character styles. Hope that's useful to someone.
    //DESCRIPTION: Update of Dave Saunder's ChangeCaseOfSelectedStyle script for CS5 and later
    //jblondie: Fork of seddybell's update so that you can select by Paragraph Style instead of Character Style.
    if ((app.documents.length != 0) && (app.selection.length != 0)) {
    myDoc = app.activeDocument;
    myStyles = myDoc.paragraphStyles; //jblondie: replaced character with paragraph
    myStringList = myStyles.everyItem().name;
    myCaseList = ["UPPERCASE","lowercase", "Title Case", "Sentence case"]; //jblondie: Changed myCaseList so it's consistent with InDesign's built in Change Case tool
    myCases = [ChangecaseMode.uppercase, ChangecaseMode.lowercase, ChangecaseMode.titlecase, ChangecaseMode.sentencecase];
    var myDialog = app.dialogs.add({name:"Case Changer"})
    with(myDialog){
      with(dialogColumns.add()){
       with (dialogRows.add()) {
        with (dialogColumns.add()) {
         staticTexts.add({staticLabel:"Paragraph Style:"}); //jblondie: replaced Character with Paragraph
        with (dialogColumns.add()) {
         myStyle = dropdowns.add({stringList:myStringList,selectedIndex:0,minWidth:133}) ;
       with (dialogRows.add()) {
        with (dialogColumns.add()) {
         staticTexts.add({staticLabel:"Change Case to:"});
        with (dialogColumns.add()) {
         myCase = dropdowns.add({stringList:myCaseList,selectedIndex:0,minWidth:133});
    var myResult = myDialog.show();
    if (myResult != true){
      // user clicked Cancel
      myDialog.destroy();
      errorExit();
      theStyle = myStyle.selectedIndex;
      theCase = myCase.selectedIndex;
      myDialog.destroy();
      app.findTextPreferences = NothingEnum.NOTHING;
      app.changeTextPreferences = NothingEnum.NOTHING;
      app.findTextPreferences.appliedParagraphStyle = myStyles [theStyle]; var myFinds = myDoc.findText(); //jblondie: replaced Character with Paragraph
      myLim = myFinds.length;
      for (var j=0; myLim > j; j++) {
       myFinds[j].texts[0].changecase(myCases[theCase]);
    } else {
    errorExit();
    // +++++++ Functions Start Here +++++++++++++++++++++++
    function errorExit(message) {
    if (arguments.length > 0) {
      if (app.version != 3) { beep() }
      alert(message);
    exit();

  • GREP 'find/change' by list script: find a text string containing different para styles

    Hi
    I'm don't write scripts but do 'enjoy' copying, pasting and changing existing code/txt files.
    I have built a GREP find/change .txt that performs a large number of text edits/changes.
    But I'm left with an issue where I have paragraphs of text (styled earlier in the .txt file) that I'm unable to identify using GREP the usual way. I need to identify text in a particular paragraph style, followed by text in another paragraph style.
    Is it possible with GREP to create a search string to find: text styled with one paragraph style, ending with a paragraph return, and to include in that selection the following paragraph/s styled with another paragraph style?
    MTIA Steve

    seb400 napisał(-a):
    What do you mean by I would mark "changing" in "copying, pasting and changing"?
    Hi Steve,
    I mean I can see a way by modifying some existing code with "find...change" job
    1. set criteria to findGrep
    2. store findGrep() in an array
    3. check each found object if next paragraph matches some new criteria
    4. run changeGrep() if true
    Jarek

  • How is it possible to use Index Seek for LIKE %search-string% case?

    Hello,
    I have the following SP:
    CREATE PROCEDURE dbo.USP_SAMPLE_PROCEDURE(@Beginning nvarchar(15))
    AS
    SELECT * FROM HumanResources.Employee
    WHERE NationalIDNumber LIKE @Beginning + N'%';
    GO
    If I run the sp first time with param: N'94', then the following plan is generated and added to the cache:
    SQL Server "sniffs" the input value (94) when compiling the query. So for this param using Index Seek for AK_Employee_NationalIDNumber index will be the best option. On the other hand, the query plan should be generic enough to be able to handle
    any values specified in the @Beginning param.
    If I call the sp with @Beginning =N'%94':
    EXEC dbo.USP_SAMPLE_PROCEDURE N'%94'
    I see the same execution plan as above. The question is how is it possible to reuse this execution plan in this case? To be more precise, how
    Index Seek can be used in case LIKE %search-string% case. I expected that
    ONLY Index Scan operation can be used here.
    Alexey

    The key is that the index seek operator includes both seek (greater than and less than) and a predicate (LIKE).  With the leading wildcard, the seek is effectively returning all rows just like a scan and the filter returns only rows matching
    the LIKE expression.
    Do you want to say that in case of leading wildcard, expressions Expr1007 and Expr1008 (see image below) calculated such a way that
    Seek Predicates retrieve all rows from the index. And only
    Predicate does the real job by taking only rows matching the Like expression? If this is the case, then it explains how
    Index Seek can be used to resolve such queries: LIKE N'%94'.
    However, it leads me to another question: Since
    Index Seek in
    this particular case scans
    all the rows, what is the difference between
    Index Seek and Index Scan?
    According to
    MSDN:
    The Index Seek operator uses the seeking ability of indexes to retrieve rows from a nonclustered index.
    The storage engine uses the index to process
    only those rows that satisfy the SEEK:() predicate. It optionally may include a WHERE:() predicate, which the storage engine will evaluate against all rows that satisfy the SEEK:() predicate (it does not use the indexes to do this).
    The Index Scan operator retrieves
    all rows from the nonclustered index specified in the Argument column. If an optional WHERE:() predicate appears in the Argument column, only those rows that satisfy the predicate are returned.
    It seems like Index Scan is a special case of Index Seek,
    which means that when we see Index Seek in the execution plan, it does NOT mean that storage engine does NOT scan all rows. Right?
    Alexey

Maybe you are looking for

  • HELP!!! Could someone help me with a jar file issue and JRE 1.3 & 1.4

    We had a problem with the last Oracle patch in that it tried to extract from a jar file using the "jar" executable. But the jar executable is not installed on the server where we have JRE 1.4 On one server, Jar.exe is installed where we have JRE 1.3.

  • Creation of a purchase order triggers the event ReleaseStepCreated twice

    Hello, I tried to use the standard workflow for the approval of a purchase order and noticed that i am receiving twice the same mail. As you know, the workflow is triggered by the event ReleaseStepCreated. After I created a purchase order, i saw that

  • FCPX10.1.1 does not solve the problem with long-time clip editing!

    OS: clean installed mac os10.9.1 FCPX: FCPX10.1.1 Project: 4clips, all of the clips is about 1 hour long (dvcprohd) Disk: 900MB/S++ machine specs: 2*3.06Ghz 6-core 24GB DDR3 and I've tried these graphic cards: K5000 and 2 5770 all get the same result

  • PI 7.1 RWB - find user cancelled message

    hi, simple question. Where can i find the username of a cancelled message in the RWB (adapter engine monitor) ? I can´t find the username in the audit log, message log or somewhere else. The audit log is only showing the entry: Admin action: The mess

  • Selection screen shows only 500 values

    Hi All, When I execute a query having a selection option variable (0material) with "single values", I am only shown the first 500 values out of the entire list......how to get the remaining values in the selection screen? Thanks, gaurav