Text find and change the problem CS3 and CS4 scripts

I use the script below to find text and turn them into others.

There is one thing the script can't do it for me.

Example:


(g) management

(1) that no law that is adopted in the Cayman Islands, a tax to collect profits, income, gains or satisfaction does apply to the company or its activities; and

(2) that the above-mentioned tax or any tax in the form of rights of succession or inheritance tax is payable in respect of shares, debentures or other obligations of the company.

Example: (end)

I had a lot of subjects or points in the passage. And I want to change the space between '(g)' and 'Management' in a tab character. So I revised the plain text file 1texte.

PS: 1text.txt is filled with what to change.

text {findWhat: "^ p(^?)" ' "} {changeTo: "^ p(^?)"} ^ t "} {includeMasterPages:true, includeHiddenLayers:true, includeFootnotes:true, wholeWord:false} search all space-dash-space and replace it with an en dash."

The result is:

(^?) ^ tManagement

(^?) ^ tthat any law that is passed in the Cayman Islands, imposing a tax on profits, income, not capital gains or satisfaction applies to the company or its activities. and

(^?) ^ tthat the above-mentioned tax or any tax in the form of rights of succession or inheritance tax is payable in respect of shares, debentures or other obligations of the company.

PS: ^ t is a tab character.

result (END)

This is not what I want.

It should be"(g) ^ tManagement'.

PS: ^ t is a tab character.

Please someboady help me out revised the script below to change the text in what I want. Thank you very much.

Here's the script.

FindChangeByList.jsx
An InDesign CS4 JavaScript
/*
@@BUILDINFO @ "FindChangeByList.jsx" 2.0.0.0 January 10, 2008
*/
Loads a series of strings delimited by tab characters from a text file, and then executes a series
Find/replace operations based on the lines read from the file.
//
The data file is delimited by tabs, returns to cart that separates records.
//
The format of each record in the file is:
findType < tab > findProperties < tab > changeProperties < tab > findChangeOptions < tab > description
//
Where:
< tab > is a tab character
findType is 'text', 'grep' or 'glyph' (this sets the find/replace operation type to use).
findProperties is a recording of properties (text) search preferences.
changeProperties is a recording of properties (text) of the change preferences.
findChangeOptions is a recording of properties (text) of the options find/replace.
Description is a description of the search/replace operation
//
Very simple example:
text {findWhat: "-"} {changeTo: "^ _"} {includeMasterPages:true, includeHiddenLayers:true, includeFootnotes:true, wholeWord:false} find all double hyphens and replace by an em dash.
//
More complex example:
text {findWhat: ' ^ 9 ^ 9.} {' ^ 9 ^ 9 '} {appliedCharacterStyle: 'price'} {include notes: true, include master pages: true include hidden layers: true, any word: false} find $ 10.00 to $ 99.99 and apply the character style 'price '.
//
All metacharacters search InDesign are allowed in the properties 'findWhat' and 'changeTo"findTextPreferences and changeTextPreferences.
//
If you enter the backslashes in the object findGrepPreferences findWhat property, they must be "escaped".
as shown in the example below:
//
{"findWhat: '"\\s+ "}
//
To learn more about InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
or visit the InDesign Scripting user to http://www.adobeforums.com users forum
//
main();
main() {} function
var myObject;
Ensure that the interaction of the user (dialog boxes display, etc.) is turned on.
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
If (app.documents.length > 0) {}
If (app.selection.length > 0) {}
{Switch(App.Selection[0].constructor.) Name)}
case 'PointInsertion ':
'character ': case
case "word":
case 'TextStyleRange ':
case "line":
stops of the "Point":
case "TextColumn":
case 'text ':
case "cell":
case "column":
case 'Row ':
case 'Table ':
myDisplayDialog();
break;
by default:
An option has been selected, but it was not a text object, so look for in the document.
myFindChangeByList (app.documents.item (0));
}
}
else {}
Nothing has been selected, then just search for the document.
myFindChangeByList (app.documents.item (0));
}
}
else {}
Alert ("no document is open. Please open a document and try again. ») ;
}
}
function myDisplayDialog() {}
var myObject;
var myDialog = app.dialogs.add({name:"FindChangeByList"});)
{with (MyDialog.dialogColumns.Add ())}
{with (dialogRows.Add ())}
{with (dialogColumns.Add ())}
staticTexts.add ({staticLabel: "beach of research :"});})
}
var myRangeButtons = radiobuttonGroups.add ();
{with (myRangeButtons)}
radiobuttonControls.add ({staticLabel: "Document", checkedState:true});})
radiobuttonControls.add ({staticLabel: "Selected Story"});
If (app.selection [0] .silence! = "") {}
radiobuttonControls.add ({staticLabel: "Sélection", checkedState:true});})
}
}
}
}
Ditto var = myDialog.show ();
if(myResult == true) {}
{Switch (myRangeButtons.selectedButton)}
case 0:
myObject = app.documents.item (0);
break;
case 1:
myObject = app.selection [0] .parentStory;
break;
case 2:
myObject = app.selection [0];
break;
}
myDialog.destroy ();
myFindChangeByList (myObject);
}
else {}
myDialog.destroy ();
}
}
function myFindChangeByList (myObject) {}
var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, ditto;
var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, monarticle;
var myStartCharacter, myEndCharacter;
var myFindChangeFile = myFindFile("/FindChangeSupport/1test.txt")
If (myFindChangeFile! = null) {}
myFindChangeFile = File (myFindChangeFile);
Ditto var = myFindChangeFile.open ("r", not defined, undefined);
if(myResult == true) {}
Loop in find/replace operations.
{}
myLine = myFindChangeFile.readln ();
Ignore blank lines and comment lines.
If ((myLine.Substring (0.4) == "Text") |) (myLine.substring (0.4) == "grep"). (myLine.substring (0, 5) is "glyph")) {
myFindChangeArray = myLine.split ("\t");
The first field in the line is the findType chain.
myFindType = myFindChangeArray [0];
The second field in the line is the FindPreferences channel.
myFindPreferences = myFindChangeArray [1];
The second field in the line is the ChangePreferences channel.
myChangePreferences = myFindChangeArray [2];
The fourth field is the range - used only text find/replace.
myFindChangeOptions = myFindChangeArray [3];
{Switch (myFindType)}
case 'text ':
myFindText (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
break;
case "grep":
myFindGrep (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
break;
case 'glyph ':
myFindGlyph (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
break;
}
}
} while(myFindChangeFile.eof == false);
myFindChangeFile.close ();
}
}
}
function myFindText (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions) {}
Reset the preferences of find/replace before each search.
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences = NothingEnum.nothing;
var myString = "app.findTextPreferences.properties =" + myFindPreferences + «;"»»» » ;
myString += "app.changeTextPreferences.properties =" + myChangePreferences + ";". " » ;
myString += "app.findChangeTextOptions.properties =" + myFindChangeOptions + ";". " » ;
app.doScript (myString, ScriptLanguage.javascript);
myFoundItems = myObject.changeText ();
Reset the find/change preferences after each search.
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences = NothingEnum.nothing;
}
function myFindGrep (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions) {}
Reset the find/change grep preferences before each search.
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences = NothingEnum.nothing;
var myString = "app.findGrepPreferences.properties =" + myFindPreferences + «;"»»» » ;
myString += "app.changeGrepPreferences.properties =" + myChangePreferences + ";". " » ;
myString += "app.findChangeGrepOptions.properties =" + myFindChangeOptions + ";". " » ;
app.doScript (myString, ScriptLanguage.javascript);
var myFoundItems = myObject.changeGrep ();
Reset grep find/change preferences after each search.
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences = NothingEnum.nothing;
}
function myFindGlyph (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions) {}
Reset the preferences of glyph in find/replace before each search.
app.changeGlyphPreferences = NothingEnum.nothing;
app.findGlyphPreferences = NothingEnum.nothing;
var myString = "app.findGlyphPreferences.properties =" + myFindPreferences + «;"»»» » ;
myString += "app.changeGlyphPreferences.properties =" + myChangePreferences + ";". " » ;
myString += "app.findChangeGlyphOptions.properties =" + myFindChangeOptions + ";". " » ;
app.doScript (myString, ScriptLanguage.javascript);
var myFoundItems = myObject.changeGlyph ();
Reset glyph in find/change preferences after each search.
app.changeGlyphPreferences = NothingEnum.nothing;
app.findGlyphPreferences = NothingEnum.nothing;
}
function myFindFile (myFilePath) {}
var myScriptFile = myGetScriptPath();
var myScriptFile = File (myScriptFile);
var myScriptFolder = myScriptFile.path;
CheminMonFichier = myScriptFolder + CheminMonFichier;
If (queue (CheminMonFichier) .exists == false) {}
Display a dialog box.
CheminMonFichier is File.openDialog ("choose the file containing your list find/replace");.
}
Return CheminMonFichier;
}
function myGetScriptPath() {}
try {}
myFile = app.activeScript;
}
{catch (MyError)}
myFile = myError.fileName;
}
return myFile;
}

