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

[NH] Re: Open command

Expand Messages
  • Jody
    Hi Stephen, ... The cause could be due to something that we just had a discussion about on the Clips List. If your Clip Editor is open and in focus then
    Message 1 of 6 , Jan 10, 2000
    • 0 Attachment
      Hi Stephen,

      > h="OnOpen"
      > ^!Showclipbook False
      > ^!open names.otl
      >
      > Which sometimes works and sometimes doesn't. I believe I've
      > tried both settings in the options/files/match directory dialog
      > box.

      The cause could be due to something that we just had a discussion
      about on the Clips List. If your Clip Editor is open and in
      focus then OnOpen will not execute. See if that is the case next
      time you experience the problem.

      Happy HTML'n!
      Jody

      http://www.sureword.com/notetab

      The NoteTab and Html List...
      mailto:Ntb-html-Subscribe@...
      mailto:Ntb-html-UnSubscribe@...
    • Grant
      Below is a proof of concept experiment If you have ie5 installed and use notetabPro and are interested in xml the document object model (dom) and the windows
      Message 2 of 6 , Jan 11, 2000
      • 0 Attachment
        Below is a proof of concept experiment
        If you have ie5 installed and use notetabPro and are interested in
        xml the document object model (dom) and the windows script host(wsh) ;
        you might like to give it a whirl
        Note; Your Ie5 install also installs wsh so you don't need to install
        anything else to begin mainpulating a xml datastore with the dom.
        The library creates a basic xml file
        then shows how you can manipulate it useing NotetabPro and the dom.
        it works like a simple database
        The xml file becomes a data store in which you can
        add a record
        import a delimited txt file
        delete a record
        and view records
        All from withen Notetab
        Note tis just proof of concept experiment so it's rough around the edges.
        Of note;
        is the way Notetab can interact ouput from the wsh.
        esp if have ever used wsh Check out deletePlant clip
        It asks you to select an option from the output of a script run in the wsh
        then passes that option back to the same script as a parameter

        In fact the library should give you some insight what can be done with
        xml,the dom, a bit of scripting and humble txt editor.

        Lines wrapped at 76 chars// watch out for H= delim text

        = V5 MultiLine NoSorting TabWidth=30

        H="loader"
        ^!Set %xml%="^$GetScriptPath$proof_of_concept.xml"
        ^!IfFileExist "^%xml%" Skip ELSE Next
        ^!TextToFile "^%xml%" ^$GetClipText(xmlStarter)$
        ;
        ^!Set %delimTxt%="^$GetScriptPath$delim.txt"
        ^!IfFileExist "^%delimTxt%" Skip ELSE Next
        ^!TextToFile "^%delimTxt%" ^$GetClipText(delimTxt)$
        ;
        ^!Set %plantAppend%=^$GetScriptPath$plantAppend.js
        ^!TextToFile "^%plantAppend%" ^$GetClipText(jsPlantAppend)$
        ;
        ^!Set %getNames%=^$GetScriptPath$getNames.js
        ^!TextToFile "^%getNames%" ^$GetClipText(jsGetNames)$
        ;
        ^!Set %deletePlant%=^$GetScriptPath$deletePlant.js
        ^!TextToFile "^%deletePlant%" ^$GetClipText(jsDeletePlant)$
        ;
        ^!Set %importDelim%=^$GetScriptPath$importDelim.js
        ^!TextToFile "^%importDelim%" ^$GetClipText(jsImportDelim)$
        ;
        ^!Set %go%=^?{(H=L)select==Append new record^=plantAppend|View
        names^=getNames|delete plant^=deletePlant|import Delimited
        File^=importDelim}
        ^!If ^%go% = plantAppend next else skip
        ^!Set %js%=^%plantAppend%
        ^!If ^%go% = importDelim next else skip
        ^!Set %js%=^%plantAppend%
        ^!If ^%go% = getNames next else skip
        ^!Set %js%=^%getNames%
        ^!If ^%go% = deletePlant next else skip
        ^!Set %js%=^%deletePlant%
        ;escape to pass as param
        ^!set %file%=^$StrReplace(\;\\;^%xml%;True;False)$
        ^!Clip ^%go%

        H="_importDelim"
        ^!Close ALL
        ;get DATASOURCE
        ^!OPEN:^%delimTxt%
        ^!Continue ^%delimTxt%
        ;count how many records
        ^!Set %MaxRow%=^$GetLineCount$
        ;set delimiter and count how many fields
        ^!SetDelimiter ,
        ^!Set %DELIMCOUNT%=^$StrCount(",";"^$GetLine(1)$";False;False)$
        ^!Inc %DELIMCOUNT%
        ^!Continue:There are ^%MaxRow% Records.^%NL%Each record has ^%DELIMCOUNT%
        fields.
        ^!Set %FEILDCOUNT%=^%DELIMCOUNT%
        ;--------------------------
        ^!Set %RECORD%=0
        ^!StatusShow Just converting your fields; Please wait.
        :RecordLoop
        ;go to next record
        ^!Inc:%RECORD%
        ;---------------
        ;get fields
        ;--longLine
        ^!Continue Add this rec "^$GetField(^%RECORD%;1)$"
        "^$GetField(^%RECORD%;2)$" "^$GetField(^%RECORD%;3)$"
        "^$GetField(^%RECORD%;4)$" "^$GetField(^%RECORD%;5)$"
        "^$GetField(^%RECORD%;6)$" "^$GetField(^%RECORD%;7)$
        ;--eol
        ;--longLine
        ^!Set %cscriptOut%=^$GetOutput(cscript "^%js%" //NoLogo "^%file%"
        "^$GetField(^%RECORD%;1)$" "^$GetField(^%RECORD%;2)$"
        "^$GetField(^%RECORD%;3)$" "^$GetField(^%RECORD%;4)$"
        "^$GetField(^%RECORD%;5)$" "^$GetField(^%RECORD%;6)$"
        "^$GetField(^%RECORD%;7)$")$
        ;--eol
        ^!Continue added ^%cscriptOut%
        ^!If ^%RECORD% = ^%MaxRow% Skip
        ^!GoTo RecordLoop
        :EXIT
        ^!CLOSE:^%delimTxt%


        H="_plantAppend"
        ;--longLine
        ^!Info ^$GetOutput(cscript "^%js%" //NoLogo "^%file%" "^?[plantId=124]"
        "^?[genus=Agathus]" "^?[species=Australis]" "^?[variety=]" "^?[common
        name=Kauri]" "^?[common name2=]" "^?[description=]")$
        ^!Url ^%xml%

        H="_getNames"
        ^!Info ^$GetOutput(cscript "^%js%" //NoLogo "^%file%")$

        H="_deletePlant"
        ^!set %param%=^$GetOutput(cscript "^%js%" //NoLogo "^%file%" "")$
        ^!set %param%=^$StrTrim(^%param%)$
        ^!Set %param%=^?{select record to delete=_^%param%}
        ^!Info ^$GetOutput(cscript "^%js%" //NoLogo "^%file%" "^%param%")$


        H="_jsPlantAppend"
        //create an activeX object
        var doc = new ActiveXObject("microsoft.xmldom");
        //load an xml file into the activex object
        //filename passed as argument to wsh
        doc.load(WScript.Arguments.Item(0));
        //
        //Get the documents outermost element
        var docRoot = doc.documentElement
        /*
        create a new child element and set attr
        create a reference to object
        so we can use again down the line
        */
        var plant = docRoot.appendChild(doc.createElement('plant'))
        plant.setAttribute('id',WScript.Arguments.Item(1))
        //
        var plantName = plant.appendChild(doc.createElement('name'))
        //create a Attribute for element
        plantName.setAttribute('type','botanical')
        //create 3 elements
        plantName.appendChild(doc.createElement('genus'))
        plantName.appendChild(doc.createElement('species'))
        plantName.appendChild(doc.createElement('variety'))
        //add txtcontent
        plantName.firstChild.appendChild(doc.createTextNode(WScript.Arguments.Item(2
        )))
        plantName.firstChild.nextSibling.appendChild(doc.createTextNode(WScript.Argu
        ments.Item(3)))
        plantName.firstChild.nextSibling.appendChild(doc.createTextNode(WScript.Argu
        ments.Item(4)))
        //go back to var plant and add 2 more'name' nodes
        plantName = plant.appendChild(doc.createElement('name'))
        plantName.setAttribute('type','common')
        plantName.appendChild(doc.createTextNode(WScript.Arguments.Item(5)))
        plantName = plant.appendChild(doc.createElement('name'))
        plantName.setAttribute('type','common')
        plantName.appendChild(doc.createTextNode(WScript.Arguments.Item(6)))
        //
        var description = plant.appendChild(doc.createElement('description'))
        description.appendChild(doc.createTextNode(WScript.Arguments.Item(7)))
        //
        WScript.Echo("Appended record id" + plant.getAttribute('id'));
        WScript.Echo(plant.xml);
        doc.save(WScript.Arguments.Item(0));

        H="_jsGetNames"
        //create an activeX object
        var doc = new ActiveXObject("microsoft.xmldom");
        //load an xml file into the activex object
        doc.validateOnParse = true;
        //filename passed as argument to wsh
        doc.load(WScript.Arguments.Item(0));
        //Get the documents outermost element
        var docRoot = doc.documentElement
        //
        WScript.Echo()
        for (var idx = 0;idx < docRoot.childNodes.length;idx++)
        {
        var plant = docRoot.childNodes.item(idx)
        //
        doc.save(WScript.Arguments.Item(0));
        //control loop to get common and botanical names
        var get = plant.getElementsByTagName('name')
        for (var i = 0;i < get.length;i++)
        {
        var attribList = get.item(i).attributes
        var type_value = attribList.getNamedItem('type').value
        switch(type_value)
        {
        case 'botanical':
        var bot = ''
        bot += 'botanical name; '
        var nodeList = get.item(i).childNodes
        for (var j = 0;j < nodeList.length;j++)
        {
        bot += nodeList.item(j).text + ' ';
        }
        WScript.Echo(bot);
        break;
        case 'common':
        WScript.Echo('common name; '+ get.item(i).text);
        break;
        }
        }
        }

        H="_jsDeletePlant"
        //create an activeX object
        var doc = new ActiveXObject("microsoft.xmldom");
        //load an xml file into the activex object
        doc.validateOnParse = true;
        //filename passed as argument to wsh
        doc.load(WScript.Arguments.Item(0));
        //Get the documents outermost element
        var docRoot = doc.documentElement
        //
        var bot = ''
        var matchFlag = false
        for (var idx = 0;idx < docRoot.childNodes.length;idx++)
        {
        var plant = docRoot.childNodes.item(idx)
        //
        //control loop to get common and botanical names
        var get = plant.getElementsByTagName('name')

        for (var i = 0;i < get.length;i++)
        {
        var match = ''
        var attribList = get.item(i).attributes
        var type_value = attribList.getNamedItem('type').value
        switch(type_value)
        {
        case 'botanical':
        var nodeList = get.item(i).childNodes
        for (var j = 0;j < nodeList.length;j++)
        {
        match += nodeList.item(j).text + ' '
        bot += nodeList.item(j).text + ' ';
        }
        bot += "|";
        if (match == WScript.Arguments.Item(1))
        {
        WScript.Echo("match found deleting ....." + plant.xml);
        matchFlag = true
        docRoot.removeChild(plant)
        }
        break;
        case 'common':
        break;
        }
        }
        }
        if (!matchFlag)
        {WScript.Echo(bot)}
        doc.save(WScript.Arguments.Item(0));

        H="_xmlStarter"
        <?xml version="1.0"?>
        <!--da da dom de da-->
        <document>
        </document>

        H="_delimTxt"
        id_1,Metrosideros,excelsa,,Pohutukawa,New Zealand Christmas tree,North
        island coastal Christmas tree
        id_2,Geranium,traversii,,Chatham Islands Geranium,,Geranium from the coastal
        cliffs of the Chathams
        id_3,Dianella,nigra,,Blueberry,Turutu,small flaxlike fans
        id_4,Dacrydium,bidwillii,,bog pine,pigmy pine,miniture conifer
      • Bill Scott
        Hi All: I have a question does anyone know how to keep your customer coming back to your page if they go off as an example I am writing some pages for a
        Message 3 of 6 , Jan 13, 2000
        • 0 Attachment
          Hi All:
          I have a question does anyone know how to keep your customer coming back to
          your page if they go off as an example I am writing some pages for a realtor
          which
          allows the potential customer to go out and check listings at the parent
          realtors site
          when they are done checking I want them to come back to my site ... I think
          that this could be done with javascript but I wanted to see if someone had
          already done this before trying to reinvent the wheel .........

          Also I am starting a new business reselling wholesale domain names they
          start at
          $60 dollars for two years for one
          $50 dollars for two years for ten
          $40 dollars for two years for twenty

          you can park them with me on my virtual server I am still trying to find out
          just
          how much that will cost me to do ... so .... I hope the ad is o.k. Jody ...
          <g>

          gi us a wee call at 800-510-5961 if you are interested.

          Bill Scott

          Online Puppy Tutorial

          http://www.stockdogsaction.com/puppies.htm
        • Jody
          Hi Bill, ... Actually, I do mind. I prefer not to get into starting things like for a number of reasons. Mainly though, it is not what the list is for. I do
          Message 4 of 6 , Jan 13, 2000
          • 0 Attachment
            Hi Bill,

            > so .... I hope the ad is o.k. Jody ...

            Actually, I do mind. I prefer not to get into starting things
            like for a number of reasons. Mainly though, it is not what the
            list is for. I do not have a problem on any of the lists for
            people to add *a few lines* in their signature though.

            Happy HTML'n!
            Jody

            http://www.sureword.com/notetab

            The NoteTab and Html List...
            mailto:Ntb-html-Subscribe@...
            mailto:Ntb-html-UnSubscribe@...
          • Bill Scott
            Hi Jody: Thanks you are great ... I ll do a wee bit on the big list with my signature Happy Stockdoggin ...... Bill *||: )
            Message 5 of 6 , Jan 13, 2000
            • 0 Attachment
              Hi Jody:
              Thanks you are great ... I'll do a wee bit on the big list with my signature

              Happy Stockdoggin ......

              Bill *||:>)
            Your message has been successfully submitted and would be delivered to recipients shortly.