This may be a simple one but I can't figure it out. How can I open a web page in the main browser from extendscript as I would do with window.open()
in Javascript?
I am targeting After Effects and would like it to work on both OS X and Windows.
This may be a simple one but I can't figure it out. How can I open a web page in the main browser from extendscript as I would do with window.open()
in Javascript?
I am targeting After Effects and would like it to work on both OS X and Windows.
In After Effects you can simply do it using the system object, as Dirk mentioned. However you need several things for that:
checking that the script can access the network:
checking of the OS:
os-dependent system calls:
The scope of the question apparently has been refined to After Effects (AE), so I add another answer specific to that application.
On my Machine AE CS6 does not produce an object model file for display by the ExtendScript Toolkit. Please retry it yourself, the object model viewer is in the help menu of ESTK.
Anyway, the ESTK data browser does works. If you target AE, you'll see a couple of objects and classes. Eventually check some more menu items in the databrowser panel flyout menu. I had a deeper look at the app object itself (no openUrl() there) and also found a "system" object. Expand that and you see several interesting methods.
The following script opens a URL on the Mac. I have not tried Windows, maybe it is even the same.
As this is the first time I launched AfterEffects, I might have missed better ways.
One application independent way is to write an operating system's representation of the URL into a file, then execute() the file.
On the Mac that would be a .webloc file. The underlying format is "plist binary", if you prefer to generate xml, create a sample webloc by drag&drop from the browser address and convert it:
To invoke that webloc, run the ExtendScript
Provided you have access to CSInterface.js:
You can do anything on your local computer - commandline and anything else in a VBS file, and you can launch a vbs file from javascript like this:
Here is your vbs script: