Skip to main content
Inspiring
December 5, 2012
Answered

Link to a web page from AI javascript?

  • December 5, 2012
  • 1 reply
  • 6538 views

I've written a script with a ScriptUI interface, which other people will be using. I'd like to include a 'help' button in the interface, which ideally would connect to a web page with more details. (The alternative is to create the 'help' window in javascript, but the web page already exists and it would be a shame not to use it.)

From what I've read, other Creative Suite programs may be able to connect to the web with javascript, but apparently not Illustrator. Can anyone please confirm this is so? Or better, point me towards a solution!

With thanks.

This topic has been closed for replies.
Correct answer Muppet Mark

Very nice Muppet Mark, good thread.


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…

openURL( 'www.google.com' );

function openURL( address ) {

          var f = File( Folder.temp + '/aiOpenURL.url' );

          

          f.open( 'w' );

          

          f.write( '[InternetShortcut]' + '\r' + 'URL=http://' + address + '\r' );

          

          f.close();

          

          f.execute();

 

};

1 reply

Inspiring
December 5, 2012

Did you already look at the socket object in the JavaScript Tools Guide…?

Inspiring
December 5, 2012

Yes, it's useful. But sadly, only if you're running Bridge, InDesign, InCopy, After Effects or Photoshop! The object is not available to Illustrator users.

Larry G. Schneider
Inspiring
December 11, 2012

muppet mark is manc… that makes me a looser but for sunday only… that other rubbish is for the rest of the world


Just 'cause I wasn't here to nominate someone else I get stuck with planning the party, huh? With the diversity of time zones, could be quite long. Seeing as how I'm -8 you guys are going to have to be up real late or I have to start real early.