-
cs6 scripting – toggle all proxies – can’t find a “ProxyExisting” value
Hi,
Help! 🙂
I’m very new to scripting in AE (Although have used lot’s of OM type stuff using VB in Softimage).
I want a simple script to toggle all proxies on & off.
I’ve dragged my slowly melting brain as far being able to loop through all project elements & turn proxies off, as AE will turn a proxy off whether or not one exists.
I haven’t found a way to test if there’s an existing proxy to turn one again. The script will stop if there’s no existing proxy attached to a project item.
Any help would be gratefullt recieved.
Cheers,
Adam.
{
// ams_ToggleAllProxies.jsx
//
// This script one day will toggle all proxies on & off.function ams_ToggleAllProxies()
{clearOutput()
writeLn("ams ToggleAllProxies");var oItems = app.project.items;
var totalItems = oItems.length;
var temp=1writeLn("Number of items is: "+ totalItems)
for (var i=1; i<oItems.length; i++) {
$.writeln("item:[" +i+ "] is " + app.project.item(i).name);
$.writeln("proxyFlag:[" +i+ "] is " + app.project.item(i).useProxy);// I WANT TO CHECK A VALUE OF THE PROXY PATH TO SEE IF A PROXY EXISTS BUT I DON'T KNOW HOW.
//$.writeln("type:[" +i+ "] is " + app.project.item(i).proxySource.path);// JUST AN "IF" FOR WHEN I HAVE A PROXY-EXISTING TYPE VALUE TO TEST.
if (temp=1)
{
$.writeln("AAGHH")// THIS DOESN'T WORK WHEN NO PROXY EXISTS AND STOPS THE SCRIPT
app.project.item(i).useProxy=true// THIS DOES WORK AND TURNS OFF A PROXY WHETHER THERE'S ONE IN USE OR NOT - HALF WAY THERE
//app.project.item(i).useProxy=false
}}
alert("Proxies Toggled")
}ams_ToggleAllProxies();
}