Solution for the question: Select a single word in a text field after a search

Ask a Question related to FileMaker, Design and Development.

  1. #1

    Default Solution for the question: Select a single word in a text field after a search

    In Filemaker 6:
    Define a global field named "gSearched_word" to store word that you
    want to find.

    Make a script to enter in find mode as below:

    Script 1
    Go to Layout ("mySearchLayout")
    Enter Find Mode (Pause)
    Set Field("gSearched_word)", "myField")
    Perform Find(Replace Found Set") (or other option)
    Go to Layout("myResultLayout")
    Perform Find/Replace("gSearched_word", " ", "Find next") (see other
    option on "Find next" parameter, ecc)

    Make a new script to hilite the next occurence of word
    Script 2
    Perform Find/Replace("gSearched_word", " ", "Find next")

    Insert a button to perform this script in "myResultLayout"
    That's all.
    Bye. Carlo
    Carlo Guest

  2. Similar Questions and Discussions

    1. Search database fields using single text field
      Kindly advise on how to develop a database search page such that there is single text field to enter serach string and the results are shown on the...
    2. form: single line -- multiple text boxes -- one typing field - how?
      please excuse my ignorance. am a newbie. I saw a fillable form, that shows:- a single line with multiple text boxes for entering each letter of a...
    3. static text: single word rollover state?
      i know you can attach a link to a selected word in a static text field, just wondering if it's possible to select one word out of a static text field...
    4. Select from a text field!
      Hello all, I have in a form a textarea field with a lot of lines in it (records) I want to know if there is any way to select the line I want by...
    5. Select a single word in a text field after a search
      in article PvMJa.17242$dP1.32589@newsc.telia.net, nisse@nisse.se at nisse@nisse.se wrote on 6/23/03 4:59 PM: If you're on the Mac sind, and...
  3. #2

    Default Re: Solution for the question: Select a single word in a textfield after a search

    Hi Carlo

    Unlike find, find/replace is not taken out by edit only privileges (although
    password privileges still apply with regard to modifying records) which
    makes me wonder why you would ever need to script something like this.
    Command-Shift-F (or equiv Windows shortcut) will bring up the find/replace
    dialog and find the first instance, while Command-G (or equiv Windows
    shortcut) will find the next instance (even after you have closed the dialog
    box).

    However, if there really is a reason why you must do it this way, why not
    make use of a custom dialog in your script. Values can be entered into
    global fields via the dialog, doing away with the need for extra layouts.

    Also, a loop and a pause/resume script step would allow users to use the
    Enter key to view each instance of the search string, instead of having to
    click a button each time.

    Set Field [ gText1, "" ]
    Show Custom Dialog [ Title: ³SEARCH STRING²; Message: ³Enter search
    string.²; Buttons: ³OK², ³Cancel², ³²; Input #1:
    gText1, ³Search String² ]
    If [ Status(CurrentMessageChoice) = 1 ]
    Enter Find Mode
    Set Field [ text, gText1 ]
    Perform Find [ Replace Found Set ]
    Loop
    Perform Find/Replace [ Find: gText1; Replace: ; Search operation: Find Next;
    Search settings: Forward; Search across: All records/requests; Search
    within: All fields ]
    Pause/resume []
    End Loop
    End If

    NB: This script would be improved by error checking for no records found,
    and by giving the user the choice to modify search criteria, and to replace,
    constrain or extend the found set, but I have kept it simple here for the
    sake of clarity.

    Bridget Eley

    in article [email]9b1b0094.0307300311.2ae8873f@posting.google.com[/email], Carlo at
    [email]ercar@hostlcnet.it[/email] wrote on 30/7/03 9:11 PM:
    > In Filemaker 6:
    > Define a global field named "gSearched_word" to store word that you
    > want to find.
    >
    > Make a script to enter in find mode as below:
    >
    > Script 1
    > Go to Layout ("mySearchLayout")
    > Enter Find Mode (Pause)
    > Set Field("gSearched_word)", "myField")
    > Perform Find(Replace Found Set") (or other option)
    > Go to Layout("myResultLayout")
    > Perform Find/Replace("gSearched_word", " ", "Find next") (see other
    > option on "Find next" parameter, ecc)
    >
    > Make a new script to hilite the next occurence of word
    > Script 2
    > Perform Find/Replace("gSearched_word", " ", "Find next")
    >
    > Insert a button to perform this script in "myResultLayout"
    > That's all.
    > Bye. Carlo
    Bridget Eley Guest

  4. #3

    Default Re: Solution for the question: Select a single word in a text field after a search

    Your script is very useful. Thank you Bridget
    Best regard

    Carlo
    Carlo Guest

  5. #4

    Default Re: Solution for the question: Select a single word in a textfield after a search

    Dear Bridget,

    Thanks for this elegant solution! (Even after al these years!)

    Best regards, Hans

    [QUOTE=Bridget Eley;348216]Hi Carlo

    Unlike find, find/replace is not taken out by edit only privileges (although
    password privileges still apply with regard to modifying records) which
    makes me wonder why you would ever need to script something like this.
    Command-Shift-F (or equiv Windows shortcut) will bring up the find/replace
    dialog and find the first instance, while Command-G (or equiv Windows
    shortcut) will find the next instance (even after you have closed the dialog
    box).

    However, if there really is a reason why you must do it this way, why not
    make use of a custom dialog in your script. Values can be entered into
    global fields via the dialog, doing away with the need for extra layouts.

    Also, a loop and a pause/resume script step would allow users to use the
    Enter key to view each instance of the search string, instead of having to
    click a button each time.
    Hans Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139