Skip to main content
February 8, 2011
Question

Url link in UI

  • February 8, 2011
  • 2 replies
  • 1330 views

Hello everyone,

I am writing my first script and I have run into a problem.  In my UI I have included an image that I would like to turn into a URL link.

I think this is possible, as I have seen buttons as URL links.

Can anyone help?

Thanks a million,

Tyler

This topic has been closed for replies.

2 replies

Participating Frequently
May 16, 2012

Here is an example of what I use to display a web page (to run directly from After Effects) :

var win = new Window ("dialog");

var winBrowserCmd = "C:/Program Files/Internet Explorer/iexplore.exe";

var macBrowserCmdStart = "osascript -e 'open location \"";

var macBrowserCmdEnd = "\"'";

var BtnURL = win.add("button", undefined, "Check for update"); // var BtnURL = win.add ("iconbutton", undefined, "~/Desktop/img.png" );

BtnURL.onClick = LinkToURL;

win.add ("button", undefined, "Close", {name: "ok"});

function LinkToURL()

        {

            var URL = "http://www.google.fr/"; // your web page

           

            if ($.os.indexOf("Windows") != -1)

                system.callSystem(winBrowserCmd + " " + URL);

            else

                system.callSystem(macBrowserCmdStart + URL + macBrowserCmdEnd);

           

        }

win.show ();

Participating Frequently
March 3, 2011

write to image click event:

system.callSystem("explorer.exe \"http://your.url.com\"") ;

option "Allow Scripts to Write Files and Access Network" must be true

P. S.

Study the Flash Builder is faster and more grateful than the JS interface.

March 4, 2011

Thanks alruden2!

I do have a couple more questions though.

Is there a way to, instead of launching explorer, make it launch the user's default browser? and for pc and mac?

Also, is there a way to display an image that has been uploaded online, instead of having to place the image into the ScriptUI Panel folder?

Thanks again,

Tyler

Inspiring
March 4, 2011

"start http://aescripts.com"  works on windows to launch a url using the user's default browser but beware that on XP it takes a very long time so in my scripts I use the explorer method mentioned above for XP and start for Vista and Win7.  Anyone still using XP is probably using IE anyway, lol.  On mac you use "open http://aescripts.com"

As for images you can encode them into your script file using hex or base64 or any other encoding method you want then decode to a file and then read the image in when you need it. The only requirement for this is that the user needs to turn on the "Allow scripts to write files" pref.

-Lloyd