Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all 2143 articles
Browse latest View live

Unable to execute script at line 1. book is undefined

$
0
0

I get an error reading "Unable to execute script at line 1. book is undefined" any time I attempt to open a script in AE. I tried calling Adobe Support but after half an hour on the phone they were unable to resolve the issue. I'm getting the error across 2018 & 2017, for all scripts, and closing CC Libraries (the solution mentioned in a different thread on this subject) doesn't stop it from occurring. These are scripts I've used for years, including Rift, Motion 2, Duik, etc. nothing unusual. Does anyone know how to fix this error? I would really appreciate the help.

Screen Shot 2018-09-11 at 4.37.37 PM.png


Console and Data Browser blank in ExtendScript

$
0
0

Hi,

I'm using the latest version of ExtendScript CC on windows 10, and if I select anything other than 'ExtendScript Toolkit CC' from the application target list in the top left, the JavaScript Console and Data Browser go blank. Even if I run a script.

 

If I then change back to 'ExtendScript Toolkit CC' as the target application I get all the data and console repopulated.

 

Am I doing something wrong here? I'd like to use After Effects 2018 as my target application but without the debugger working it's not very useful.

 

Cheers

 

Ryan

Unable to setValue() in a Slider

$
0
0

Hello everyone!

 

I am currently working on a project that needs to memorize certain values. So I tried to do this by writing them into a Slider but however I try it, there always is the error that ".setValue() is not a function". I have no idea what I am doing wrong. I can read the value at any time, but there seems no way to change it. Here is the line:

thisComp.layer("Regler").effect("EndeG")("Schieberegler").value;                    works!

thisComp.layer("Regler").effect("EndeG")("Schieberegler").setValue(1);          does not work!

Can someone explain that to me, cause in other (older) forum discussion they said, that this definitly should work.

Thanks in advance!

 

Dan

ScriptUI button active blue marker

$
0
0

Hi

 

I'm making a ScriptUI panel. I have a icon button which is based on an png image I load:

 

var button = container.add("iconbutton",undefined, imagePath, {"style":"toolbutton"});

 

The image isn't a perfect square, so it contains transparent pixels. Problem is, when I click the button it gets the focus, and all that is transparent will be AE-blue until it looses focus again.

 

Is there a way to avoid this? I tried using the "active" property, but that didn't seem to do much.

If I just could control the focus on the button...

 

Any help is greatly appreciated,

Jakob

Python and After Effects Scripting on Windows

$
0
0

So I recently stumbled across this:

 

GitHub - lohriialo/photoshop-scripting-python: Scripting in Photoshop is used to automate a wide variety of repetitive t…

 

As well as this here (somebody else has tried the same thing for AE, but it seems they were unsuccessful):

 

python - Adobe After Effects COM Object Model ID? - Stack Overflow

 

So it looks like you can actually do scripting for Photoshop in Python.  I tried one of the sample scripts and it worked perfectly.

 

However, I would also like to be able to do this for After Effects.  Unfortunately, it seems that nobody knows what the "com id" is that would go in the place of "Photoshop" in the following:

 

from win32com.client import Dispatch

app = Dispatch("Photoshop.Application")

 

I've tried all sorts of things in place of "Photoshop", like "Ae," After Effects," After_Effects," etc, but none of them seem to work.  Does anybody know how I can start scripting for After Effects in Python the way it was done in Photoshop?

 

For reference, I am using After Effects CC 2014.

aerender script

$
0
0

What I'm currently doing.

 

Using the new JSON feature I update my data using a JSON file, using aerender this works fine. The only flaw is that it runs awfully slow rendering it out.

 

What I can do.

 

if I open After Effects then launching a script I have built. I can change the data using a similar method as above but it's hard changing the data so that it's not treating it like a valueattime. This reduces the render time dramatically.

 

What I want to do.

 

I want AfterEffects to launch and then launch my script, update the data then export. Using similar bash info and what I've found trawling forums, the below is what I've come up with but it's not working. It's launches after effects successfully which leads me to believe it doesn't either like my script (Which works if I use manually), or my bash file isn't written correctly. This is more what I'm inclined to think. Unless someone says NOT A CHANCE CAN THIS BE DONE.

 

