Find / replace within applescript

I am working on a script to change the file path of a hyperlink
tell application "Adobe InDesign CS5"
   tell active document
       set listOfButtons to every button
       repeat with thisButton in listOfButtons
           tell thisButton
               set FilePath to file path of goto anchor behaviors
               return FilePath
           end tell
       end repeat
   end tell
end tell
the answer I get is : {"Content:Pricelist:Catalog:Interactief:BE:21_ES_Ventielen_be_dig.indd"}
Now I want to change "BE" into "FR" and "be" into "fr"
(in the future I will have to change it to other suffix, so it would be nice if this can be included as well )
Can anyone help we to do this?

Mark,
I had to change the final command to
set file path of goto anchor behaviors of thisButton to NewPath
I changed the script a little bit because I noticed that "to items 1 thru 4" didn't work on all the files
this is the new script:
tell application "Adobe InDesign CS5"
          tell active document
                    set listOfButtons to every button
                    repeat with thisButton in listOfButtons
                              tell thisButton
                                        set FilePath to file path of goto anchor behaviors
                                        set ASTID to AppleScript's text item delimiters -- Store settings
                                        set ButtonPath to (item 1 of FilePath) as string
                                        set AppleScript's text item delimiters to ":" -- Everything splits at this character
                                        set PathBits to text items of ButtonPath -- Slice it…
                                        repeat with i from 1 to count PathBits
                                                  considering case
                                                            if item i of PathBits is "NL" then
                                                                      set item i of PathBits to "FR"
                                                            end if
                                                  end considering
                                        end repeat
                                        set TempPath to items 1 thru i of PathBits as string
                                        set AppleScript's text item delimiters to "_" -- Now everything splits at this character
                                        set DocBits to text items of TempPath
                                        repeat with j from 1 to count DocBits
                                                  considering case
                                                            if item j of DocBits is "nl" then
                                                                      set item j of DocBits to "fr"
                                                            end if
                                                  end considering
                                        end repeat
                                        set NewPath to items 1 thru j of DocBits as string
                                        set file path of goto anchor behaviors of thisButton to NewPath
                              end tell
                    end repeat
          end tell
end tell
Now I just have to make it possible to do this for all the buttons in a document. First I want to make it possible to choose the original path and doc...
This is what I've got at this moment:
tell application "Adobe InDesign CS5"
          tell active document
  --choose path
                    set PathOrigArray to {"BE", "FR", "NL", "EX", "DE"}
                    set PathOrigID to choose from list PathOrigArray with prompt "Selecteer de map met originele bestanden." OK button name "Update book" without multiple selections allowed
                    set PathNewArray to {"FR", "NL", "EX", "DE"}
                    set PathNewID to choose from list PathNewArray with prompt "Selecteer de map met nieuwe bestanden." OK button name "Update book" without multiple selections allowed
  --choose doc
                    set DocOrigArray to {"be", "fr", "nl", "ex", "de"}
                    set DocOrigID to choose from list DocOrigArray with prompt "Selecteer de suffix van de originele bestanden." OK button name "Update book" without multiple selections allowed
                    set DocNewArray to {"fr", "nl", "ex", "de"}
                    set DocNewID to choose from list DocNewArray with prompt "Selecteer de suffix van de nieuwe bestanden." OK button name "Update book" without multiple selections allowed
                    set listOfButtons to every button
                    repeat with thisButton in listOfButtons
                              tell thisButton
                                        set FilePath to file path of goto anchor behaviors
                                        set ASTID to AppleScript's text item delimiters -- Store settings
                                        set ButtonPath to (item 1 of FilePath) as string
                                        set AppleScript's text item delimiters to ":" -- Everything splits at this character
                                        set PathBits to text items of ButtonPath -- Slice it…
                                        repeat with i from 1 to count PathBits
                                                  considering case
                                                            if item i of PathBits is PathOrigID then
                                                                      set item i of PathBits to PathNewID
                                                            end if
                                                  end considering
                                        end repeat
                                        set TempPath to items 1 thru i of PathBits as string
                                        set AppleScript's text item delimiters to "_" -- Now everything splits at this character
                                        set DocBits to text items of TempPath
                                        repeat with j from 1 to count DocBits
                                                  considering case
                                                            if item j of DocBits is DocOrigID then
                                                                      set item j of DocBits to DocNewID
                                                            end if
                                                  end considering
                                        end repeat
                                        set NewPath to items 1 thru j of DocBits as string
                                        set file path of goto anchor behaviors of thisButton to NewPath
                              end tell
                    end repeat
          end tell