I'm not a writer, but I'll take a stab and try to make a difference here.

The main problem, in my opinion, is that you use a plain text instead of GREP search. Text gross has no provision to replace the text found by itself, for example, rather than using the codes you entered a literal string. Your search text of ' ^ p(^?) ' means find any character in brackets that occurs after a paragraph break. I would use in GREP ^ \s+ (\(.+?\)) which translates to find an opening parenthesis at the beginning of a paragraph (so he'll find if it happens to be the first character in th in a story) followed by a number any characters up to the first parenthesis (in the case where you have double the figures or double entries letter) followed by ANY white space (in the case where it is not an ordinary space or multiple spaces). Replace $1\t which means the text found in the first set of parentheses in query search followed by a tab.

Parentheses are special in GREP, they surround groups of terms you want to re-use the text found, so looking for the actual characters you need to 'escape' with the-prefix, so \(.+\) will find a paren open followed by all the characters up to the end last paren in the paragraph. Addition of the? After the + makes research stop at the first closing paren met, although there are several sets in the paragraph.

Tags: InDesign

Similar Questions

  • A message from windows live saying the acct has been hi-jacked by a hacker and they wanted our mobile phone # send a text msg to solve the problem.

    problem of pirate?

    We received a message from windows live saying the acct has been hi-jacked by a hacker and they wanted our mobile phone # send a text msg to solve the problem.  We have not so much text msging and then they want all sorts of personal information (name, DOB, address, e-mail addresses, etc.) and we do not want to do that.  is this a legitimate windows msg and is it possible that I can call someone from microsoft was finishing speaking?  Thank you.

    Hello

    That sounds like a SCAM don't respond so not! Unless you have launched the contact of its likely someone
    I'm trying in fact to steal your account and your identity. If your account has been compromised, see the
    below.

    Unfortunately the answers is a site of support of peers supported and has no real influence
    with Windows Live.

    Check with Windows Live Support and Forums

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

    Windows Live Solutions
    http://www.windowslivehelp.com/solutions.aspx?ProductID=15

    Windows Live Solution Center
    http://www.windowslivehelp.com/

    Compromised account - unauthorized account access
    http://windowslivehelp.com/solution.aspx?SolutionID=6ea0c7b3-1473-4176-b03f-145b951dcb41

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • LiveCycle ES4. I am trying to move a picture online with a text box to create a header.  I had to create a subform that flows to generate multiple pages of text.  After changing the settings, it seems that I can't place images and text where

    LiveCycle ES4. I am trying to move a picture online with a text box to create a header.  I had to create a subform that flows to generate multiple pages of text.  After changing the settings, it seems that I can't place the images and the text I would like.  I tried moving them to the bottom, but does not work.  Is there a way to encapsulate the images so that they can be places as much as I want?

    Select your photo and text inside the subform flowed. Right-click and select wrap in subform do the positioned Subform subform. This will allow you to move objects in this subform positioned the way you like them.

  • How to resolve the IP address automatically changing the problem?

    My Oracle database 10g (10.2.0) is on the Windows XP platform and the IP address of the system often changes automatically. This leads to problems with my Oracle database. How to deal with this problem? How to stop the IP change the problem?

    change your windows networking to dhcp to a static ip address. Just google it or follow [this link | http://www.hotcomm.com/FAQ/FAQ_staticIPXP.asp]

  • How to find or change the voltage setting set in a series of HP TouchSmart IQ500

    How do I find or change the voltage setting set in a series of HP TouchSmart IQ500 (specifically an IQ524)

    It does not use an external power adapter? If so, all you need to use in another country is an adpater sheet to match the wall outlet.

  • Right click and change the problem

    How can I change the right-click and change association then a jpg opens for editing in CS6 instead of CS5 in Windows 7? I like to keep the two programs installed and Windows no longer offers the possibility to change the association of 'change '.

    See you soon,.

    Here is a solution to the problem.

    http://www.NirSoft.NET/utils/file_types_manager.html

    See you soon,.

  • My laptop with vista os guard gel and I find it is the problem of "hpqddsvc.dll", how can I solve this problem?

    My laptop screen freeze meet often enough these days problem
    After that I ran safe mode and found the problem of "hpqddsvc.dll?
    How to fix? Thank you!

    Hello

    your problem is with the HP software

    read what it is

    http://www.file.NET/process/hpqddsvc.dll.html

    Try HP support forums

    http://h30434.www3.HP.com/

  • EP 6: change the size of the text box without changing the font size?

    OK, it took me awhile looong to finally install PES 6 (from 4 PES) and now it's been a Loooong time that I used it.

    4 PES, you just had to click on the text tool in the text box to see the squares bounding, and you can make the changes. In PES 6, it seems the only way I can get the bounding box to show is now with the tool selection... which of course does not change the size of the font as well.

    I did beaucoup Googling etc and that you can't find the answer. Help, please. I'm not a PSE newbie by any means. I used it for scrapbooking widely in the past which included a LOT of text resizing box... but it seems that 6 is designed differently than 4 and it is NOT intuitive at all. I've figured it out at some point, but it's been too long... > 1 year.

    Please help... need to finish scrapbooking for Christmas gifts...

    I wonder if what has been improved in later versions?

    OK people... it seems it's on my own computer performance issues! To do a break more significantly on areas bounding while using the text tool. I was so rushed... I had mice on and if something didn't happen immediately, assumed that he would not. Sorry for the trouble, but maybe this will help some other impatient soul like me!

  • Change size of text box without changing the type...

    Hello

    Hope this finds you well.

    What is the right way to resize a text box? I read that you are supposed to choose the type, and then hold down the command key, and then change the size. However, sometimes it works and sometimes it doesn't. Any thoughts?

    I appreciate your time and look forward to hearing back from you soon.

    If you want to change the size as well as the box, use the key command key. If you just need to change the dimensions of the bounding box, while leaving the type of the same size (which causes reflow), just hover over a corner and click drag to resize.

  • Plugin 'Hidden text': how to change the mask of interactively? (Apex 4.2)

    Hello


    I use the plugin 'Hidden text' large (of the Oracle Application Express Plug-Ins page) to enter formatted text.

    Now, I'm trying to put in place a way so I can change the format interactively mask, but has failed so far.

    The plugin has a custom attribute "The InputMask" and I created an element of the page 'P2_INPUTMASK '.

    In th e page is displayed as 'Hidden text' the "The InputMask" attribute is defined on & P2_INPUTMASK.

    I put in place a dynamic action (with a point of the box) that can change the value of P2_INPUTMASK, and then refresh the

    Text maskes element, but the mask of text never changed.

    Is it possible to change the value of the attribute mask interactively?


    Kind regards

    Roland

    If you examine the code of the plugin, you will see that the mask is applied on the definition page loading, so your change does not affect things to run.

            apex_javascript.add_onload_code (
                p_code => 'apex.jQuery("#'||p_item.name||'").mask('||
                          apex_javascript.add_value(l_input_mask)||
                          '{'||apex_javascript.add_attribute('placeholder', l_placeholder, true, false)||'});' );
    

    But you can change your dynamic action to call some javascript that would execute, something very similar to this one. Make sense?

    to start:

    $('#P2_INPUT').mask($v('P2_INPUTMASK'));
    

    Scott.

  • Settings.ini is being used by another process, how to find what causes the problem

    I can't use my sidebar or windows update, that other programs work not only on the desktop administrator. have you tried restoring system and boot

    Joan

    Are you saying the problem occurs in a user profile and not another?

    What happened when you tried the system restore? How long have you had the problem? You have a restore point from before the problem started?

    It is always sensible in this situation to achieve a malware check

    Start the computer in safe mode with network and download and install Malwarebytes (free version for individuals only), updated definitions and run in safe mode. Disable other security software while you do the analyses.
    http://www.Malwarebytes.org/

    Download and run SuperAntiSpyware (Free Edition)
    http://www.SUPERAntiSpyware.com/download.html

    Some malware is installing the entries of proxy server redirecting internet connections. If you encounter this problem step 2 see in the following link:
    http://www.myantispyware.com/2011/02/21/how-to-remove-Internet-Security-Essentials-virus/

  • Skype does not the window find asolution to the problem

    I try to use Skype on windows Vista .skype is no answer and waiting for a solution to the problem of windows,... .Please help

    Hello

    try asking in the Forums of Skype

    http://Forum.Skype.com/

  • Syntax error in DW... can not find out what the problem

    Hello

    I seem to have a problem in adding a new slide show on the JQuery slider.  I took pictures of the code.  First picture shows the code #slideshow 1-7.  It is the way it is when I went back to work and they work.  also there no syntax error in DW when I open this page:

    js1.jpg

    I also wanted to show you the lower part of this script, so you can see the code before I edited it.  Here it is:

    js2.jpg

    Then, I have now added #slideshow8 and so far so good - no errors:

    js3.jpg

    This is where, I add the lower part of the code for slide show 8 and it seems to imitate all of those above (7, 6, etc.).  However, DW says I have an error on line 139.  Here is what I added:

    js4.jpg

    Don't forget that as I type all right, while I type even more, the error lights (error of the line 139).  also I do not add any code to the bottom in this section:

    js5.jpg

    Also after that I added the code, all slideshows stop working (from 1 to 8).  So I am really confused and hoping someone can help what is the problem.  Remember, I just took this job so all this code on the page you see was done by the person in front of me.  Don't say that I'm a great coder myself not but just wanted to report it.  If you want to see live page without my code, you can go to the link below.

    http://www.darrp.NOAA.gov/archives

    Please help me.  Thank you.

    The end of the script should look like this...

    $("#slideshow8_a").each (function () {}

    If ($(this) .is (": hidden")) {}

    }
    else {}
    Title var = $(this) .attr ("title");
    $('#title8').html (title);
    }
    });
          }
    });

    It lacks the "BOLD" above, the second series of your wrong version...

    }

    });

  • By selecting the text box to change the text field

    I worked on a form to allow suppliers to fill their reports of endoscopy online.  I'm trying to do something very simple.  If a user selects a check box change the value in a text field.  Either we allow the code to run once.  It will change the value once - even if I think it's to set an incorrect value in the code - but that is neither here nor there at this point.

    Here's the code that should work in my opinion.

    Form1. EndoscopyPage1.TestChkBox::click - (JavaScript, client)

    If (this.rawValue == 1)

    {

    TestTxt1.rawValue = "ON"; the user cannot enter field

    }

    on the other

    {

    TestTxt1.rawvalue = "off"; the user can enter the field

    }

    I tried the following as well

    If (TestChkBox.value = 0) then

    TestTxt1.editValue = 'Off ';

    endif;

    If (TestChkBox.value = 1) then

    TestTxt1.editValue = "ON";

    endif;

    I have attached the file as well.  My trial fields are in the middle of the first page.

    It's just a typo. You typed rawvalue rather than rawValue "V" must be upper case.

    See the attahed to the snap.  It works for me after you change this property.

    Nith

  • I'm trying to find answers to the problem with recent lightroom CC 2015 download

    How can I speak with someone?

    Hi Jim,.

    Please mention the problem you are having with Lightroom CC 2015 or contact team support for the same thing by clicking on the link below:

    Contact the customer service

    *Remember to stay signed with your Adobe ID ( email id used to purchase the subscription ) before accessing the link above*.

    Kind regards

    Bani