#! /bin/bash

 

/Applications/Adobe\ After\ Effects\ CC\ 2018/aerender -project /Users/scott/Desktop/Mess\ Around\ .aep & /Users/scott/Desktop/Source2.jsx;

/Applications/Adobe\ After\ Effects\ CC\ 2018/aerender -project /Users/scott/Desktop/Mess\ Around\ .aep -comp "1 - TEST" -output /Users/scott/Desktop/TEST/TEST.mov

 

Any help would be appreciated.

Edit Property Name in Essential Graphics Panel

$
0
0

Hi,

I added my properties in Essential Graphics Panel with script,

But not change property name in Essential Graphics Panel with Scripting!

How to change the property name in Essential Graphics Panel with script?Untitled.png

Rename property in essential graphics panel with a script

$
0
0

How can I rename a property added to the essential graphics panel with a script?


Check if Layer Has Specific Effect Applied To It

$
0
0

In extendscript, how can I check if a layer has a specific effect applied to it?  For example, suppose I want to check if a given layer has the "motion tile" effect applied to it.  Essentially, this is the pseudocode of what I want:

 

var layer_number = 1;
if (app.project.item(1).layer(layer_number) has motion tile applied)
{  alert("It does!");
}
else
{  add motion tile effect to app.project.item(1).layer(layer_number);
}

 

Can somebody please help me translate this pseudocode into real code that extendscript will recognize for After Effects?  Thanks.

How to "Convert To bezier Path" vía scripting

$
0
0

Hi everyone!

I´m looking for the way to convert a parametric shape (like Rect or Ellipse) into a bezier path.

I have tried it via

app.executeCommand('Convert To Bezier Path');

 

but since "Convert To Bezier Path" has not comand ID (if I ask with app.indMenuCommandId('Convert To Bezier Path'), returns 0), It doesn´t work.

 

Also it could be helpful to know the Bezier path of the parametric shape, even this is not converted to bezier path, but I don´t know how to do this either.

 

I have been looking for a long time, but I have no a clue!!

Could anybody help me?

Sending to media encoder and remove from render queue - error

$
0
0

Hi guys,

 

I'm sending a comp from render Queue  to Media Encoder,

and then I'm removing the item from render Queue.

 

but when I run the code, After effects crashes .

 

Any help?

 

This is my code:

