2 Replies Latest reply on Nov 20, 2012 10:23 AM by Roy Marshall

    [JS] ScriptUI - URL Links in Dialogues

    Roy Marshall Level 1

      HI.

       

      I have a left field question, is it possible to put a hyperlink to a web URL in a scriptUI window?

      I have some video tutorials that I want to be able to link to from the UI and at the moment all I can do is have a button going to a new alert/promt containing a url instructing the user to copy and paste in their browser.

      Screen Shot 2012-11-20 at 9.33.34 AM.png

      Can this link be directly placed as a hyperlink in the palette?

       

      Just wondering...

       

       

      Cheers

       

      Roy

        • 1. Re: [JS] ScriptUI - URL Links in Dialogues
          Trevorׅ Adobe Community Professional

          Hi Roy,

           

          Make a button and use a code like this one from Harbs

          See http://forums.adobe.com/message/4390237#4390237

          GotoLink()
          
          function GotoLink(url){
                      url = url || "http://in-tools.com";
                      if(app.version>6){
                          if(File.fs=="Macintosh"){
                              var body = 'tell application "Finder"\ropen location "'+url+'"\rend tell';
                              app.doScript(body,ScriptLanguage.APPLESCRIPT_LANGUAGE);
                          } else {
                              var body =  'dim objShell\rset objShell = CreateObject("Shell.Application")\rstr = "'+url+'"\robjShell.ShellExecute str, "", "", "open", 1 '
                              app.doScript(body,ScriptLanguage.VISUAL_BASIC);
                          }
                      }
                      else {
                          linkJumper = File(Folder.temp.absoluteURI+"/link.html");
                          linkJumper.open("w");
                          var linkBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT="0; URL='+url+'"></head><body> <p></body></html>'
                          linkJumper.write(linkBody);
                          linkJumper.close();
                          linkJumper.execute();
                      }
                  }
          

           

          Regards

           

          Trevor

          • 2. Re: [JS] ScriptUI - URL Links in Dialogues
            Roy Marshall Level 1

            Nice.  Thanks for that.  Works a treat! (and thanks Harbs too)

             

            Roy