Need advanced "Find and Replace" method

I have bunch of pages need "Find and Replace" work in html
coding, but I can't use DW's "Find and Replace" function to do with
it. Here's the sample code:
quote:
"<tr valign="top"><td align="center"><a href="
../photo/ccg/pages/Columbus Grill
M_jpg.htm"><img src="../photo/ccg/thumbnails/Columbus
Grill M_jpg.gif" border="0" onClick="MM_openBrWindow('
../photo/ccg/pages/50th Yard
M_jpg.htm','rr','width=386,height=306')"><br>
Columbus Grill M</td>
<td align="center"><a href="
../photo/ccg/pages/Columbus Grill
W_jpg.htm"><img src="../photo/ccg/thumbnails/Columbus
Grill W_jpg.gif" border="0" onClick="MM_openBrWindow('
../photo/ccg/pages/50th Yard
M_jpg.htm','rr','width=386,height=306')"><br>
Columbus Grill W</td>
<td align="center"><a href="
../photo/ccg/pages/Cookies Lounge
M_jpg.htm"><img src="../photo/ccg/thumbnails/Cookies
Lounge M_jpg.gif" border="0" onClick="MM_openBrWindow('
../photo/ccg/pages/50th Yard
M_jpg.htm','rr','width=386,height=306')"><br>
Cookies Lounge M</td>
<td align="center"><a href="
../photo/ccg/pages/Cookies Lounge
W_jpg.htm"><img src="../photo/ccg/thumbnails/Cookies
Lounge W_jpg.gif" border="0" onClick="MM_openBrWindow('
../photo/ccg/pages/50th Yard
M_jpg.htm','rr','width=386,height=306')"><br>
Cookies Lounge W</td>
<td align="center"><a href="
../photo/ccg/pages/Corcorans
M_jpg.htm"><img src="../photo/ccg/thumbnails/Corcorans
M_jpg.gif" border="0" onClick="MM_openBrWindow('
../photo/ccg/pages/50th Yard
M_jpg.htm','rr','width=386,height=306')"><br>
Corcorans M</td>
</tr>"
You can see I need to use EVERY highlighted code to replace
each NEXT bolded code, highlighted code are deffirent but bolded
code are the same. Now I just do it manually, but there are
thousands of them.
Is any one has a better method using DW's "Find and Replace"
function to do this job automatically?

Using Templates with a 900 page site is a crime against
humanity. You reach
the optimal size for Templates between about 50 and 100.
The error you are getting suggests that there are coding
errors on the page
(perhaps even unrelated to ANY DW Template markup). We'd need
to see the
page to make progress with what that might be, as Alan says.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"RyanWaters" <[email protected]> wrote in
message
news:ggs7fq$gnq$[email protected]..
>I am a little green to this all. I am trying to find and
replace a word
>inside
> the edit region and Dreamweaver will not change it,
because it says its
> inside
> a locked region, but its a editable region?
> I have about 900 pages I need to make this change on and
was relying on
> the
> find and replace tool to do that. I tried differn't
advanced options,
> nothing
> seams to change it. I am using cs3. Thanks for any help
>

Similar Messages

  • Why does a find and replace method remove whitespace?

    I have method that searches for a string in a FM document and replaces it with a variable. If for example, there was a string foobar that I wanted to replace with the variable barfoo. Then, I expect this text:
    Lorem ipsum dolor sit amet, foobar consectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    To be changed to this text:
    Lorem ipsum dolor sit amet, barfoo consectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    However, while the text does do the replace it also removes the whitespace between the variable and the text that appears right after the variable so it actually looks looks like this:
    Lorem ipsum dolor sit amet, barfooconsectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    Why is the find and replace method removing the whitespace and how do I prevent that from happening? The method is provided below.
    function FindAndReplaceString(pDoc, findString, replaceVariable)
        if (typeof pDoc != 'undefined'&&typeof findString != 'undefined'&&typeof replaceVariable != 'undefined'&&pDoc.ObjectValid()&&findString.length>0&&replaceVariable.length>0)
            var vVarFmtStatus=checkVarFmStatus (pDoc, replaceVariable);
            if (vVarFmtStatus=='In Doc')
                var tr = new TextRange();
                var findParams = new PropVals();
                var frame = pDoc.MainFlowInDoc.FirstTextFrameInFlow;
                var restoreTR = pDoc.TextSelection;
                tr.beg.obj = tr.end.obj = frame.FirstPgf;
                tr.beg.offset = tr.end.offset = 0;
                findParams = AllocatePropVals(1);
                findParams[0].propIdent.num = Constants.FS_FindText;
                findParams[0].propVal.valType = Constants.FT_String;
                findParams[0].propVal.sval = findString;
                tr = pDoc.Find(tr.beg, findParams);
                var vLoopCounter=0;
                while(FA_errno === Constants.FE_Success&&vLoopCounter++< 1000)
                    pDoc.TextSelection = tr;
                    pDoc.Clear(0);
                    var newVar = pDoc.NewAnchoredFormattedVar(replaceVariable, tr.beg);
                    var varLength = newVar.TextRange.end.offset - newVar.TextRange.beg.offset;
                    tr.beg.offset += varLength;
                    tr = pDoc.Find(tr.beg, findParams);
                if (vLoopCounter>0)
                    Log (vLogFileName, 'In the document \''+pDoc.Name+'\', the string \''+findString+'\' was replaced with the variable \''+replaceVariable+'\' '+vLoopCounter+' times.\n')
                if (vLoopCounter>1000)
                    recordErrors (vErrorLog, 'ERROR: In the document "'+pDoc.Name+'", the find and replace operation was stopped after executing '+vLoopCounter+' times. The term being searched for is "'+findString+'" the replacement variable is "'+ replaceVariable+'".')
                pDoc.TextSelection = restoreTR;
                pDoc.ScrollToText(restoreTR);
                } else {
                    recordErrors (vErrorLog, 'ERROR: The find and replace operation failed because the variable '+replaceVariable+' does not exist in the following doc: '+pDoc.Name)
            } else {
                recordErrors (vErrorLog,'Invalid or unitialized parameter passed to function FindAndReplaceString')

    Hi,
    Not at the moment. Please post in http://forums.adobe.com/community/muse/ideas so other users can vote on the feature request.
    Thanks,
    Abhishek

  • Find and replace value in Delimited String

    Hi All,
    I have a requirement, where i need to find and replace values in delimited string.
    For example, the string is "GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~". The 4th column gives month and year. I need to replace it with previous month name. For example: "GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~". I need to do same for last 12 months.
    I thought of first devide the values and store it in variable and then after replacing it with required value, join it back.
    I just wanted to know if there is any better way to do it?

    for example (Assumption: the abbreviated month is the first occurance of 3 consecutive alphabetic charachters)
    with testdata as (
    select 'GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}') part
    ,to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}')
             ,to_char(add_months(to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY'),-1),'MON')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~
    FEB
    02/01/2013
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    with year included
    with testdata as (
    select 'GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}') part
    ,to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}')
             ,to_char(add_months(to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY'),-1),'MON-YY')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    JAN-13
    01/01/2013
    GL~1001~157747~DEC-12~CREDIT~A~N~USD~NULL~
    Message was edited by: chris227 year included

  • Find and replace string in file

    hi,
    i need to find and replace text (string) data in about 100+ files, i've decided to write a small java program to do it but i'm stuck on how to replace.
    here is what i'm heading towards:
    class ReplaceString {
      BufferedReader in;
      BufferedReader os;
      public static void main(String args[]) {
        ReplaceString obj = new ReplaceString();
        obj.replace();
       void replace() {
         try {
           in = new BufferedReader(new FileReader("a.txt");
           os = new BufferdWriter(new FileWriter("a.txt");
           //  read until end of file
           String currentLine = new String();
           while((currenLine=is.readLine()) != null) {
             //  if matching text then replace????
             if(currentLine.equals("Version 001") {
                // how to now replace the Version 001 with Version 002???
         }catch(IOException e) {
            System.out.println(e);
            in.close();
            os.close();
         in.close();
         os.close();
    }the above code i just typed so there might be errors, but looks ok to me, is there any way once i find the string i want to replace, to replace the string with another string. basically i want to replace all occurrences of the text "Version 001" with "Version 002"
    Thank you.

    Is it always true, as in your example, that the replacement is the same length as the existing string? If so, this one's easy.
    Is it also true that you don't need to worry about 16-bit chars? (Again, as in your example.) If you're using just ASCII characters, this gets easier still.
    1) Segregate the file I/O from the search/replace process.
    2) Main becomes:
    readFile();
    replace( "this", "that" );
    writeFile();Use a byte array buffer, defined in your main class. Fill it via the readFile() code. Use a RandomAccessFile, check its length() to allocate your byte array, then do a single read() to fill the buffer.
    A brute force search will certainly work: scan for the first search character, then check the rest for a match, replace if you've got a match and continue scanning. Alternative if your file's aren't too big: create a String from the byte array:
    // buffer is a byte array
    String s = new String( buffer );And use the String.replaceAll() to do the search/replace. Recover the buffer with:
    buffer = string.getBytes();A single write() and close() should handle the remaining work.

  • Find and Replace more then one character

    Hi
    I need to find and replace more then one character. for example: I need to replace "A" with "a". "B" with "b" and so on. how to do that in one search?

    See the following script by Peter Kahrel:
    Change case
    http://www.kahrel.plus.com/indesign/grep_change_case.html
    If the "A" and the "B" are in arbitrary positions in your text you could use the following GREP:
    [AB]
    together with the script.
    For testing your GREP expressions, you could use the following script, also by Peter Kahrel:
    A GREP editor
    http://www.kahrel.plus.com/indesign/grep_editor.html
    Uwe

  • Need Help With find and Replace

    I am a little green to this all. I am trying to find and
    replace a word inside the edit region and Dreamweaver will not
    change it, because it says its inside a locked region, but its a
    editable region?
    I have about 900 pages I need to make this change on and was
    relying on the find and replace tool to do that. I tried differn't
    advanced options, nothing seams to change it. I am using cs3.
    Thanks for any help

    Using Templates with a 900 page site is a crime against
    humanity. You reach
    the optimal size for Templates between about 50 and 100.
    The error you are getting suggests that there are coding
    errors on the page
    (perhaps even unrelated to ANY DW Template markup). We'd need
    to see the
    page to make progress with what that might be, as Alan says.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "RyanWaters" <[email protected]> wrote in
    message
    news:ggs7fq$gnq$[email protected]..
    >I am a little green to this all. I am trying to find and
    replace a word
    >inside
    > the edit region and Dreamweaver will not change it,
    because it says its
    > inside
    > a locked region, but its a editable region?
    > I have about 900 pages I need to make this change on and
    was relying on
    > the
    > find and replace tool to do that. I tried differn't
    advanced options,
    > nothing
    > seams to change it. I am using cs3. Thanks for any help
    >

  • Find and replace advanced help

    Firstly thank you for reading.  I come here as a last resort to see if there's a solution to a problem I have.
    Basically I need to rename several thousand images in a blog backup that is being transfered to a new host.  The format of the images are as follow
    <img alt="Revlon-pedi-egg" border="0"  src="images/6a00d8341c873353ef011572419566970b-800wi.jpg"  />
    where each of the several thousand images has a unique alt tag and a unique image name
    What I want dreamweaver to find the alt tag then replace the image name, so that the above image would become
    <img alt="Revlon-pedi-egg" border="0"  src="images/Revlon-pedi-egg..jpg" />
    I have used replace expressions before as well as (.*) etc but I just can't seem to get this one to work.
    Is this possible and if so would someone be kind enough to give me some pointers?

    FIRST MAKE A BACKUP.
    Test this in several pages first.
    In Dreamweaver Find and Replace, select the following options:
    Find in: Current Document
    Search: Source Code
    Find:
    <img alt="([^"]+)(".*?)src="images\/[^.]+
    Replace:
    <img alt="$1$2src="images/$1
    Select Use regular expression.
    Once you are confident that it's making the correct changes, you can then do it for an entire folder or the whole of the current site.
    This assumes that all your image tags use double quotes around attribute values as shown in your original post.

  • Find and replace help needed, multiple variables

    Hi everyone,
    Im trying to find all urls in my code that start in a particular way but have a number variable at the end, see examples below
    <a href="/example/examplefolder/enquiry.asp?pid=123">
    <a href="/example/examplefolder/enquiry.asp?pid=485">
    <a href="/example/examplefolder/enquiry.asp?pid=284">
    and replace them with one url, see example below
    <a href="/example/examplefolder/default.asp">
    How can I use Dreamweaver find and replace to achieve this across my whole website?
    So far I only know how to find one thing and replace with another, rather than finding variables and replacing them with one thing.
    Thanks for your help with this!

    In the Find field of the Find and Replace dialog box, enter this:
    (href\s*=\s*\"\/example\/examplefolder\/enquiry\.asp)\?pid=\d+(\")
    In the Replace field, enter this:
    $1$2
    Select the "Use regular expression" checkbox.
    Explanation:
    The two sets of parentheses are capturing groups, which capture the actual values as $1 and $2.
    The \s* matches zero or more spaces.
    \" matches a double quote.
    \/ matches a forward slash.
    \? matches a question mark
    \d+ matches one or more numbers.
    I have written a two-part tutorial on using regular expressions, which can be found here: http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt1.html.
    Message was edited by: David_Powers (adding explanation of double quote).

  • Find and Replace Issue Help Requested.

    Hi all. I've been digging around for a couple of days and
    can't seem to figure this one out. For starters, I have already
    looked at the Regular Expression syntax and tried the MS word
    clean-up option, but no luck. We have about 1,500 pages of content.
    They are in DNN, so the pages are created dynamically.
    Unfortunately, the page content was written in Word and then dumped
    in DNN. We are trying to clean up the pages. We are grabbing the
    content from Dot Net Nuke and putting it into Dreamweaver 8.0.2.
    Then we are manually cleaning out things like:
    <?xml:namespace prefix = o ns =
    "urn:schemas-microsoft-com:office:office" />
    and
    <P class=MsoNormal style="MARGIN: 0in 0in 0pt"
    align=left>
    We are using the Find and Replace funtion in Dreamweaver to
    clean out these commands, but I know from the documentation, there
    is an easier way to clean these pages.
    Bottom Line: Since the pages are dynamically built, I know I
    have to grab the page content and put it in Dreamweaver manually
    and then put it back in DNN, but I am trying to find a way (using
    Regular Expressions or something) to look for all the little
    variances of MSO, <?XML, etc. in a straight shot. I would like
    to find a way to use a wild card to look for all tags that have MSO
    or Microsoft or ?XML in them and then replace them with a null
    value. From what I can tell, the Find would have to use a wildcard
    because the advanced find features don't carry what I am looking
    for. Something like Find \<?xml * [<-wildcard] to \> to
    grab the entire tag. The Find tag command doesn't work because the
    tags I need aren't listed. Also, because the content is dynamic, I
    can't do a Fins and Replace against the entire site for these
    commands, but it would be nice to "Find" all of these items with a
    single pass since the "Replace" value is always null.
    The wildcard syntax and multiple Find instances are the main
    questions. The wildcards seem to be character or space specific.
    Sorry for the long explanation - I just don't want to waste
    anyone's time typing responses to things I've already tried to do.
    Thanks in advance for any help. This is my first time back in
    the forums in about 4 years.

    sadamec1 wrote:
    > Well David, you Findmaster - it worked! (At least it
    found and highlighted the
    > code). Now, I need to dig through what you sent me and
    compare it against my
    > regular expression definitions to find out how to grab
    the rest of these
    > phrases. You're the best. Thank you!
    Glad that it did the trick. Just to help you understand what
    I did,
    there are two main sections, as follows:
    <\?xml[^>]+>
    and
    <[^>]+(?=class=Mso)[^>]+>
    They are separated by a vertical pipe (|), so they simply act
    as
    alternatives.
    The first one searches for <?xml followed by anything
    except a closing
    bracket until it reaches the first closing bracket.
    The second one is more complex. It begins with this:
    <[^>]+
    This simply looks for an opening bracket followed by anything
    other than
    a closing bracket. What makes it more intelligent is the next
    bit:
    (?=class=Mso)
    This does a forward search for "class=Mso". It's then
    followed by this
    again:
    [^>]+>
    That finds anything except a closing bracket followed by a
    closing bracket.
    The bit that you need to experiment with is (?=...). It's
    technically
    called a "forward lookaround". The effect is that the second
    half of the
    regex finds <....class=Mso....>.
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • Batch Edit Multiple HTML files | Find and Replace

    Hi,
    I would like to use Automator to automate (I know that sounds redundant) the following process.
    1. Take a group of html files
    2. Open each file so it can find and replace the script of any image folders
    Example:
    Change: img src="home_files/photo.jpg" to img src="images/photo.jpg"
    3. Save & Close each file
    I assume this this would have to be done in either AppleScript or Cocoa.
    Any help would be greatly appreciated.
    Thanks in advance.

    you most definitely don't need Cocoa for something like that. if all you need is a straightforward search and replace in a bunch of html files you can easily do this with a shell script. If you need some more involved search and replace you have to explain what it is exactly that you want.
    to automate direct search and replace you can do something along the following lines in automator
    1. get selected finder items (this will select your html files)
    2. run shell script action with input passed as arguments
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    for f in "$@"
    do
    fl=`echo "$f"`
    sed 's%home_files/photo.jpg%images/photo.jpg%g' $f > /users/$USER/.tmp.txt
    cat /users/$USER/.tmp.txt > "$fl"
    done
    rm /users/$USER/.tmp.txt</pre>

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Find and replace characters in file names

    I need to transfer much of my user folder (home) to a non-mac computer. My problem is that I have become too used to the generous file name allowances on the Mac. Many of my files have characters such as "*" "!" "?" and "|". I know these are problems because they are often wild cards (except the pipe). Is there a way that I can do a find and replace for these characters?
    For example, search for all files with an "*" and replace the "*" in the file name with an "@" or a letter? I don't mind having to use the terminal for this (I suspect it will be easier).
    Is this possible? Does anyone have any suggestions?
    Thank you in advance for any help you may be able to provide.
      Mac OS X (10.4.8)  

    Yep.
    "A Better Finder Rename" is great for batch file renaming.
    http://www.versiontracker.com/dyn/moreinfo/macosx/11366
    Renamer4mac may be all you need.
    Best check out VersionTracker. In fact everybody should have this site bookmarked and visited daily.
    http://www.versiontracker.com/macosx/

  • A Script to Find and Replace Layer Names

    Are there any scripts to find and replace layer names?
    There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers.
    The illustrator version of this script only allows sequential numbering: It doesn't offer find and replacing of words.
    Ideally, it would be great if there was something that could do multiple find and replaces in one go:
    (e.g.
    You have layers like this Car, Dog, Bat
    You enter: car(Option1), dog(Option2), Bat(Option3)
    Your layers then become: Option1, Option2, Option3).

    big_smile, that's a very good start! Step 1 of Learning How To Script is indeed, adjusting an existing simple script to make it do more complicated things. (And usually then "break something", which is also a required part of the process.)
    You are correct in your observation this is repetitive stuff. For one or two different items that wouldn't be a problem, but in longer lists you soon get lost.
    The usual way of working with find-change lists is to build an array:
    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    The general idea is to loop over all names, check if the current layer name is "layernames[i][0]" (the left column) and if so, rename it to "layernames[i][1]" (the right column). If you know how to write a loop in Javascript, then you can implement this right away.
    However ..
    A more advanced way to do this doesn't even need loop to over all layernames -- instead you can immediately "get" the correct name per layer! It's magic! Almost!
    The trick is to use a Javascript object instead of an array. Javascript objects are nothing special; Illustrator's 'layers' is an array of objects, and each object "layer" has a property "name", whose value you can read and set. What I do here is create a new object, where the "name" part is the original layer name and its value is the new layer name. All you need to check for per each layer is if there is a property 'object.originalLayerName', and if so, assign its value to that layer name.
    This looks a bit like the array above, except that (1) you use {..} instead of [..] to create an object, and (2) you add "name:value" pairs instead of "value" only (actually, the 'name' of a value in an array is simply its number).
    So this is what it looks like:
    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
    'FHairBowlBoy *Hair':'Hairboy1',
    'FHairCurlyafroBoy *Hair':'Hairboy2',
    'FHairSpikyBoy *Hair':'Hairboy3'
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    //Set up Variable to access layer name
    var currentLayer = app.activeDocument.layers[i];
    if (layernames[currentLayer.name])
      currentLayer.name = layernames[currentLayer.name];
    Enjoy!

  • How to create mail merge(feature in word) in adobe pdf and programmatically find and replace these t

    I am very new to adobe.I am required to do the following and am very confused.The scenario is as follows:
    I am required to create a letter template (using adobe designer) where name and few other details will be tags(which needs to be replaced by actual values according to the particular customer later on).We can create such a feature in word using mail merge feature available there.How do we do the same in pdf??Can it be done using adobe designer 7.0???If so,how?
    After I create this template,I am required to write a javascript or a VB program to access this pdf template and find and replace these tags with the actual values and generate a pdf document.Somebody told me that this is to be done using adobe document server(ADS). Can this be done??If so,how?If not what is the alternative product in adobe?
    There are so many adobe products that i am totally at sea and not able to figure out which to use and how.
    Please help me at the very earliest.
    Thanks in advance.
    regards,
    Sowmya

    Let me thank u for a prompt reply but I guess I still need ur help before I accomplish what I set out to do.
    As per your reply I used Forms API in my vb program and it is accessing the fields but I am not able to change the property of the fields.
    I created the pdf form using adobe designer 7.0 and have created a floating field which I want to populate using my code.This is invisible in the pdf template but I when I set the value for it using vb code I need to change its property to visible.
    But when I try to change the "NoViewFlag" property, I get an error as follows:
    Runtime error'-2147220988(80040204)
    Document's Security Settings prohibit the operation being performed
    Please give your suggestions.
    2.Another question is how do I differentiate floating text field and ordinary text field in vb code because the type of both is displayed as text ??
    Thanks again.
    regards,
    Sowmya
    I am putting my code below for ur viewing.

  • Dreamweaver CS6 "Find and Replace" not working

    Since I've started working in DW CS6 I've noticed that the Find and Replace feature isn't working completely.
    E.g. If I select a block of code, then open Find and Replace, tell it to find "<br />" and replace it with "</li>" it only replaces the first instance. The rest of the <br />'s are still <br />'s.
    Is this happening to anyone else? I may have to switch back to CS5.

    bracdiver wrote:
    ** ANSWER/Workaround
    Change the selection in the 'Search:' dropdown from the default 'Source:'  to 'Text' or 'Text (Advanced)' and you will get the desired result.
    bracdiver, your post may be useful in some examples, like the ones I posted above. However, this does not work in my intended example below (which is source code specific), where the actual source code needs to be replaced:
    Sample
         <p>These are true or false questions. Place your answer on the blank under each question.</p>
    <ol>
        <li>There are twelve in a baker's dozen</li>
        <li>35% of people are going to school.</li>
        <li>There are seven books in the Harry Potter series.</li>
        <li>The longest running play is "Les Miserables"</li>
        <li>There is no blank under this question. <i>Answer beside this question instead.</i></li>
    </ol>
    Using these options
    Find in: Selected Text (first four list items)
    Search: Source code:
    Find: </li>
    Replace: <br />___________________</li>
    Options enabled: Match case
    Desired output:
    <p>These are true or false questions. Place your answer on the blank under each question.</p>
    <ol>
        <li>There are twelve in a baker's dozen<br />___________________</li>
        <li>35% of people are going to school.<br />___________________</li>
        <li>There are seven books in the Harry Potter series.<br />___________________</li>
        <li>The longest running play is "Les Miserables"<br />___________________</li>
        <li>There is no blank under this question. <i>Answer beside this question instead.</i></li>
    </ol>
    CS6 DW output:
    <p>These are true or false questions. Place your answer on the blank under each question.</p>
    <ol>
        <li>There are twelve in a baker's dozen<br />___________________</li>
        <li>35% of people are going to school.</li>
        <li>There are seven books in the Harry Potter series.</li>
        <li>The longest running play is "Les Miserables"</li>
        <li>There is no blank under this question. <i>Answer beside this question instead.</i></li>
    </ol>
    Using your workaround (with 'Inside Tag' option set to li), this will not work as does not change any text at all.

Maybe you are looking for

  • "Copy to Play Order" not working

    Hello, I have been using my new iPod for a couple of weeks now and it is working very well as is iTunes. My issue is with trying to get certain albums/playlists to play in a certain order on my iPod. To cut to the chase: I have my iPod set to shuffle

  • Document Display

    Hi Gurus I have the following Requirements, Whenever Employee Submits documents from portal in the format of attachments we need to store it in DMS    server  with help of RFC or any other Option with option of identification no(e.g. Pernr,infotype n

  • Photo Merge now creates straight line merges...

    In the old days when I did a Photo Merge from Bridge I would find that the merged document would have multiple layers with masks that had quite irregular edges (as expected) and therefore smooth fills.  Ultimately PS produced really good panoramas wi

  • Passing  objects as paramenters in RPC

    Hi All! I am calling a Remote procedure with paramenters types(accountNo in varchar2, accountBalance out << Type object>>). While using Dynamic sql "execute immediate <<user name>>.<<procedure name>>@<<databaselink>>(:x,:y) using option accNo,out bal

  • Help requested with 645 Ultra-C with a PCI ATA/133 card fitted

    I'm new here, so please bear with me if this plea for help is short of info :- I built my PC 5 years ago, using a 645 Ultra-C board ( MS-6547 2.00 ) and have had no problems since - till now. I recently installed a PCI ATA/133 card, mainly to be able