Maybe you are looking for

  • Glass replacement for AT100

    The glass in the corner of my Toshiba AT100 android tablet is cracked. It's on one edge and the touch screen and the LCD are still OK. What should I do to fix it? Can I get the 'glass' only, or do I need to get the whole LCD? What is called the part

  • How toFF3.6 for Mac OS x download avoid incompatibility with business website?

    My wife works for a society that demands the declaration of time and other functions to do online. Unfortunately, the site is not compatible with FF 4.0 or higher (for PC - I know from personal experience) or Safari 5.0 on our new Mac (also of the ex

  • Firefox is too extended each time I try to install it?

    I downloaded and delete I don't know how many times and each time it is amplified as double! None of my other programs it. I have Windows 7 and have been using IE. I downloaded the latest update Adobe.I had Firrefox for a long time until this latest

  • Error message indicator of battery at startup

    HP Pavilion p6512uk desktop running Windows 7 64 bit PC Whenever I boot, I get the following two messages: Battery indicator - HPID09.  Access violation at address 00401C 62 in the module 'BATINDICATOR' read of address 000002DC .exe and Battery indic

  • dv2415US: AC adapter help

    My mother's laptop is a HP Dv2415us. He uses this very thin card that fits on a tiny pin inside the laptop. We tried and failed to find a replacement for the charger, as it came with the charger alone has no number of parts that I can discern. It was