Skip to main content
Dan Ebberts
Community Expert
Community Expert
November 8, 2023

Scripting: sourceRectAtTime() broken in 24.4.0 x5 (and x6)

  • November 8, 2023
  • 2 replies
  • 281 views

A bunch of previouslly-reliable scripts that use sourceRectAtTime() no longer work with latest beta builds. Try this:

1. New Comp

2. New text layer

3. run this script:

var myTextLayer = app.project.activeItem.layer(1);
var myRect = myTextLayer.sourceRectAtTime(0,false);
alert(myRect.width);

The width comes back 0

This topic has been closed for replies.

2 replies

Dan Ebberts
Community Expert
Community Expert
November 8, 2023

Yes, 24.2.0--sorry.  The text width looks to be about 250 px. Same result if the script creates the text (which is actually how we first noticed the issue). My partner noticed the problem (with a lot of our scripts) running x6 on a Mac. I was able to repro with x5 on my Windows system.

JohnColombo17100380
Community Manager
Community Manager
November 8, 2023

Hi @Dan Ebberts,

Thank you for reporting this issue. For clarification, do you mean 24.2.0 rather than 24.4.0?

 

In testing this out, I'm not seeing the same result—width is alerted as the correct number rather than zero. What was the expected width of the Text layer you created in step 2? Do you see the same result if your script handles the creation of the Text?

 

Thanks for reporting this issue and for any further information you can provide, 

- John, After Effects Engineering Team