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

Help with clip code please

Expand Messages
  • ritesaid_10
    I am trying to create a clip that will open a named document (an .otl file) which is in the users My Documents folder. I realise that to most of you this is
    Message 1 of 9 , Nov 15, 2013
    • 0 Attachment
      I am trying to create a clip that will open a named document (an .otl file) which is in the users My Documents folder.

      I realise that to most of you this is probably a pretty basic piece of clip code, but I am quite new to clipping and would greatly appreciate any help. 


      Thanks

      Fred
    • John Shotsky
      What do you know, and what do you not know? Tile name? (it is .otf). Folder it is in? If you don t know the file name or the folder, you must have them browse
      Message 2 of 9 , Nov 15, 2013
      • 0 Attachment

        What do you know, and what do you not know? Tile name? (it is .otf). Folder it is in?

        If you don't know the file name or the folder, you must have them browse for it. The more you do know, the more you can store in variables and then use them. If you know the file name and the folder, then you can just use the Open command to open it.

         

        Regards,
        John
        RecipeTools Web Site: http://recipetools.gotdns.com/
        John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

         

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of fredmorris66@...
        Sent: Friday, November 15, 2013 11:55
        To: ntb-clips@yahoogroups.com
        Subject: [Clip] Help with clip code please

         

         

        I am trying to create a clip that will open a named document (an .otl file) which is in the users My Documents folder.

         

        I realise that to most of you this is probably a pretty basic piece of clip code, but I am quite new to clipping and would greatly appreciate any help. 

         

        Thanks

         

        Fred

      • ritesaid_10
        Sorry John, I never made myself quite clear enough. I know the name of the file, and I know where it is on MY PC. What I wanted to know was how to write a clip
        Message 3 of 9 , Nov 15, 2013
        • 0 Attachment

          Sorry John, I never made myself quite clear enough. I know the name of the file, and I know where it is on MY PC. What I wanted to know was how to write a clip to access and open the file on another NoteTab users PC, specifically the correct clip code and syntax.


          I have now worked out the solution myself, see below. Whilst my effort seems to work OK, if you can think of a more elegant solution, I am all ears, or should I say eyes :).


          ^!IfFileExist ^$GetDocumentPath$OverLib.otl Next ELSE Error

          ^!Open ^$GetDocumentPath$OverLib.otl

          ^!IfError Next ELSE End


          :Error

          ^!Continue Error: could not open Overlib.otl, file not found. Do you want to locate the file yourself?


          ^!Set %FileName%="^?{(T=O)Open file=}"

          ^!IfFileExist "^%FileName%" Next ELSE Error

          ^!Open "^%FileName%"

          ^!IfError Next ELSE End

          :Error

          ^!Prompt Error: could not open "^%FileName%"


          Thanks anyway for your prompt response to my cry for help.


          Fred



          ---In ntb-clips@yahoogroups.com, <jshotsky@...> wrote:

          What do you know, and what do you not know? Tile name? (it is .otf). Folder it is in?

          If you don't know the file name or the folder, you must have them browse for it. The more you do know, the more you can store in variables and then use them. If you know the file name and the folder, then you can just use the Open command to open it.

           

          Regards,
          John
          RecipeTools Web Site: http://recipetools.gotdns.com/
          John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

           

          From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of fredmorris66@...
          Sent: Friday, November 15, 2013 11:55
          To: ntb-clips@yahoogroups.com
          Subject: [Clip] Help with clip code please

           

           

          I am trying to create a clip that will open a named document (an .otl file) which is in the users My Documents folder.

           

          I realise that to most of you this is probably a pretty basic piece of clip code, but I am quite new to clipping and would greatly appreciate any help. 

           

          Thanks

           

          Fred

        • Ian NTnerd
          Fred, You seem to have traits of a trained programmer with the error handling. Just a couple of things. 1. I d enclose the file path and name in double quotes
          Message 4 of 9 , Nov 17, 2013
          • 0 Attachment
            Fred,

            You seem to have traits of a trained programmer with the error handling.

            Just a couple of things.
            1. I'd enclose the file path and name in double quotes in the IfFileExist and Open commands. May work now on Win7&8 but not on XP.
            ^!IfFileExist "^$GetDocumentPath$OverLib.otl" Next ELSE Error

            2. You have two :Error labels, if the second fail occurs which label will it go to? Have you tested this? If you are opening a file that you selected in the file system, it should not fail so the second test should not be needed.

            Ian



            On 16/11/2013 7:12 AM, fredmorris66@... wrote:
             

            Sorry John, I never made myself quite clear enough. I know the name of the file, and I know where it is on MY PC. What I wanted to know was how to write a clip to access and open the file on another NoteTab users PC, specifically the correct clip code and syntax.


            I have now worked out the solution myself, see below. Whilst my effort seems to work OK, if you can think of a more elegant solution, I am all ears, or should I say eyes :).


            ^!IfFileExist ^$GetDocumentPath$OverLib.otl Next ELSE Error

            ^!Open ^$GetDocumentPath$OverLib.otl

            ^!IfError Next ELSE End


            :Error

            ^!Continue Error: could not open Overlib.otl, file not found. Do you want to locate the file yourself?


            ^!Set %FileName%="^?{(T=O)Open file=}"

            ^!IfFileExist "^%FileName%" Next ELSE Error

            ^!Open "^%FileName%"

            ^!IfError Next ELSE End

            :Error

            ^!Prompt Error: could not open "^%FileName%"


            Thanks anyway for your prompt response to my cry for help.


            Fred



            ---In ntb-clips@yahoogroups.com, <jshotsky@...> wrote:

            What do you know, and what do you not know? Tile name? (it is .otf). Folder it is in?

            If you don't know the file name or the folder, you must have them browse for it. The more you do know, the more you can store in variables and then use them. If you know the file name and the folder, then you can just use the Open command to open it.

             

            Regards,
            John
            RecipeTools Web Site: http://recipetools.gotdns.com/
            John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

             

            From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of fredmorris66@...
            Sent: Friday, November 15, 2013 11:55
            To: ntb-clips@yahoogroups.com
            Subject: [Clip] Help with clip code please

             

             

            I am trying to create a clip that will open a named document (an .otl file) which is in the users My Documents folder.

             

            I realise that to most of you this is probably a pretty basic piece of clip code, but I am quite new to clipping and would greatly appreciate any help. 

             

            Thanks

             

            Fred


          • ritesaid_10
            Hi John, Yes I am a bit of an avid programmer, my forte is visual basic. I write MS Access database applications in my spare time, its just that I am not
            Message 5 of 9 , Nov 17, 2013
            • 0 Attachment

              Hi John,


              Yes I am a bit of an avid programmer, my forte is visual basic. I write MS Access database applications in my spare time, its just that I am not familiar with clip code yet.


              I have tested the code and it works fine. The reason for the second error routine is that if the user browses to the file and it is corrupted, we need to handle the error that would be raised in attempting to open it.


              Fred



              ---In ntb-clips@yahoogroups.com, <indiamcq@...> wrote:

              Fred,

              You seem to have traits of a trained programmer with the error handling.

              Just a couple of things.
              1. I'd enclose the file path and name in double quotes in the IfFileExist and Open commands. May work now on Win7&8 but not on XP.
              ^!IfFileExist "^$GetDocumentPath$OverLib.otl" Next ELSE Error

              2. You have two :Error labels, if the second fail occurs which label will it go to? Have you tested this? If you are opening a file that you selected in the file system, it should not fail so the second test should not be needed.

              Ian



              On 16/11/2013 7:12 AM, fredmorris66@... wrote:
               

              Sorry John, I never made myself quite clear enough. I know the name of the file, and I know where it is on MY PC. What I wanted to know was how to write a clip to access and open the file on another NoteTab users PC, specifically the correct clip code and syntax.


              I have now worked out the solution myself, see below. Whilst my effort seems to work OK, if you can think of a more elegant solution, I am all ears, or should I say eyes :).


              ^!IfFileExist ^$GetDocumentPath$OverLib.otl Next ELSE Error

              ^!Open ^$GetDocumentPath$OverLib.otl

              ^!IfError Next ELSE End


              :Error

              ^!Continue Error: could not open Overlib.otl, file not found. Do you want to locate the file yourself?


              ^!Set %FileName%="^?{(T=O)Open file=}"

              ^!IfFileExist "^%FileName%" Next ELSE Error

              ^!Open "^%FileName%"

              ^!IfError Next ELSE End

              :Error

              ^!Prompt Error: could not open "^%FileName%"


              Thanks anyway for your prompt response to my cry for help.


              Fred



              ---In ntb-clips@yahoogroups.com, <jshotsky@...> wrote:

              What do you know, and what do you not know? Tile name? (it is .otf). Folder it is in?

              If you don't know the file name or the folder, you must have them browse for it. The more you do know, the more you can store in variables and then use them. If you know the file name and the folder, then you can just use the Open command to open it.

               

              Regards,
              John
              RecipeTools Web Site: http://recipetools.gotdns.com/
              John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

               

              From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of fredmorris66@...
              Sent: Friday, November 15, 2013 11:55
              To: ntb-clips@yahoogroups.com
              Subject: [Clip] Help with clip code please

               

               

              I am trying to create a clip that will open a named document (an .otl file) which is in the users My Documents folder.

               

              I realise that to most of you this is probably a pretty basic piece of clip code, but I am quite new to clipping and would greatly appreciate any help. 

               

              Thanks

               

              Fred


            • Axel Berger
              ... I m not sure about that. Most programs target pointee-clickee artists who hardly understand what they re doing and are easily stumped. Clips will only be
              Message 6 of 9 , Nov 17, 2013
              • 0 Attachment
                fredmorris66@... wrote:
                > we need to handle the error that would be raised in
                > attempting to open it.

                I'm not sure about that. Most programs target pointee-clickee artists
                who hardly understand what they're doing and are easily stumped. Clips
                will only be shared among other users who even if beginners can be
                assumed to have some incling about the language and what it does. I only
                include error routines where I want the clip to react and carry on
                appropriately. If it stops and I have to intervene anyway I see them as
                superfluous.

                Axel
              • ritesaid_10
                Hi Alex, I don t agree with your comments regarding error handling. In the context of what I am trying to achieve with the clip, robust error handling is
                Message 7 of 9 , Nov 17, 2013
                • 0 Attachment

                  Hi Alex, I don't agree with your comments regarding error handling. In the context of what I am trying to achieve with the clip, robust error handling is perfectly valid.


                  This clip is just one of many clips which is included in a Clipbook I am creating which will soon be uploaded to the group.


                  The clip in question will open an outline document which includes concise instructions on how to use the other clips in the Clipbook.


                  a) if the outline document was not in the expected location (My Documents), the first error handling routine gives the user the opportunity to locate the file.


                  b) If the user then browses for the file and for any reason the chosen file can not be opened, we as programmers must handle that error by providing feedback to the user.


                  I don't see any problem with this approach.


                  Fred




                  ---In ntb-clips@yahoogroups.com, <Axel-Berger@...> wrote:

                  fredmorris66@... wrote:
                  > we need to handle the error that would be raised in
                  > attempting to open it.

                  I'm not sure about that. Most programs target pointee-clickee artists
                  who hardly understand what they're doing and are easily stumped. Clips
                  will only be shared among other users who even if beginners can be
                  assumed to have some incling about the language and what it does. I only
                  include error routines where I want the clip to react and carry on
                  appropriately. If it stops and I have to intervene anyway I see them as
                  superfluous.

                  Axel
                • Axel Berger
                  ... Neither do I, except for the extra work, which I personally would rather not perform. Error handling is very important if an undetected error may make the
                  Message 8 of 9 , Nov 17, 2013
                  • 0 Attachment
                    fredmorris66@... wrote:
                    > I don't see any problem with this approach.

                    Neither do I, except for the extra work, which I personally would rather
                    not perform. Error handling is very important if an undetected error may
                    make the clip run on in the wrong way and destroy work. Where it fails
                    in an obvious way, that fact may suffice. Your way is better, but it's
                    more effort too.

                    Axel
                  • ritesaid_10
                    Firstly I apologise for referring to you as Alex. So are you saying that if attempting to open a corrupt file, NoteTab s core error handling will kick in and
                    Message 9 of 9 , Nov 17, 2013
                    • 0 Attachment

                      Firstly I apologise for referring to you as Alex.


                      So are you saying that if attempting to open a corrupt file, NoteTab's core error handling will kick in and deal with it, so there is no need to expend any effort in writing your own error handler?


                      I am relatively new to clip programming so I apologise in advance for sounding ignorant. :)


                      Fred



                      ---In ntb-clips@yahoogroups.com, <Axel-Berger@...> wrote:

                      fredmorris66@... wrote:
                      > I don't see any problem with this approach.

                      Neither do I, except for the extra work, which I personally would rather
                      not perform. Error handling is very important if an undetected error may
                      make the clip run on in the wrong way and destroy work. Where it fails
                      in an obvious way, that fact may suffice. Your way is better, but it's
                      more effort too.

                      Axel
                    Your message has been successfully submitted and would be delivered to recipients shortly.