write to text file and run ???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ButtonMaker
    Forum Member
    • Mar 2007
    • 172

    write to text file and run ???

    i want to write data to text file and then run the text file... how can i do it ???

    Code:
    links = WebBrowserExtension.GetLinks();
    for i, v in links do
    	--how to write links to txt file ???
    end
  • XeroX
    Forum Member
    • Jan 2006
    • 31

    #2
    Hi,

    Do you mean something like that ?
    Attached Files

    Comment

    • ButtonMaker
      Forum Member
      • Mar 2007
      • 172

      #3
      thanks but not what i want !!! what i want is;
      get links from the page and save it to txt file and run the text file...

      something like that but this doesnt work...
      Code:
      links = WebBrowserExtension.GetLinks();
      TextFile.WriteFromString("AutoPlay\\Docs\\links.txt", links, true)
      File.Run("AutoPlay\\Docs\\links.txt", "", "", SW_SHOWNORMAL, false);

      Comment

      • Imagine Programming
        Indigo Rose Customer
        • Apr 2007
        • 4250

        #4
        Originally posted by ButtonMaker View Post
        thanks but not what i want !!! what i want is;
        get links from the page and save it to txt file and run the text file...

        something like that but this doesnt work...
        Code:
        links = WebBrowserExtension.GetLinks();
        TextFile.WriteFromString("AutoPlay\\Docs\\links.txt", links, true)
        File.Run("AutoPlay\\Docs\\links.txt", "", "", SW_SHOWNORMAL, false);
        File.Run is for executable files, try to use File.Open
        Code:
        File.Open("AutoPlay\\Docs\\links.txt", "", SW_SHOWNORMAL);
        Bas Groothedde
        Imagine Programming :: Blog

        AMS8 Plugins
        IMXLH Compiler

        Comment

        • ButtonMaker
          Forum Member
          • Mar 2007
          • 172

          #5
          it doesnt write data to txt file !!!

          Code:
          links = WebBrowserExtension.GetLinks();
          for i, v in links do
          	TextFile.WriteFromString("AutoPlay\\Docs\\links.txt", v, true)
          end
          File.Open("AutoPlay\\Docs\\links.txt", "", SW_SHOWNORMAL);

          Comment

          • Imagine Programming
            Indigo Rose Customer
            • Apr 2007
            • 4250

            #6
            Try to check tbl links for being empty... perhaps it doesn't contain anything so the for loop won't do anything.

            Code:
            links = WebBrowserExtension.GetLinks();
            if(links)then
                for i, v in links do
            	    TextFile.WriteFromString("AutoPlay\\Docs\\links.txt", v, true)
                end
            else
                Dialog.Message("Error", "No links retrieved");
            end
            File.Open("AutoPlay\\Docs\\links.txt", "", SW_SHOWNORMAL);
            Bas Groothedde
            Imagine Programming :: Blog

            AMS8 Plugins
            IMXLH Compiler

            Comment

            • ButtonMaker
              Forum Member
              • Mar 2007
              • 172

              #7
              thanks C B programming and webdesign :yes

              but is it possible to r/n/ after everylink in txt file ???

              example txt file :
              Code:
              www.google.com
              www.msn.com
              www.yahoo.com

              Comment

              • Imagine Programming
                Indigo Rose Customer
                • Apr 2007
                • 4250

                #8
                Originally posted by ButtonMaker View Post
                thanks C B programming and webdesign :yes

                but is it possible to r/n/ after everylink in txt file ???

                example txt file :
                Code:
                www.google.com
                www.msn.com
                www.yahoo.com
                Sure, just add the red part
                Code:
                links = WebBrowserExtension.GetLinks();
                if(links)then
                    for i, v in links do
                	    TextFile.WriteFromString("AutoPlay\\Docs\\links.txt", v[COLOR="Red"].."\r\n"[/COLOR], true)
                    end
                else
                    Dialog.Message("Error", "No links retrieved");
                end
                File.Open("AutoPlay\\Docs\\links.txt", "", SW_SHOWNORMAL);
                Bas Groothedde
                Imagine Programming :: Blog

                AMS8 Plugins
                IMXLH Compiler

                Comment

                Working...
                X