4 Replies Latest reply on Mar 2, 2010 10:52 PM by Harbs.

    doScript not working

    Shonkyin Level 3

      Hi All,

       

      below doscript code not working with onClick event. But when i try this without onClick event its working fine. What's wrong with it?

       

      dialog.IconButton.onClick = function()

      {

      var openurl = "tell application \"Safari\"\ractivate\rdo JavaScript \"window.open('http://www.yahoo.com')\" in document 1\rend tell"

      app.doScript(openurl, ScriptLanguage.applescriptLanguage)

      }

       

      Any other suggestion for goto URL on click on image button in Javascript or with Applescript.

       

      Thanks,

      Shonky

        • 1. Re: doScript not working
          Harbs. Level 6

          I HATE JIVE!

           

          I responded to this many hours ago, but the email disappeared into Jiveland...

           

          I just happened to browse the web view, and noticed that my reponse never made it...

           

          Here was my response:

           

          Is it a dialog or a palette?

           

          app.doScript() does not work when a modal dialog is open. If you want to use app.doScript(), you'd need to either use a palette/window instead of a dialog, or close the dialog before the doScript().

           

          The other option is writing a html launcher file and executing that...

           

          Harbs

          1 person found this helpful
          • 2. Re: doScript not working
            Shonkyin Level 3

            Hi Harbs,

             

            Thank you very much for replying.

             

            I am using doScript with dialog.

             

            Can you please show a sample of html launcher file because i have not any idea regarding this.

             

             

            Thanks,

            Shonky

            • 3. Re: doScript not working
              Harbs. Level 6
              var linkJumper = File(Folder.temp.fullName+"/In-Tools.html");
              linkJumper.open("w");
              var linkBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT="0; URL=http://in-tools.com"></head><body> <p></body></html>'
              linkJumper.write(linkBody);
              linkJumper.close();
              linkJumper.execute();
              
              

               

              Harbs

              • 4. Re: doScript not working
                Shonkyin Level 3

                Thanks again,

                 

                Shonky