{ var Comp=app.project.item(1);//my item // Scripting support for Queue in AME. // Requires Adobe Media Encoder 11.0. {     if (app.project.renderQueue.canQueueInAME == true)     {         // Send queued items to AME, but do not start rendering.         app.project.renderQueue.queueInAME(false);      }     else {         alert("There are no queued item in the Render Queue.");     } } app.project.renderQueue.item(1).remove();// remove comp from renderQueue; }

Linking dropdown in text animation to an expression

$
0
0

Hi, I'm a long time user of AE but still somewhat of a novice when it comes to expressions. Anyway, I'm trying to setup presets for the text animations since I do a lot of repetitive work. My question is can you link the dropdown option in text animation/ e.g. Position/ Advanced -> based on (Characters,Words, Lines dropdown) to an expression like a slider control so I don't have to keep digging into it. Since I usually put multiple text animation controls, it's annoying to have to dig into every control to change from Letters to Words or what have you. It'd be great to have it and control multiple drop downs with one control. Also, would be better not to have multiple versions of presets for each type of animation. I'm not sure if this even possible. Thanks.

 

ref.jpg

Loop through Comps and adding a layer causes problems

$
0
0

Hey Guys,

 

I am new to scripting for After Effects. Unfortunately i couldn't find a solution in the forum.

 

I've written a script that adds a null to all existing comps.

 

var proj = app.project;

var itemTotal = proj.numItems;

app.beginUndoGroup("Add Null")

for(var i = 1; i <= itemTotal; i++){

     var curItem = proj.item(i);

     if(curItem instanceof CompItem){

              //Add Null

               var newNull = curItem.layers.addNull();

     }

}

app.endUndoGroup()

 

Logically, the script creates a solid folder with the nulls, and this is my problem, the script ignores all comps that are now listed below this solid folder, but

works just fine for all comps above the created solid folder.

And when i have 3 comps named with a letter after the "S" the script puts 2 nulls in the first comp and ignores the other two comps.

 

Does anyone know how i can alter the script so it ignores the created solid folder and picks only the existing comps?

 

I tried several other ways, like items.length, but that also doesn't work.

 

I hope i made myself clear, english isn't my first langauge.

 

Thank you all very much in advance.

 

Best regards,

 

Marc

 

 

 

After Effects CC2018 & ExtendScript CC

Windows 10

get value of layer controller in aftereffects

$
0
0

Hi,

i need to get value of layer controller with script, since aftereffects 2018 layer controller has 2 drop downs, first drop down shows all layers, second drop down shows [effect, mask, effect & mask]. i could get value of first dropdown, but couldnt get value of second dropdown...

is it possible to read second dropdown value?

 

Best Regards

Daniel

getting comp in timeline

$
0
0

I want to return the name of the current comp in the timeline or return a string if the no comp is active in the timeline. app.project.activeItem won't work because it returns an active comp from the project window.

 

It might also work to test if the timeline is active....can find anything in the documentation.


Get markers from video exported from Premiere?

$
0
0

I'm setting up a workflow for the Templater plug-in but I need to get markers from the base video file which gets dynamically replaced.

 

When you drag a video (that was exported from Premiere) into Ae, it automatically shows layer markers for any markers you set in Premiere.

 

But when Templater dynamically replaces this footage, the markers do not get updated.

 

So I need an expression – or script? – that will grab the markers from a given MOV file and either save their timecodes to a file (JSON, text, CSV, whatever) or apply those markers to the right layer in Ae (before Templater renders.)

 

Just to be clear ... I need to read the markers from the QuickTime .mov file -- NOT from the Premiere app!

 

Can someone help me get started on this? Or know of something similar I can use as a starting point?

Typing on text—getting most recent character

$
0
0

Hi,

 

I feel like the answer to this is probably a resounding "no" but figured i'd ask out there for those who know buckets more than i do.

 

If i have a line of text typing on (say, with the typewriter effect) is there a way to recognize at any given time what the last character typed was?

 

(With the idea that then you could link an object property to a character—e.g. when an A is typed on, an object scale animation is activated.)

 

Thanks for any thoughts anyone has on this!

-tim.

How to automate solids in a shape layer with scripts?

$
0
0

Hello, I'm very new to the forum but I've been looking all around for a solution for this problem and I still haven't found anything that works. I've created a short video of what I want to do:

https://youtu.be/QKCd_S9hPvw

 

I basically have 26 existing rectangles that I want to change the properties of. I need a way to access their Opacity, Color, Size and Position, and also change these over time. How can I achieve this?

 

This is what my shape layer looks like. Any help would be greatly appreciated!

 

s.PNG

Find comp by specific character in extend script

$
0
0

Hi all my apologies if this information is already available I failed to find it under any of my searches.

 

I am looking for a way in extend script to identify if a comp name starts with a specific character, for example #.

so the file name could be

"# comp 1" or "# comp 2" or even "# toothpasteadvert".

 

any help would be appreciated many thanks.

Two Render Queue windows opening, then UserWorkspace.xml gets corrupt

$
0
0

Hi all,

 

I've got a complicated bug maybe someone can shed some light on, or at least help me figure out how to diagnose:

 

Some projects will have the user's workspace "attached" - on opening the project the windows will rearrange to whatever layout that user had. On changing back to a saved Workspace (any Workspace - default ones or saved user), the layout changes to the correct layout but now with a second Render Queue in a floating palette. At this point AE will  crash  within a minute or two.

 

There will be a new UserWorkspace.xml file in ModifiedWorkspaces and AE won't open the original project until that XML gets deleted. The "problem" project will crash as soon as it opens. Deleting the XML will fix the issue.

 

I can't reproduce enough conditions yet to figure out the trigger. One possible candidate is our render farm plugin which is just a dockable jsx scriptUI panel - it doesn't do anything unusual but the problem seems to happen more often when its docked in a layout that gets changed.

 

Does anyone have any ideas?

Viewing all 2143 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>