Loading ...
Sorry, an error occurred while loading the content.
 

Setting up fields of a dialog box

Expand Messages
  • Jean-François Colas
    Hi all, Though I m using NoteTab for years now, I just started diving into the Clip language. Mainly I do some Find/Replace operations with regex. For a
    Message 1 of 12 , Oct 20, 2011
      Hi all,

      Though I'm using NoteTab for years now, I just started diving into the
      Clip language. Mainly I do some Find/Replace operations with regex.

      For a particular operation, is there any way to open the Replace dialog
      box, set up the Find and Replace fields, but let us do the replacement
      interactively?

      Thanks,
      J.-F.
    • Eb
      Hi J-F, What you are asking is remotely possible, but fairly complicated. It probably would be easier to learn to do this completely from the clip, using
      Message 2 of 12 , Oct 20, 2011
        Hi J-F,

        What you are asking is remotely possible, but fairly complicated. It probably would be easier to learn to do this completely from the clip, using wizards for user interaction.

        But here are the steps for simple replacements:

        1. seed the clipboard with the replace pattern
        2. Open the search dialog
        3. paste the search pattern

        the clipcode would be something like this:

        ^!SetClipboard replacepattern
        ^!Menu Search/Replace
        ^!Keyboard #replacePattern#

        Now the bad news. The keyboard command is not very flexible, and does not allow a number of regular expression characters. In other words, it will probably fail to paste any but the most simple pattern correctly.


        Cheers,


        Eb

        --- In ntb-clips@yahoogroups.com, Jean-François Colas <jfcolas@...> wrote:
        >
        > Hi all,
        >
        > Though I'm using NoteTab for years now, I just started diving into the
        > Clip language. Mainly I do some Find/Replace operations with regex.
        >
        > For a particular operation, is there any way to open the Replace dialog
        > box, set up the Find and Replace fields, but let us do the replacement
        > interactively?
        >
        > Thanks,
        > J.-F.
        >
      • John Shotsky
        It sounds to me as if you need to build a series of clips to run on your text. One clip for each type of change you want made. When you run the library of
        Message 3 of 12 , Oct 20, 2011
          It sounds to me as if you need to build a series of clips to run on your text. One clip for each type of change you want
          made. When you run the 'library' of clips, it will process through your document, and make all the changes you want.
          Some examples of what you want would be helpful.

          I do this even if I'm only processing one large document. WAY faster than doing a whole document manually/interactively,
          and much more precise as well.

          Regards,
          John

          From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Jean-Fran�ois Colas
          Sent: Thursday, October 20, 2011 02:34
          To: ntb-clips@yahoogroups.com
          Subject: [Clip] Setting up fields of a dialog box


          Hi all,

          Though I'm using NoteTab for years now, I just started diving into the
          Clip language. Mainly I do some Find/Replace operations with regex.

          For a particular operation, is there any way to open the Replace dialog
          box, set up the Find and Replace fields, but let us do the replacement
          interactively?

          Thanks,
          J.-F.



          [Non-text portions of this message have been removed]
        • Sheri
          ... I ve actually done something like that. Haven t used it in quite awhile, but it does still work. The main clip is used when the Find or Find and Replace
          Message 4 of 12 , Oct 20, 2011
            On 10/20/2011 5:34 AM, Jean-François Colas wrote:
            > Hi all,
            >
            > Though I'm using NoteTab for years now, I just started diving into the
            > Clip language. Mainly I do some Find/Replace operations with regex.
            >
            > For a particular operation, is there any way to open the Replace dialog
            > box, set up the Find and Replace fields, but let us do the replacement
            > interactively?
            >
            > Thanks,
            > J.-F.
            >

            I've actually done something like that. Haven't used it in quite awhile,
            but it does still work.

            The main clip is used when the "Find" or "Find and Replace Dialog"
            SRTexts variables have already been set.

            As I recall I would set the SRText values with a clip that parsed a
            highlighted ^!Find or ^!Replace command, opened the appropriate dialog
            and called the main clip.

            Regards,
            Sheri

            H="Sample S-R"
            ^!Set %SRTexts1%="Hello"
            ^!Set %SRTexts2%="Goodbye"
            ^!Menu Search/Replace
            ^!IfAppOpen "Find and Replace" Next Else Skip_-1
            ^!Clip "Load S-R"
            ;end of clip

            H="Load S-R"
            ;2006-12-04 by Sheri Pierce (originally from 2002)
            ^!ActivateApp
            ^!IfAppOpen "Find and Replace" Next Else Test4Find
            ^!FocusApp "Find and Replace"
            ^!Keyboard ALTDOWN #x# ALTUP #-#
            ^!SetClipboard ^%SRTexts1%
            ^!Keyboard AltDown #n# AltUp
            ^!Keyboard CtrlDown #v# CtrlUp
            ^!Keyboard ALTDOWN #x# ALTUP #+#
            ^!SetClipboard ^%SRTexts2%
            ^!Keyboard AltDown #p# AltUp
            ^!Keyboard CtrlDown #v# CtrlUp
            ^!Keyboard AltDown #c# AltUp #-#
            ^!Goto Finished
            :Test4Find
            ^!IfAppOpen "Find" Next Else Error
            ^!FocusApp "Find"
            ^!Keyboard ALTDOWN #x# ALTUP #-#
            ^!SetClipboard ^%SRTexts1%
            ^!Keyboard AltDown #n# AltUp
            ^!Keyboard CtrlDown #v# CtrlUp
            ^!Keyboard ALTDOWN #x# ALTUP #+#
            ^!Keyboard ALTDOWN #c# ALTUP #-#
            :Finished
            ^!Goto End
            :Error
            ^!Prompt Error - NoteTab's "Find" or "Find and Replace" dialog must be
            open when this clip is run.
            ;end of clip
          • Sheri
            Here s a couple more clips to use with the previously posted Load S-R clip You will need to fix any long command lines that get wrapped in email when you add
            Message 5 of 12 , Oct 20, 2011
              Here's a couple more clips to use with the previously posted "Load S-R" clip

              You will need to fix any long command lines that get wrapped in email
              when you add clips to your clipbook.

              To use the Parse clip, put your cursor in the current document at the
              beginning of a Find or Replace command.

              Once you have search and/or replace texts loaded, you can use the other
              clips to open those values in one of the dialogs again later without
              reparsing. However, all the clips need to be run in the same context
              (clipbook or clipbar). Clipbar is convenient because it allows you to
              use the parse clip in the clip editor document.

              H="Parse S-R Clip Command"
              ;put the cursor at start of the Find or Replace command to be parsed
              ^!SetWordWrap Off
              ^!Jump Select_Start
              ^!Select EOL
              ;long line follows
              ^!IfMatch "^\^\!(Find|Repl)$" "^$StrCopyLeft("^$GetSelection$";6)$" Next
              Else Error
              ;end long line
              ^!Setlistdelimiter ^P
              ;long line follows
              ^!SetArray
              %SRTexts%=^$GetDocMatchAll((?<=^\^\!Find\x20").+(?=")|(?<=^\^\!Replace\x20").+(?="\x20\>\>\x20")|(?<="\x20\>\>\x20").*(?="))$
              ;end long line
              ^!If ^%SRTexts0%=0 Error
              ^!If ^%SRTexts0%=1 Next Else Skip
              ^!Menu Search/Find
              ^!If ^%SRTexts0%=2 Next Else Skip
              ^!Menu Search/Replace
              ^!Clip "Load S-R"
              ^!Goto End
              :Error
              ^!Prompt No S-R Texts were found in the selection.
              ;end of clip

              H="Recent S-R in Replace"
              ^!Menu Search/Replace
              ^!IfAppOpen "Find and Replace" Next Else Skip_-1
              ^!Clip "Load S-R"
              ;end of clip

              H="Recent S-R in Find"
              ^!Menu Search/Find
              ^!IfAppOpen "Find" Next Else Skip_-1
              ^!Clip "Load S-R"
              ;end of clip
            • joy8388608
              I set tabs from within a clip using this code that works fine... ; call with ^!FarClip MySubs:SetTabs 15;30;80 ^!Delay 4 ^!KeyBoardDelay 80 ^!Keyboard
              Message 6 of 12 , Oct 24, 2011
                I set tabs from within a clip using this code that works fine...

                ; call with ^!FarClip "MySubs:SetTabs" 15;30;80
                ^!Delay 4
                ^!KeyBoardDelay 80
                ^!Keyboard Altdown #D# #P# #S# Altup #^&# &400 ENTER
                ^!Delay 4

                I liked the idea here thought it would be more efficient to simulate Control V instead of waiting for the tab settings to 'type' themselves in, but can't get it to work! The Properties dialog displays and then it just sits there. I thought I was copying this code closely enough but I guess not. Do I need all that activateApp and IfAppOpen code? Even if I do need it, it doesn't work. What is wrong?

                Thanks,
                Joy

                --- Sits there after displaying Properties dialog box ---

                ; call with ^!FarClip "MySubs:SetTabs" 15;30;80
                ^!SetClipboard ^&
                ^!Menu Document/Properties
                ^!ActivateApp
                ^!IfAppOpen "Current Document Properties" Next Else Skip_-2
                ^!FocusApp "Current Document Properties"
                ^!Keyboard Altdown #S# Altup
                ^!Keyboard CtrlDown #v# CtrlUp
                ^!Keyboard ENTER



                >
                > H="Sample S-R"
                > ^!Set %SRTexts1%="Hello"
                > ^!Set %SRTexts2%="Goodbye"
                > ^!Menu Search/Replace
                > ^!IfAppOpen "Find and Replace" Next Else Skip_-1
                > ^!Clip "Load S-R"
                > ;end of clip
                >
                > H="Load S-R"
                > ;2006-12-04 by Sheri Pierce (originally from 2002)
                > ^!ActivateApp
                > ^!IfAppOpen "Find and Replace" Next Else Test4Find
                > ^!FocusApp "Find and Replace"
                > ^!Keyboard ALTDOWN #x# ALTUP #-#
                > ^!SetClipboard ^%SRTexts1%
                > ^!Keyboard AltDown #n# AltUp
                > ^!Keyboard CtrlDown #v# CtrlUp
                > ^!Keyboard ALTDOWN #x# ALTUP #+#
                > ^!SetClipboard ^%SRTexts2%
                > ^!Keyboard AltDown #p# AltUp
                > ^!Keyboard CtrlDown #v# CtrlUp
                > ^!Keyboard AltDown #c# AltUp #-#
                > ^!Goto Finished
                > :Test4Find
                > ^!IfAppOpen "Find" Next Else Error
                > ^!FocusApp "Find"
                > ^!Keyboard ALTDOWN #x# ALTUP #-#
                > ^!SetClipboard ^%SRTexts1%
                > ^!Keyboard AltDown #n# AltUp
                > ^!Keyboard CtrlDown #v# CtrlUp
                > ^!Keyboard ALTDOWN #x# ALTUP #+#
                > ^!Keyboard ALTDOWN #c# ALTUP #-#
                > :Finished
                > ^!Goto End
                > :Error
                > ^!Prompt Error - NoteTab's "Find" or "Find and Replace" dialog must be
                > open when this clip is run.
                > ;end of clip
                >
              • Sheri
                ... Document Properties is a different kind of window than the Search dialogs. Document Properties is modal, which means normal activity is suspended when it
                Message 7 of 12 , Oct 24, 2011
                  --- In ntb-clips@yahoogroups.com, "joy8388608" <mycroftj@...> wrote:
                  >
                  > I set tabs from within a clip using this code that works fine...
                  >
                  > ; call with ^!FarClip "MySubs:SetTabs" 15;30;80
                  > ^!Delay 4
                  > ^!KeyBoardDelay 80
                  > ^!Keyboard Altdown #D# #P# #S# Altup #^&# &400 ENTER
                  > ^!Delay 4
                  >
                  > I liked the idea here thought it would be more efficient to
                  > simulate Control V instead of waiting for the tab settings
                  > to 'type' themselves in, but can't get it to work! The
                  > Properties dialog displays and then it just sits there. I
                  > thought I was copying this code closely enough but I guess
                  > not. Do I need all that activateApp and IfAppOpen code? Even
                  > if I do need it, it doesn't work. What is wrong?
                  >
                  > Thanks,
                  > Joy
                  >

                  Document Properties is a different kind of window than the Search dialogs. Document Properties is modal, which means normal activity is suspended when it is shown. The Search dialogs are modeless, which means they behave more independently. You need the window to behave independently if you want to activate, focus and paste to it using separate commands. But, by stuffing the keyboard buffer in the Keyboard command that actually initiates the Document Properties dialog, your older clip is able to input to the correct field. You could try adding CtrlDown #v# CtrlUp for pasting the current clipboard content there, but you will have to set the clipboard prior to using the keyboard command. Possibly this would work:

                  ^!SetClipboard ^&
                  ^!Keyboard Altdown #D# #P# #S# Altup CtrlDown #v# CtrlUp ENTER

                  Regards,
                  Sheri
                • joy8388608
                  ... Ahhh. I didn t notice the Dialog box was modal. I found the following does work but it needs the KeyBoardDelay or the Find dialog pops up as well as the
                  Message 8 of 12 , Oct 24, 2011
                    --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
                    >
                    > --- In ntb-clips@yahoogroups.com, "joy8388608" <mycroftj@> wrote:
                    > >
                    > > I set tabs from within a clip using this code that works fine...
                    > >
                    > > ; call with ^!FarClip "MySubs:SetTabs" 15;30;80
                    > > ^!Delay 4
                    > > ^!KeyBoardDelay 80
                    > > ^!Keyboard Altdown #D# #P# #S# Altup #^&# &400 ENTER
                    > > ^!Delay 4
                    > >
                    > > I liked the idea here thought it would be more efficient to
                    > > simulate Control V instead of waiting for the tab settings
                    > > to 'type' themselves in, but can't get it to work! The
                    > > Properties dialog displays and then it just sits there. I
                    > > thought I was copying this code closely enough but I guess
                    > > not. Do I need all that activateApp and IfAppOpen code? Even
                    > > if I do need it, it doesn't work. What is wrong?
                    > >
                    > > Thanks,
                    > > Joy
                    > >
                    >
                    > Document Properties is a different kind of window than the Search dialogs. Document Properties is modal, which means normal activity is suspended when it is shown. The Search dialogs are modeless, which means they behave more independently. You need the window to behave independently if you want to activate, focus and paste to it using separate commands. But, by stuffing the keyboard buffer in the Keyboard command that actually initiates the Document Properties dialog, your older clip is able to input to the correct field. You could try adding CtrlDown #v# CtrlUp for pasting the current clipboard content there, but you will have to set the clipboard prior to using the keyboard command. Possibly this would work:
                    >
                    > ^!SetClipboard ^&
                    > ^!Keyboard Altdown #D# #P# #S# Altup CtrlDown #v# CtrlUp ENTER
                    >
                    > Regards,
                    > Sheri
                    >


                    Ahhh. I didn't notice the Dialog box was modal. I found the following does work but it needs the KeyBoardDelay or the Find dialog pops up as well as the Document Properties and it doesn't do what it is supposed to do. I also saved the clipboard so the subroutine (I call this routine) does not change it.

                    Thanks so much (once again) for your help.

                    Joy

                    ^!Set %ST_OCB%=^$GetClipBoard$
                    ^!SetClipboard ^&
                    ^!KeyBoardDelay 100
                    ^!Keyboard Altdown #D# #P# #S# Altup CtrlDown #v# CtrlUp ENTER
                    ^!SetClipboard ^%ST_OCB%
                  • Sheri
                    ... Glad you were able to get that working. FWIW you might prefer to use Save and RestoreClipboard commands (which can accommodate with non-text clipboard
                    Message 9 of 12 , Oct 25, 2011
                      On 10/24/2011 6:36 PM, joy8388608 wrote:
                      > Ahhh. I didn't notice the Dialog box was modal. I found the following does work but it needs the KeyBoardDelay or the Find dialog pops up as well as the Document Properties and it doesn't do what it is supposed to do. I also saved the clipboard so the subroutine (I call this routine) does not change it.
                      >
                      > Thanks so much (once again) for your help.
                      >
                      > Joy
                      >
                      > ^!Set %ST_OCB%=^$GetClipBoard$
                      > ^!SetClipboard ^&
                      > ^!KeyBoardDelay 100
                      > ^!Keyboard Altdown #D# #P# #S# Altup CtrlDown #v# CtrlUp ENTER
                      > ^!SetClipboard ^%ST_OCB%
                      >

                      Glad you were able to get that working. FWIW you might prefer to use
                      Save and RestoreClipboard commands (which can accommodate with non-text
                      clipboard content if present).

                      Regard,
                      Sheri
                    • John Shotsky
                      Wow, I sent this message 11 days ago, and it is just now arriving, on the 31st! Yahoo must be taking their email delivery cues from the USPS. Regards, John
                      Message 10 of 12 , Oct 31, 2011
                        Wow, I sent this message 11 days ago, and it is just now arriving, on the 31st! Yahoo must be taking their email
                        delivery cues from the USPS.

                        Regards,
                        John
                        RecipeTools Web Site: http://recipetools.gotdns.com/


                        -----Original Message-----
                        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of John Shotsky
                        Sent: Thursday, October 20, 2011 05:48
                        To: ntb-clips@yahoogroups.com
                        Subject: RE: [Clip] Setting up fields of a dialog box

                        It sounds to me as if you need to build a series of clips to run on your text. One clip for each type of change you want
                        made. When you run the 'library' of clips, it will process through your document, and make all the changes you want.
                        Some examples of what you want would be helpful.

                        I do this even if I'm only processing one large document. WAY faster than doing a whole document manually/interactively,
                        and much more precise as well.

                        Regards,
                        John

                        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Jean-François Colas
                        Sent: Thursday, October 20, 2011 02:34
                        To: ntb-clips@yahoogroups.com
                        Subject: [Clip] Setting up fields of a dialog box


                        Hi all,

                        Though I'm using NoteTab for years now, I just started diving into the
                        Clip language. Mainly I do some Find/Replace operations with regex.

                        For a particular operation, is there any way to open the Replace dialog
                        box, set up the Find and Replace fields, but let us do the replacement
                        interactively?

                        Thanks,
                        J.-F.



                        [Non-text portions of this message have been removed]



                        ------------------------------------

                        Fookes Software: http://www.fookes.com/
                        NoteTab website: http://www.notetab.com/
                        NoteTab Discussion Lists: http://www.notetab.com/groups.php

                        ***
                        Yahoo! Groups Links
                      • loro
                        ... I got it in a timely manner. They are just prioritizing. ;-) Lotta
                        Message 11 of 12 , Oct 31, 2011
                          John Shotsky wrote:
                          >Wow, I sent this message 11 days ago, and it is just now arriving,
                          >on the 31st! Yahoo must be taking their email
                          >delivery cues from the USPS.

                          I got it in a timely manner. They are just prioritizing. ;-)

                          Lotta
                        • Al
                          ... That would explain why I simultaneously got this one and another, a match, dated the 20th. ... 1. Too many mails to deliver arrived in too short of a time
                          Message 12 of 12 , Nov 1, 2011
                            John Shotsky wrote:
                            > Wow, I sent this message 11 days ago, and it is just now arriving, on the 31st!

                            That would explain why I simultaneously got this one and another, a
                            match, dated the 20th.
                            > Yahoo must be taking their email
                            > delivery cues from the USPS.
                            >

                            1. Too many mails to deliver arrived in too short of a time for their server

                            so their server had to backlog (store) messages for a later delivery

                            and to begin sequence of deliver (send out) the backlog as well as also
                            serving current arrivals

                            Then #1 happened again and again.

                            Yours got buried away in the backlog

                            PS I don't really know. That was a guess. | Alan.
                            > Regards,
                            > John
                            > RecipeTools Web Site: http://recipetools.gotdns.com/
                            >
                            >
                            > -----Original Message-----
                            > From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of John Shotsky
                            > Sent: Thursday, October 20, 2011 05:48
                            > To: ntb-clips@yahoogroups.com
                            > Subject: RE: [Clip] Setting up fields of a dialog box
                            >
                            > It sounds to me as if you need to build a series of clips to run on your text. One clip for each type of change you want
                            > made. When you run the 'library' of clips, it will process through your document, and make all the changes you want.
                            > Some examples of what you want would be helpful.
                            >
                            > I do this even if I'm only processing one large document. WAY faster than doing a whole document manually/interactively,
                            > and much more precise as well.
                            >
                            > Regards,
                            > John
                            >
                            > From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Jean-François Colas
                            > Sent: Thursday, October 20, 2011 02:34
                            > To: ntb-clips@yahoogroups.com
                            > Subject: [Clip] Setting up fields of a dialog box
                            >
                            >
                            > Hi all,
                            >
                            > Though I'm using NoteTab for years now, I just started diving into the
                            > Clip language. Mainly I do some Find/Replace operations with regex.
                            >
                            >
                            <snip>
                          Your message has been successfully submitted and would be delivered to recipients shortly.