Search text on RTF with lingo

dear all ...
can help me?..
I make glossary with RTF text because on RTF Text is easy to change content but can help me to make search text or word on RTF text with lingo..?
Thankyou

Changing the BG colour of a chunk of text is not easy. It can be done with some imaging-lingo hoop-jumping, or by having a pool of shape sprites that can be dynamically allocated, sized and positioned.
Place the following in a JavaScript typed #movie script:
function jsSearch (aString, aMatch) {
  var aPattern = new RegExp(aMatch, "gi");
  var found;
  var results = list();
  while((found = aPattern.exec(aString)) != null) {
    results.append(found.index);
  return results;
and this in a "regular" Lingo #movie script:
on mHighlightMatches aMember, aString
  -- error check inputs
  if ilk(aMember, #member) = 0 then
    aMember = member(aMember)
    if ilk(aMember, #member) = 0 then
      exit
    end if
  end if
  if stringP(aString) = 0 then aString = string(aString)
  if stringP(aString) = 0 then exit
  -- will only work with #text nmembers
  if (aMember.type <> #text) then exit
  aMember.color = rgb(0, 0, 0)
  len = length(aString)
  lMatchPositions = jsSearch(aMember.text, aString)
  if count(lMatchPositions) = 0 then
    alert "Search text not found"
  else
    repeat with aStart in lMatchPositions
      aMember.char[aStart..(aStart + len)].color = rgb(255, 255, 0)
    end repeat
  end if
end
and now your button script might look like:
on mouseUp me
  mHightlightMatches(member("text2"), member("text1").text)
end

Similar Messages

  • Indesign export text as rtf with links

    Hi,
    I have an indesign file with lot of math type equation are EPS as in links.
    Now I want extract the indesign file as rtf format. I know math type is not directly support the indesign. So I want to get the links name and delete the links from the indesign document. My script is getting the link name. I don’t know how to delete the links and place the link name the relevant position.
    my script is:
    for(var myLinkCounter = app.activeDocument.links.length -1 ; myLinkCounter > 0; myLinkCounter --)
        myLink = app.activeDocument.links.item(myLinkCounter);
                myLinkName=myLink.name;
                //alert(myLinkName);
                    if (myLinkName.indexOf("Eqn"))
    Please help me for further............
    Thanks
    M. Karthikeyan

    Hi Karthik,
    Please try the below JS code, i hope you expected this!
    var myDoc = app.activeDocument;
    var myLink = myDoc.links;
    for (i=myLink.length-1; i>=0; i--){     
         var myLinkitem = myLink[i];
         var myname = myLink[i].name;
         app.select(myLinkitem.parent);
         var mySel = app.selection[0];
         app.select(mySel.parent);
         mySel.remove();
         app.selection[0].contentType = ContentType.TEXT_TYPE;
         app.selection[0].contents = myname;
         //app.selection[0].fit(FitOptions.FRAME_TO_CONTENT);
    thx
    csm_phil

  • Search Text and Replace with Graphic InDesign CS3

    I will be working with an XML file to be reformatted in InDesign.
    Is there a plug-in or a way to global replace a character (e.g. "$") present in various places in the body text with a tiff image of similar size?
    Or is it possible for a web programmer to set it up so that when I import the XML file that InDesign will ask to re-link all occurrences with a graphic that I can specify?

    Place the graphic in your InDesign document. Copy it to the clipboard.
    Use find change and fill in the find field and click the flyout for the
    change field. Select ohter> clipboard contents unformatted.
    Bob

  • Can't include a reset button/process that cleans a search text field

    Hi all
    Using apex 3.0.1 on a XE edition
    In my app there's a report that displays a lot of records.
    I included an text field item, where user can type a search criteria, then i added a button called "search" which, when submitted, display the records where search criteria is included.
    Now, my problem is that i can't put a "reset" button, which, when submmitted, is supposed to clear the search text field, so the report display all records.
    I tried adding a branch that triggers when reset buttos is pressed, clearing cache of search text field. It didn't worked, search string keeps on showing on text field.
    Then i changed the process, instead of clearing cache, setting search text field item with a value of null. Didnt work either...
    Does anyone have a good example of thjis type of reset button???
    tnks in advance....
    Fernando

    yes Earl, i know it's pretty standard...but i got some trouble... anyway, i think it was just a "lapsus brutus" o' mine... It's solved now and here's what i did:
    I created a text field button (where search string will be typed), a "submit as Go" button, and a "submit as reset" button. Then i created an uncondicional branch to same page, then i created a Clear Cache for Item process, where the text field cache is cleared, conditioned when "submit as reset" button is pressed.
    That solved the problem, thnx very much for your help
    fernando

  • [CS2][JS] Search text & replace with inline Image

    I am working with a large layout with many entries. There is a text "placeholder" that I need to search for and replace with an inline image in that exact spot.
    I need to apply an Object Style to that image.
    There is a loop above this for each find/replace to perfom
    I have supplied samples to show what the variables will hold
    The following assumes that an Objectstyle named "image" exists
    //places the image
    app.changePreferences = null;
    findName = "OR-00014500-24-0000-1";
    fileName = "Ads:OR-00014500-24-0000-1:OR-00014500-24-0000-1.eps"
    myFinds = app.search(findName)
    for (j = myFinds.length - 1; j >= 0; j--) {
    app.select(myFinds[j]);
    app.place(fileName, false,{appliedObjectStyle:"image"});
    This doesn't apply the style to the placed object and I have tried many different ways to apply this in the properties.
    Any help would be appreciated.

    I've seem to hit another hurdle....
    The code works well for searching and replacing the images. It applies the style to the image, but these images are not inline they are anchored. I ended up with a nice stack of images in the same corner.
    Ok... I need to then apply styles based on the images that have been placed already..
    This works well for cycling through the pages and with a bit more will change the style...
    myDoc = app.activeDocument;
    pagecount = myDoc.pages.length;
    for ( page=0; page < pagecount; page++){
    if (myDoc.pages.item(page).textFrames.length != 0){
    app.select(myDoc.pages.item(page).textFrames.item(0));
    piccount = app.selection[0].rectangles.length;
    if (piccount != 0){
    for ( bob=0; bob < piccount; bob++){
    app.select(myDoc.pages.item(page).textFrames.item(0));
    app.select(app.selection[0].rectangles.item(bob));
    // Get geometric bounds
    // alert(app.selection[0].geometricBounds);
    // Get object Style
    // alert(app.selection[0].appliedObjectStyle.name);
    // Do more here....
    I can't use this though :(
    I need to determine how many images have already been placed on the page before placing the image in the search and replace....
    myFinds = app.search(replaceName)
    for (j = myFinds.length - 1; j >= 0; j--) {
    app.select(myFinds[j]);
    myStory = myFinds[j].parent;
    myIndex = myFinds[j].index;
    //This will change using a series of Case Switches
    // Here is where I need to find the page and run the previous script or something like it myStyle = app.activeDocument.objectStyles.item("image");
    app.place(fileName, false);
    myStory.characters[myIndex].pageItems[0].applyObjectStyle(myStyle);
    app.select(myStory.characters[myIndex].pageItems[0]);
    //alert(app.selection[0].appliedObjectStyle.name);
    What I need to do is kind of combine the two....
    But I can't seem to get the current page of the selected image....
    I could use the page by page script, but it moves the character anchor point of images and pushes them to the next page. This throws off the pretty layout I'm going for.
    What am I doing wrong here ?

  • Search text programatically with axAcroPDF control

    Hello,
    i want to use the axAcroPDF control to display PDF files inside my windows forms application. That's easy just put the control there and call LoadFile method. The control has methods to change page, hide toolbar etc... but not to search text. I want to search text, if possible matching exact phrase or not. I need to do that programatically, do you know how can i do that?

    Post only once.

  • Find caret position of search text in jEditorPane

    Hi All,
    I am looking for a way to find the Caret position in a jeditor pane for the search text that i supply. The Jeditor pain is setup for text/html and when i find the index of my search text "ANCHOR_d" in the jeditor pane is 27000 something but the caret position is 7495 how do you find the caret position of the search text ??
    Any help is appriciated.
    I am also looking into getting abnchoring to work in the jeditorpane html text but as of yet i have been unsuccessful.
    Kind Regards,
    Wurns

    Search the underlying document, not the editor pane. Play around with this example, which I threw together the other day for a somewhat similar problem with JTextPane involving newlines, and modified for your need.
    Note: Please do not program by exception.import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JButton;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    import javax.swing.text.Document;
    public class SearchEditorPane {
       JFrame frame = new JFrame ("Search JTextPane Test");
       String html = "<HTML><BODY><P>This is <B>some</B>" +
                    " <I>formatted</I>" +
                    " <FONT color=#ff0000>colored</FONT>" +
                    " html.</P>" +
                    "<P>This is a <FONT face=Comic Sans MS>" +
                    "comic <br>\n<br>\nsans ms</FONT> section</P><div>" +
                    "And this is a new division</div>" +
                    "</BODY></HTML>";
       JEditorPane editorPane = new JEditorPane ("text/html", html);
       JPanel panel = new JPanel ();
       JTextField textField = new JTextField (10);
       JButton button = new JButton ("Find");
       Document doc = editorPane.getDocument ();
       void makeUI () {
          editorPane.setText ("<HTML><BODY><P>This is <B>some</B>" +
                " <I>formatted</I>" +
                " <FONT color=#ff0000>colored</FONT>" +
                " html.</P>" +
                "<P>This is a <FONT face=Comic Sans MS>" +
                "comic <br>\n<br>\nsans ms</FONT> section</P><div>" +
                "And this is a new division</div>" +
                "</BODY></HTML>");
          button.addActionListener (new ActionListener () {
             public void actionPerformed (ActionEvent e) {
                // Programming by exception is BAD, don't copy this style
                // This is just to illustrate the solution to the problem at hand
                // (Sorry, uncle-alice, haven't reworked it yet)
                try {
                   Matcher matcher = Pattern.compile (textField.getText ())
                   .matcher (doc.getText (0, doc.getLength ()));
                   matcher.find ();
                   editorPane.setCaretPosition (matcher.start ());
                   editorPane.moveCaretPosition (matcher.end ());
                   editorPane.requestFocus ();
                } catch (Exception ex) {
                   JOptionPane.showMessageDialog (frame, "Not Found!\n" + ex.toString ());
                   //ex.printStackTrace();
          panel.add (textField);
          panel.add (button);
          panel.setPreferredSize (new Dimension (300, 40));
          frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
          frame.setSize (300, 300);
          frame.add (editorPane, BorderLayout.CENTER);
          frame.add (panel, BorderLayout.SOUTH);
          frame.setLocationRelativeTo (null);
          frame.setVisible (true);
       public static void main (String[] args) {
          SwingUtilities.invokeLater (new Runnable () {
             public void run () {
                new SearchEditorPane ().makeUI ();
    }db

  • Search text in all the labels in a panel (like control-F)

    hi,
    I have a Panel where I configure some preferences of the application. There ara about 200 preferences. (a preference is a JLabel plus a textfield/combobox/checkbox)
    I would like to know if someone has implemented something like control-F in browsers. The search should go through all the labels and highlight the label(s) that contain the text.
    thanks.

    You can use getComponents() method to get all components added to the Panel. Iterate through the array and check whether the current one is a JLabel instance. Then check JLabel's text and compare with the search string. If necessary label found highlight it (e.g. by changing text color or adding/removing colored line border). Then you can use the JLabel's bounds to make it visible in a scroll (if any).

  • How to change the width of textbox in Search Texts iview

    Hi, Experts,
         I creat a search texts iview with stardard configuration to search the data in the repository.
    The problem is that the width of textbox is too short. And the user will input more than 40 characters in the textbox.
       In this way, the users can't see all the information unless he put the mouse pointer in the textbox and drag it.
       Is there any stardard configuration in MDM or MDM Portal to increase the width of textbox?
      Regards,
      Youli

    Hi Youli,
    I tried this but seems like there is no property available to change this setting. As these iViews are standard shipped, we cannot modify the design or code.
    Regards,
    Jitesh Talreja

  • Search text files in a folder

    Im given a project to implement a text file search engine to search text files in a folder to find matches for a given text and display the path of containing files. Here have to implement all the data structures i use.In order to search matches for given text , first i have to separate txt files and subfolders in a given folder. But i cant think of a way to separate them. does anybody have a solution?
    Thanx!

    Can you try something like this? This lists all the directories and their sub-directories along with the files. Displays the files with paths too.
    public class FileSearch {
         private static final String PATH = "C:\\temp";
              public static void main(String[] args){
                   File file = null;
                   String[] contents = null;               
                   file = new File(PATH);
                   contents = file.list();
                   for(String fileDir : contents){
                        file = new File(PATH+"\\"+fileDir);
                        if(file.isDirectory()){
                             System.out.println("["+file+"]");
                             listDirectory(file);
                        else{
                             System.out.println("     "+file);
              public static void listDirectory(File theFile){
                   String[] dirContents = null;
                   String path = theFile.getAbsolutePath();
                   if(theFile.isDirectory()){
                        dirContents = theFile.list();
                        for(String newFile : dirContents){
                             File dirFile = null;
                             dirFile = new File(path+"\\"+newFile);
                             if(dirFile.isDirectory()){
                                  System.out.println("["+dirFile+"]");
                                  listDirectory(dirFile.getAbsoluteFile());
                             else{
                                  System.out.println("     "+dirFile);
                   else{
                        System.out.println("     "+theFile);
         }

  • [CC] Search&Replace: Bug only with Regular Expressions

    Can you confirm the following behaviour/bug?
    Steps to reproduce:
    1 Create a new document in DW CC
    2 Enter that text in the source code view:
    <p>&euro;</p>
    3 Open Search&Replace
    Field Search in: Current document
    Field Search: Text
    Field Search (3rd Field): €
    Start Search
    Result: As expected the "€" is found.
    4 [x] Regular Expressions
    Start Search
    Result: "€" isn't found
    Can you reproduce that?
    Do you regard that as a bug like me?
    If not, why please?
    Do you think it is technically impossible for the developers to solve the task?
    Do you think the developers forgot to gray out "text" in the choice box and allow regular expressions only in source code?
    Thanks.

    Nice that you like the nick
    Sure, I know that I can file a feature wish.
    But my main interest in this forum is to know, what other users think about certain features, why they think so, which they miss, which they regard as a bug, ...
    When I remember it right, you told me some time ago, that you don't use RegEx.
    Than I understand, that everything around that feature is not important for you.
    What I like to understand is, why you think the behaviour is logically.
    For me it is the opposite.
    You get a result with "Scope: Text", "[ ]RegEx".
    And you get no result with "Scope: Text", "[x]RegEx".
    Incredible strange.
    I would appreciate, if you could explain more detailed your view.

  • How do I make Firefox Google Search text that is not a website when drag and dropped to a new tab or existing one

    Exactly what the title says. Firefox did this before updating to 5 if I'm not mistaking. I want Firefox to Google search text when I drag it to the tabs bar (when an arrow pointing in between tabs appears). From there a new tab with the Google search should appear normally.

    Title and description may be clear to you it is certainly not clear to me.
    If I drag "title and description" which is not a url and try to create a new tab with it nothing will happen. I can drag that text to the the search bar and do a search.
    If I grabbed a url which was text not shown as a link I can drag to the location bar, the new tab button, to a tab, between two tabs and that is all legitimate.
    I can drag a ''[http://dmcritchie.mvps.org/firefox/kws.htm link]" without selecting it in the same manner the location bar, the new tab button, to a tab, between two tabs and that is all legitimate.
    I cant see that you have lost what it sounds like you had because I don't think you would have generated a search in that manner. You can certainly drag something like a sentence to the search bar, so even if you were the only one that could do start a search by dragging text you can still drag it to the search bar.

  • Export emails to a rtf with attachments

    I wish to export my emails as rtf with attachments with the titles as filenames so that I can view them as required on both PCs and Macs. without having to use email clients.
    How can I do this? The save as function just creates gibberish when read with a text reader.

    Which text editor did you use? Not all text editors read RTF.
    I just tried moving an .rtfd with attachments saved from Apple Mail to Windows XP. It looked fine in Windows, showing up as a folder with the mail message as RTF inside and the attachments next to it.
    As expected, the Mail RTF looked fine in Windows in Microsoft Word and WordPad, and was gibberish in Notepad, because Notepad does not support RTF...it is a pure text-only editor.

  • Google Search text prediction in URL Bar

    Hello,
    Is it possible to enable Google Search text prediction during typing words in URL Bar?
    Now I need to hit ENTER in URL Bar if I want to search some word or use very useless Search Bar :-(
    Any other browser like Chrome, Safari, Opera has one bar for anything (URL and SEARCH) with text prediction as well.

    You probably are getting Google search suggestions in the 3 search bars (on the navigation toolbar, built-in home page, and built-in new tab page). If not, you can turn on search suggestions using one of these 3 methods:
    * right-click the Search Bar (the one on the main navigation toolbar) > Show Suggestions
    * click the magnifying glass icon on the Search Bar > Change Search Settings, then check the box for Provide search suggestions
    * click the magnifying glass icon for the search box on the built-in home page or new tab page > Manage Search Engines, then check the box for Provide search suggestions
    Those do not appear in the address bar yet. For now, you might want to check out this extension:
    https://addons.mozilla.org/firefox/addon/omnibar/

  • Saving Mail messages as text or rtf to a server makes them invisible

    If I save an email message as text or rtf to a LaCie NAS server, the resulting file is tagged as invisible. If I save it to the Mac's hard disk it is not. It's relatively easy to untag the files, but I need to save dozens on some days and it's laborious. Any ideas … ?

    It gets worse. I have just saved an incoming mail message with three attached photos. It said it was saving the images (hooray) and it created an RTFD file (folder). However, when I opened the saved document there were no images! Very very odd...
    Some readers may think that I must be getting it all wrong and this is just pilot error. I can here reassure them that is not the case; I am a technically competent Apple user of some 25 years' experience. I am not a code monkey though; I can strip down and reassemble a thirty year old naturally aspirated performance engine but I would not be able to do anything under the hood which involved chips and computers!
    It is a difficult one to pin down but I will be very interested to know if any other Lion upgraders are experiencing similar problems, however ill-defined.
    Drew

Maybe you are looking for

  • Cannot upgrade Quicktime from 7.2 to 7.6! Please help!

    I recently tried to upgrade the software and my imac just froze, after reinstalling i found out that itunes wont open because it needs a higher version of Quicktime in order to work, I have downloaded the newest version of quicktime but it wont let m

  • Questions in POWL?

    Hi Experts, I have two questions related to POWL, please help me: 1. Where can I set the columns as hierarchy colunms that use can choose them for hierarchy display? And how can I set the default hierarchy colunms? 2. It seems the system cannot remem

  • UPLOAD and DOWNLOAD

    Hi All, I am in Upgrade project. I have to replace the following Obsolete FM with Cl_GUI_FRONTEND_SERVICES. How to do that? Any code would be highly appriciated.    CALL FUNCTION 'UPLOAD'         EXPORTING              codepage                = 'IBM'

  • Cannot run batch directly from Bridge

    Hi, I often work from Bridge and use the TOOLS>PHOTOSHOP>BATCH or TOOLS>PHOTOSHOP>LOAD FILES INTO PHOTOSHOP LAYERS This works well except it has just stopped working for no apparent reason. When I try any of the commands under TOOLS>PHOTOSHOP, photos

  • Error retrieving worklist using java

    Hi , I am trying to retrieve the worklist for a particular user. The java code is : package cpa.apps.fin.wa.model; import java.util.ArrayList; import java.util.List; import javax.transaction.SystemException; import oracle.bpel.services.workflow.metad