Hi! Is it possible to make a script that can find layers that use a certain font, and/or search in text being used to find words? Like the effects search script that can find layers that uses certain effects?
In my job I have to update text in old projects that has been made by others, and it's always a time-drain to navigate through projects that sometimes look like a bombed brothel
- Cptzap
Font search
Moderator: byronnash
I have somewhat glumly arrived at this conclusion also. I spent ages yesterday trying to find out which property I could get my script to query so that I could find out what font-family, weight and size a text layer was using without any success whatsoever.
Does anyone have any idea why this information is so hard to get or when it might likely become available? Seems at odds with how accessible everything else is.
I'm now considering either adding a custom property, or having some kind of prefix in the actual source text (the script I'm writing is for exporting animation information for our internal tech to use.)
Cheers
Simon
Does anyone have any idea why this information is so hard to get or when it might likely become available? Seems at odds with how accessible everything else is.
I'm now considering either adding a custom property, or having some kind of prefix in the actual source text (the script I'm writing is for exporting animation information for our internal tech to use.)
Cheers
Simon
I guess you would have to spend considerable effort on it and start by separating the streams for this info in AE itself first. My knowledge is superficial at best, but handling fonts via scripts seems also complicated and limited in other Adobe apps, so it's surely a more generaic problem, probably due to the many options that need to be covered.strawdog wrote:Does anyone have any idea why this information is so hard to get or when it might likely become available? Seems at odds with how accessible everything else is.
Mylenium
[Pour Mylène, ange sur terre]
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
After Effects CS4 added more scripting support for text properties, but I don't think the documentation is available yet. Here's an example of how you'd query and change the font and font size:
Code: Select all
{
// select a text layer before running this script
var activeItem = app.project.activeItem;
var theValue = activeItem.selectedLayers[0].sourceText.value;
alert("font = " + activeItem.selectedLayers[0].sourceText.value.font);
alert("fontSize = " + activeItem.selectedLayers[0].sourceText.value.fontSize);
theValue.font = "ArialMT";
theValue.fontSize = 24;
activeItem.selectedLayers[0].sourceText.setValue(theValue);
alert("font = " + activeItem.selectedLayers[0].sourceText.value.font);
alert("fontSize = " + activeItem.selectedLayers[0].sourceText.value.fontSize);
}
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
There's nothing new related to that in CS4. Do you know about sourceRectAtTime() that was added in CS3? Also, maybe you've already seen that there are quite a few posts about this on here.
Paul
Paul
Lloyd gave a preview of just such a script "pt_TextEdit" at his aeny presentation a few days ago http://vimeo.com/3031889?pg=embed&sec=3031889&hd=1
only question is... Paul - WHEN??? when can we have it!? Looks excellent!
only question is... Paul - WHEN??? when can we have it!? Looks excellent!
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
pt_TextEdit is undergoing a bit of a rewrite at the moment, but it should be ready within the next few weeks.
Paul
Paul
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
I'm releasing betas of pt_TextEdit and pt_ExpressEdit right now. See here for details:
http://www.aenhancers.com/viewtopic.php?f=9&t=1380
http://www.aenhancers.com/viewtopic.php?f=9&t=1381
http://www.aenhancers.com/viewtopic.php?f=9&t=1380
http://www.aenhancers.com/viewtopic.php?f=9&t=1381
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
It took a little longer to finish than I'd anticipated but pt_TextEdit is finally released:
Watch demo and download pt_TextEdit from aescripts.com
Watch demo and download pt_TextEdit from aescripts.com
I'm wondering if I can use the script above that Paul wrote to manipulate multiple styles within the same text field...Paul Tuersley wrote:After Effects CS4 added more scripting support for text properties, but I don't think the documentation is available yet. Here's an example of how you'd query and change the font and font size:Code: Select all
{ // select a text layer before running this script var activeItem = app.project.activeItem; var theValue = activeItem.selectedLayers[0].sourceText.value; alert("font = " + activeItem.selectedLayers[0].sourceText.value.font); alert("fontsize = " + activeItem.selectedLayers[0].sourceText.value.fontSize); theValue.font = "ArialMT"; theValue.fontSize = 24; activeItem.selectedLayers[0].sourceText.setValue(theValue); alert("font = " + activeItem.selectedLayers[0].sourceText.value.font); alert("fontSize = " + activeItem.selectedLayers[0].sourceText.value.fontSize); }
For example: First name in HelveticaBld and last name in HelveticaLt on the same line. They would be in the same line so I couldn't set theValue as the selectedLayer because there would be two values for the same line... Am I making sense?
Would something like this work? I'm using CS5.
Code: Select all
var name = comp.layer(i).sourceText;
firstNameValue.font = "Helvetica Neue LT Std";
firstNameValue.fontstyle = "73 Bold Extended";
firstNameValue.fontsize = 24;
lastNameValue.font = "Helvetica Neue LT Std";
lastNameValue.fontstyle = "55 Roman";
lastNameValue.fontSize = 24;
name.setValue(firstNameValue.toUpperCase() + " " + lastNameValue);