end tell
The problem is that he doesn't change the items... what I am doing wrong?

Similar Messages

  • Is there a way to Find & Replace within a selection?

    I looked in the User Guide, but I didn't find any information on how to Find & Replace just within selected text. I can see how to do it for the entire document or do it one instance at a time. Is there a trick I'm missing, or is this a missing feature?

    Hey Chuck,
    I opened Pages and used its help menu and came up with this. It does not specifically mention anything about choosing just 1 paragraph or text box, but I hope it helps you none the less.
    +Finding and Replacing Text+
    +You can find every instance of a word or phrase in your document, and optionally change it to something else.+
    +Here are ways to find and replace text:+
    +Choose Edit > Find > Find, click Simple or Advanced to set up find/replace criteria, and then click a button to conduct find/replace operations.+
    +Simple: In the Find field, type the text you want to find, and type any text you want to replace it with in the Replace field.+
    +Advanced: In addition to typing Find and Replace text, you can set up additional find/replace criteria.+
    +Replace All: Automatically conducts the find/replace operation without your review.+
    +Replace: Replaces the current selection with the replacement text.+
    +Replace & Find: Replaces the current selection with the replacement text and immediately finds the next occurrence of the Find text.+
    +Next or Previous: Finds the next or previous occurrence of the Find text.+
    +Use the other commands on the Edit > Find submenu.+
    +Find Next or Find Previous: Finds the next or previous occurrence of the current Find text.+
    +Use Selection for Find: Finds the next occurrence of the selected text.+
    +Jump to Selection: Displays the selected text when it’s not currently in view.+
    Adam

  • Using AppleScript with saved Find/Replace Queries

    Hello all,
    I have been trying to create a script with AppleScript to apply a sequence of pre-saved queries created in the find/replace dialog in InDesign CS5 to all open documents.
    I am fairly new to AppleScript and I'm still learning, but this seems like a task it should be able to do? The queries are named 01, 02, 03 etc and I'd like to apply them in order to adjust the text formatting in all open documents.
    Is this the best way to approach the problem or do I need to reproduce the queries within the script?
    Many thanks in advance for any advice.

    Is this the best way to approach the problem or do I need to reproduce the queries within the script?
    Putting them in the script is much more robust. Have you looked at the sample script FindChangebyList?

  • Find & replace part of a string in Numbers using do shell script in AppleScript

    Hello,
    I would like to set a search-pattern with a wildcard in Applescript to find - for example - the pattern 'Table 1::$*$4' for use in a 'Search & Replace script'
    The dollar signs '$' seem to be a bit of problem (refers to fixed values in Numbers & to variables in Shell ...)
    Could anyone hand me a solution to this problem?
    The end-goal - for now - would be to change the reference to a row-number in a lot of cells (number '4' in the pattern above should finally be replaced by 5, 6, 7, ...)
    Thx.

    Hi,
    Here's how to do that:
    try
        tell application "Numbers" to tell front document to tell active sheet
            tell (first table whose selection range's class is range)
                set sr to selection range
                set f to text returned of (display dialog "Find this in selected cells in Numbers " default answer "" with title "Find-Replace Step 1" buttons {"Cancel", "Next"})
                if f = "" then return
                set r to text returned of (display dialog "Replace '" & f & "' with " default answer f with title "Find-Replace Step 2")
                set {f, r} to my escapeForSED(f, r) -- escape some chars, create back reference for sed
                set tc to count cells of sr
                tell sr to repeat with i from 1 to tc
                    tell (cell i) to try
                        set oVal to formula
                        if oVal is not missing value then set value to (my find_replace(oVal, f, r))
                    end try
                end repeat
            end tell
        end tell
    on error number n
        if n = -128 then return
        display dialog "Did you select cells?" buttons {"cancel"} with title "Oops!"
    end try
    on find_replace(t, f, r)
        do shell script "/usr/bin/sed 's~" & f & "~" & r & "~g' <<< " & (quoted form of t)
    end find_replace
    on escapeForSED(f, r)
        set tid to text item delimiters
        set text item delimiters to "*" -- the wildcard 
        set tc1 to count (text items of f)
        set tc2 to count (text items of r)
        set text item delimiters to tid
        if (tc1 - tc2) < 0 then
            display alert "The number of wildcard in the replacement string must be equal or less than the number of wildcard in the search string."
            error -128
        end if
        -- escape search string, and create back reference for each wildcard (the wildcard is a dot in sed) --> \\(.\\)
        set f to do shell script "/usr/bin/sed -e 's/[]~$.^|[]/\\\\&/g;s/\\*/\\\\(.\\\\)/g' <<<" & quoted form of f
        -- escape the replacement string, Perl replace wildcard by two backslash and an incremented integer, to get  the back reference --> \\1 \\2
        return {f, (do shell script "/usr/bin/sed -e 's/[]~$.^|[]/\\\\&/g' | /usr/bin/perl -pe '$n=1;s/\\*/\"\\\\\" . $n++/ge'<<<" & (quoted form of r))}
    end escapeForSED
    For what you want to do, you must have the wildcard in the same position in both string. --> find "Table 1::$*$3", replace "Table 1::$*$4"
    Important, you can use no wildcard in both (the search string and the replacement string) or you can use any wildcard in the search string with no wildcard in the replacement string).
    But, the number of wildcard in the replacement string must be equal or less than the number of wildcard in the search string.

  • Batch code for running a find/replace all on multiple files within a source floder/directory

    What I need is a Batch source code that will open all files in a folder/directory and run a find and replace_all query within them and then save all the files.  The files were created in Illustrator and saved using the Scene7 FXG format extension.    These files will be uploaded into Scene7 as a group after the find and replace macro/query is run on the code.  The same find and replace query will be the same for all the files.  Basically this function or batch process  will save time in setting the same parameters all at one time instead of having to set the parameters individually in scene7.
    a source code sample of the find/replace module macro might be              searchString:  s7:colorvalue="#FFFFFFFF" 
                                                                                                                          replaceString: s7:colorValue="#&txtclr;"
                                                                                                                          searchWhat   "FXG document"    
                                                                                                                             searchSource:  true,
                                                                                                                        useRegularExpressions:   true
    I have no problems creating batch files within Ai and PhotoShop but I have limited programming skills in how to create source code for manuipulating documents outside of those apps or in a OS invironment.
    I could probably come up witha simple program to do what i want for one document but i get lost when dealing with multiple documents in a source folder (prolbem is,  I will be dealing with thousands of documents not 100 or less)
    If anything which Adope cloud app would work best:  Dreamweaver or Edge code   (or just use my notepad)

    What I need is a Batch source code that will open all files in a folder/directory and run a find and replace_all query within them and then save all the files.  The files were created in Illustrator and saved using the Scene7 FXG format extension.    These files will be uploaded into Scene7 as a group after the find and replace macro/query is run on the code.  The same find and replace query will be the same for all the files.  Basically this function or batch process  will save time in setting the same parameters all at one time instead of having to set the parameters individually in scene7.
    a source code sample of the find/replace module macro might be              searchString:  s7:colorvalue="#FFFFFFFF" 
                                                                                                                          replaceString: s7:colorValue="#&txtclr;"
                                                                                                                          searchWhat   "FXG document"    
                                                                                                                             searchSource:  true,
                                                                                                                        useRegularExpressions:   true
    I have no problems creating batch files within Ai and PhotoShop but I have limited programming skills in how to create source code for manuipulating documents outside of those apps or in a OS invironment.
    I could probably come up witha simple program to do what i want for one document but i get lost when dealing with multiple documents in a source folder (prolbem is,  I will be dealing with thousands of documents not 100 or less)
    If anything which Adope cloud app would work best:  Dreamweaver or Edge code   (or just use my notepad)

  • How do you find and replace "within selected text" in a textedit document (version 1.8, mountain lion)

    In the textedit version on Snow leopard it was possible to search and replace within a peice of selected text only i.e. not the entire file. This was a very useful feature because you could select a paragraph and replace all occurences of word1 with word2 within that paragraph only! This feature appears to be missing from the mountain lion version of textedit (version 1.8). Or can anyone tell me how to do it ... ?

    Having 46 people view a post without replying is not unusual. Some people look at a question to see if it's something they'd like to know the answer to, and then come back  when it has eventually been answered.
    I'm not sure if you need to escape forward slashes in Dreamweaver's Find and Replace dialog box, but I normally do because both JavaScript and PHP normally use forward slashes as delimiters to mark the beginning and end of the regex like this:
    var pattern = /[A-Z]{4}/; // JavaScript
    $pattern = '/[A-Z]{4}/';   // PHP
    When a forward slash appears inside the regex, you need to escape it with a backslash to avoid confusion with the closing delimiter.
    As you have worked out, a capturing group is created by wrapping part of the regex in parentheses.
    If you want to match exactly 38 characters, you can use [\S\s]{38}. That includes spaces, newline characters, symbols, everything.
    If you're trying to find everything between two tags, you can do this:
    (<\/tag_name>)([^<]+)
    The closing tag is captured as $1 and everything up to the next opening tag is captured as $2.
    Learning regular expressions is not easy. I don't claim to be an expert, but I enjoy the challenge of trying to solve them. If you're interested in regular expressions, there are several books published by O'Reilly. "Mastering Regular Expressions" is the ultimate authority, but it's a difficult read (not because it's badly written, but because of the complexity of the subject). "Regular Expressions Cookbook" is very good. There's also a new "Introducing Regular Expressions", but I haven't read it.

  • Wildcards within AppleScript

    I'm generating HTML and CSS automatically from Scrivener, a Mac-only author's writing program (a very good one).
    I've got a lot of documents to process and I want to tweak the CSS beyond what Scrivener automatically generates, and at the same time make all documents adhere to a single standard. In order to make this happen I've created an AppleScript to work to run through the HTML text to do a stream of search and replace functions. So far, this works very well.
    However, there are some segments where the string between one predictable delimiter and another is unpredictable. What's called for is a wildcard to select all the text between the delimiters and replace it with something else.
    Someone elsewhere has said there's no syntax for wildcards within AppleScript. Not sure of the truth of that. What's the procedure to achieve my objective?
    Much appreciated.

    Ah - you are wanting to extract HTML elements. This is a little bit different than wildcards and substrings, and dropping some script snippets into an application tell statement. There are some existing scripts out there for extracting HTML, as well as those that read text files. BBEdit is also scriptable, so I think this wound up being a little more difficult than it needed to be. Anyway, now that I know more about what you are wanting to do, give the following script a try - I didn't know anyone else used a version of BBEdit as old as mine (TextWrangler works too).
    The following script takes the text of the front BBEdit window, extracts the HTML elements specified, and creates a new window with the results:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 335px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on run
    tell application "BBEdit 6.5.3"
    get the text of the front window
    my GetHTMLElements(the result, "<script", "</script>", false)
    set text of (make new window) to the result as text
    end tell
    end run
    to GetHTMLElements(SomeText, OpenTag, CloseTag, ContentsOnly)
    return a list of the specified HTML elements in SomeText
    parameters - SomeText [text]: the text to look at
    OpenTag [text]: the opening tag (can be a partial)
    CloseTag [text]: the complete closing tag
                                ContentsOnly [boolean]: return just the contents, or the entire element
    returns [list]: a list of the HTML elements found - {""} if none
    set TextBuffer to SomeText as text
    set CurrentOffset to 1 -- the current offset in the text buffer
    set ElementList to {} -- the list of elements found
    try
    repeat
    set Here to offset of OpenTag in (text CurrentOffset thru -1 of TextBuffer) -- start of opening tag
    if Here is 0 then exit repeat -- not found
    set CurrentOffset to CurrentOffset + Here
    set CurrentTag to CurrentOffset - 1 -- mark the start of the element
    if OpenTag does not end with ">" then -- find the close of the tag
    set Here to offset of ">" in (text CurrentOffset thru -1 of TextBuffer) -- end of opening tag
    if Here is 0 then exit repeat -- not found
    set CurrentOffset to CurrentOffset + Here
    end if
    set Here to CurrentOffset
    set There to offset of CloseTag in (text CurrentOffset thru -1 of TextBuffer) -- end tag
    if There is 0 then exit repeat -- not found
    set CurrentOffset to CurrentOffset + There - 2
    set There to CurrentOffset
    if ContentsOnly then
    set the end of ElementList to text Here thru There of TextBuffer & return
    else
    set the end of ElementList to text CurrentTag thru (There + (length of CloseTag)) of TextBuffer & return
    end if
    end repeat
    on error ErrorMessage number ErrorNumber
    if (ErrorNumber is -128) or (ErrorNumber is -1711) then -- nothing (user cancelled)
    else
    activate me
    display alert "Error " & (ErrorNumber as string) message ErrorMessage as warning buttons {"OK"} default button "OK"
    end if
    end try
    if ElementList is {} then set ElementList to {""}
    return ElementList
    end GetHTMLElements
    </pre>

  • Microsoft Word API for Mac OS: Troubleshooting the Find/Replace function

    In my previous topic at
    http://discussions.apple.com/thread.jspa?threadID=2623068&tstart=0
    we found out the way to connect to the Ms-Word from Objective-C through ScriptingBridge.
    The connection works and the given text can be found and replaced using the method executeFindFindText: Although it generates exception and I am forced to put it in @try block and then continue with everything else in @catch.
    There is another, more important problem: the WordFind class does not seem to "give feedback" i.e. I could not find the way to programatically find out whether my find/replace was successfull, nor could I set WordFind object properties prior to running.
    The Class WordFind has many properties e.g.
    @property (copy) NSString *content; // Returns or sets the text in the find object.
    @property (readonly) BOOL found; // True if the search produces a match.
    @property BOOL matchWholeWord; // Returns or sets if the find operation locates only entire words and not text that's part of a larger word.
    I tried to set the property "matchWholeWord" or read the properties "found" and "content" but in vain.
    As I understand, the property "found" should be the key component in my process because it should
    return the BOOL value I need.
    What am I doing incorrectly? Any suggestions?
    Here is the final code:
    #import <Cocoa/Cocoa.h>
    #import "Word.h"
    int main(int argc, char * argv[])
    if(NSApplicationLoad())
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    wordApp=[SBApplication applicationWithBundleIdentifier:@"com.microsoft.Word"];
    if([wordApp isRunning])
    WordDocument *activeWordDoc=[wordApp activeDocument];
    WordTextRange *allTextRange=[activeWordDoc textObject];
    WordFind *findObj=[allTextRange findObject];
    NSString findText=@"FirstText";
    NSString *replaceText=@"SecondText";
    [findObj setMatchWholeWord:YES];
    NSLog(@"WholeWord: %i", [findObj matchWholeWord]);
    @try
    [findObj executeFindFindText:findText
    matchCase:NO
    matchWholeWord:NO
    matchWildcards:YES
    matchSoundsLike:NO
    matchAllWordForms:NO
    matchForward:YES
    wrapFind:WordE265FindContinue
    findFormat:NO
    replaceWith:replaceText
    replace:WordE273ReplaceAll];
    @catch(NSException * e){
    NSLog(@"Search Found:%i",[findObj found]);
    NSLog(@"Search Content:%@",[findObj content]);
    [pool drain];
    return 0;

    DavidMan wrote:
    So, what is your suggestion?
    Do it in pure AppleScript.
    Whom to complain? Microsoft or Apple?
    I'm not sure. All this stuff was new with Office 2008. It might work better with Office 2011. I would definitely ask on the Mac Office forum to see if anyone there knows any more: http://www.officeformac.com/productforums/

  • How to find & replace in Javascript code?

    Hi all!
    I hope that this turns out to be an easy question! We recently updated several forms (about 50 of them) to alter a select set of field names per customer requirements. However, it turns out that one of these fields is a key field and is referenced in one or more places by JavaScript within the PDF.
    In Acrobat 6 I'd select the option to edit all scripts which would give me a big document with all of the Javascript within the PDF. I could then do a find/replace on the code and save it. Now, using Acrobat Pro 9, I cannot find anything like this. Please don't tell me that I have to search through all of the different form fields and PDF objects to find all of the script pieces tied to objects or events! I'm really, really hoping that there is an easier way to do this since right now I'm out of ideas and really don't want to have to sift through all of the objects in over 50 PDF documents.
    Thanks in advance for pointing me in the right direction!

    Talk about not being able to see the forest for all the trees! I can't believe that I missed that -- I spent quite a while looking all over before posting. *sigh*
    The exact menu sequence (for those interested) is Advanced -> Document Processing -> Edit All JavaScripts...  That is exactly what I needed. Thanks!!!

  • TextEdit - Save preset for Find & Replace?

    Hey, all!
    Quick question... is there any way to save a preset for a Find & Replace function in the native TextEdit app in Mac OS?  I do a routine F&R using a long "Insert Pattern" (I haven't had time to learn Regular Expressions yet in order to use another app)... I'd love to be able to just do a quick F&R on a text file instead of having to build the string every time.
    Possible?
    Thanks!
    -=R=-

    thnx Tom - yes, all the text is there, editable and I can add new text to it and save. But I can't search it using Find, trying unique words I see right there in the first few paragraphs atop the file. Then tried 'and' which only found two in the whole large file, embedded within a block of what I guess are formatting characters also bunched up at the bottom of the file below my original text.
    Oops, I just realized now that this file is not actually an RTF, its a Word 97 .doc -- which either means I converted it at some point in TextEdit, or its the original .doc file I started long ago with my ancient Microsoft Word that I used before going to Mavericks (was able to use Word in Snow Leopard but is no longer supported in Mavericks, I think its referred to as a 'PowerPC' application.) 
    What should I do? Would converting it to an RTF file help, if so how do I do that?
    thanks!
    Randy

  • RE: (forte-users) search and replace within aTextData

    Welll, you're both right. The MoveToChar makes it unnecessary (if a little
    sloppy) to MoveNext as long as you've changed the character. thus,
    outStr: TextData = new;
    outStr.SetValue(inStr);
    while (outStr.MoveToChar(' ')) do
    outStr.ReplaceRange('_', outStr.Offset, outStr.Offset+1);
    end while;
    return outStr;
    works fine to change blanks to underscores.
    Regards,
    David
    -----Original Message-----
    From: Campbell, Dave [mailto:DCampbellpurolator.com]
    Sent: Friday, 14 January 2000 0:58
    To: 'Matthew Middleton'
    Cc: kamranaminyahoo.com
    Subject: RE: (forte-users) search and replace within a TextData
    If you do not use the MoveNext method to skip beyond the "found" character,
    a subsequent invocation of MoveToChar will find the same character, located
    at exactly the same offset.
    If there is no match, MoveToChar returns FALSE and the current offset does
    not change.
    ----- Original Message -----
    From: Matthew Middleton <mathew.middletonlawpoint.com.au>
    To:kamranaminyahoo.com
    Unless I'm missing something here...you needn't go through every
    character...use MoveToChar()...as per Help...
    while (TextdataObj.MoveToChar (' ')) do
    end while;
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

    Why not this:
    while myText.moveToString(' ') do
    myText.ReplaceRange('-', myText.Offset, myText.Offset+1);
    end while;
    or if you prefer verbosity:
    while myText.moveToString(source=' ') do
    myText.ReplaceRange(source='-', startOffset=myText.Offset,
    endOffset=myText.Offset+1);
    end while;
    -----Original Message-----
    From: FatchJeBAM.com [mailto:FatchJeBAM.com]
    Sent: Wednesday, January 12, 2000 2:51 PM
    To: Troy.Burnsvacationclub.com; kamranaminyahoo.com
    Subject: RE: (forte-users) search and replace within a TextData
    How about this?? May have to play with start/end on ReplaceRange as I
    didn't really test this
    Anybody got a better way??
    -- replace space with underscore
    For x in 1 to myTextdata.LengthToEnd() do
    If myTextData.IsSpace() then
    MyTextdata.ReplaceRange('_'. Startoffset=myTextdata.offset,
    endoffset=myTextdata.offset+1);
    End if;
    MyTextdata.MoveNext;
    End for;
    Jerry Fatcheric
    -----Original Message-----
    From: Burns, Troy [mailto:Troy.Burnsvacationclub.com]
    Sent: Wednesday, January 12, 2000 9:40 AM
    To: kamranaminyahoo.com
    Subject: (forte-users) search and replace within a
    TextData
    Hello all,
    I need to search within a textdata object, replacing all
    occurrances of a
    space
    with another character. Can you give a quick code example
    of how I would do
    this?
    Thanks in advance,
    Troy
    Troy Burns
    Marriott Vacation Club Intl.
    E-mail: troy.burnsvacationclub.com
    Phone: (941) 688-7700 ext. 4408
    For the archives, go to: http://lists.sageit.com/forte-users
    and use
    the login: forte and the password: archive. To unsubscribe,
    send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.sageit.com
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

  • Find+replace in all Pages files in a folder

    Hi,
    A simple question (?). I have a long manuscript which is a folder comprising several dozens of Pages documents. I would like to execute a find+replace command across all the individual documents (without having to open them all one by one...) I guess Applescript will be the answer, but I am not experienced in its use... Would there be a pre-existing script available? I have searched, but with no success.
    Many thanks.

    Ned is right... if the server can do it, let it.  Also - I only wish Flash had file system access on servers... but if they did - how would Adobe sell Flash Media Server?
    Google php filelist, php directory list, etc... you'll find lots of useful scripts.

  • How can I Print "find/replace" results?

    I use "find/replace" to locate all of the jpegs currently used within a site.  How can I print the search results. Copu/paste doesn't work It would be useful to print the result as they can number in the hundreds for larger sites.. Writing down the results is a real pain.

    From the search panel, there is a small icon on the right hand side for saving your search as an xml file, click this and view the xml file in your browser then print from there.
    Paula,
    I don't think that icon / option exists in DW 8 or MX. 
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • Applying Bolds and Italics while doing a Find/Replace on Data Merged content

    Hi,
    Wonder if you kind knowledgeable folks can help me with a Find/Replace question.
    I am doing a data merge of a book contents into indesign, where my data merge file is a straightforward text csv file which is tab delimited. I have two (almost similar) things I would like to do to specific parts of the text but don't know how to achieve this. 
    -  Firstly, I would like to preserve words/sentences with an 'italic' form but this is obviously lost in a csv file.  Is there anyway I can mark these words in order that a find/replace can make this word italics.  Im hoping there is a solution which resembles something like this;
    eg.  Book content is "The Word Italic needs to be adjusted".
    Original content is amended to be "The Word $Italic$ needs to be adjusted", so that a dollar sign encapsulates the word to be made Italic.
    Then I am able to data merge the csv file and somehow do a find/replace of words/sentences which are encapsulated by the dollar sign.  Thus, doing a find/replace of all words/sentences which satisfy this condition and then apply italics to all words between the dollar signs.
    - My other issue is I am using the '|' character in my text to determine the paragraph seperators.  I then do a find/replace after importing the text to replace all instances of '|' to the paragraph seperator (a kind of $ symbol, a representative character from the pop-up menu to the right of the Change To box). This works fine, but I'd like to make the paragraph seperator to be a BOLD format so that it can distinguish better the seperating sections of text.
    But this is different from my 'italics' issue above since I am trying to apply a BOLD format to the 'Change to' character, rather than something which exists in my original csv.
    Hope I make sense but I'd be happy to provide screenshots etc (when I get home )
    Best Rgds
    L

    two solutions.
    for the italic solution, i'd say the OP answered his own question with one exception - don't use dollar symbols, instead use = or another character which isn't reserved by GREP.
    the solution i would use for italics would be a GREP search once the merge is complete. have a look at the picture to see what i've done.
    the second solution: GREP styles.
    this assumes that the text will have a paragraph style assigned to it. make a character style called BOLD and within that style, the only thing to change is within basic character formats, make the font style bold. could even make the character another colour such as cyan so it is more easily idenfiable.
    next, go to the paragraph style options, go to GREP styles and match the following screengrab
    the advantage with a GREP style is that once the pipe symbol (|) is replaced, its bold GREP style character formatting is lost; and it means less post processing and no need for a second search of the text - it's all live.

  • Find & Replace

    I'm trying to get DW 8 to allow me to remove some of the
    "found" items before using the replace function to avoid having to
    open each file individually - but when I delete entries from the
    "found" list, on r-click I'm given 3 options:
    - Open File
    - Find & Replace
    - Clear Results
    The Find & Replace option takes me back to the original
    Find & Replace screen. With DW4 you have the option of deleting
    some of the "found" entries before pressing the "replace" button.
    Has DW really taken a backward step?

    I neevr used DW4, so I'm not certain how that worked. And it
    doesn't look like you can delete entries from the Search panel.
    You might use other techniques to limit your changes. Any
    folders or files that are cloaked will not be updated by the
    Replace. You can set cloaking for specific files or folders, or by
    file extension (on the Site panel). Or, you could select only the
    files you want to target and use the Selected Files in Site option
    of the Find In drop-down. Or, you could use the Replace button in
    the Find/Replace panel to go through the results one at a time,
    rather than using Replace All.
    If you are changing HTML tags or attributes, the Find/Replace
    options are very powerful.

Maybe you are looking for