4 Replies Latest reply on May 9, 2016 6:50 AM by Puthoskey

    Links JavaScript

    Puthoskey

      Hi guys!

      Please help me with this...

      How can I go to a website using javascript inside Illustrator?

       

      I have a little button and would like when I do click, open the browser

      and go to the website.

       

      Many thanks guys!

        • 1. Re: Links JavaScript
          te_co Level 3

          in an HTML 5 panel

           

          var csi = new CSInterface()

          csi.openURLInDefaultBrowser("url");

          • 2. Re: Links JavaScript
            Silly-V Adobe Community Professional

            From this thread:

            Re: Link to a web page from AI javascript?

             

            16. Re: Link to a web page from AI javascript?

            Muppet MarkRockstar

             

            As it would appear to work mac/pc then I would just wrap it to use like so… I've changed the location to the system temporary junk… Out of sight, and it should get cleaned out at system restart me thinks… I did try f.remove() but that would appear to take place faster than the file can be evoked so I removed it. I doubt very much the size of these would ever be a problem…

             

             

            1. openURL( 'www.google.com' ); 
            2.  
            3. function openURL( address ) { 
            4.  
            5.           var f = File( Folder.temp + '/aiOpenURL.url' ); 
            6.             
            7.           f.open( 'w' ); 
            8.             
            9.           f.write( '[InternetShortcut]' + '\r' + 'URL=http://' + address + '\r' ); 
            10.             
            11.           f.close(); 
            12.             
            13.           f.execute(); 
            14.    
            15. }; 
            1 person found this helpful
            • 3. Re: Links JavaScript
              Qwertyfly... Level 4

              wonder if it is possible to write a batch rather then a .url

              and have the batch file trigger something like a callback.

              I just cant think of the best way to get the batch file to trigger the callback.

               

              but as this will always overwrite the last .url file, I don't see the point.

              it is just 1 file, stashed away in some location most users don't even know exists, and its a total of about 1kB.

              • 4. Re: Links JavaScript
                Puthoskey Level 1

                Many thanks guys! Worked like a charm xD