AE ENHANCERS

Expressions/Scripts/Presets
It is currently Tue Apr 22, 2014 11:54 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Font search
PostPosted: Thu Sep 11, 2008 10:27 pm 
Offline

Joined: Tue Jul 15, 2008 5:25 am
Posts: 5
Location: Bergen, Norway
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


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Fri Sep 19, 2008 9:45 am 
Offline

Joined: Wed Jul 20, 2005 12:07 am
Posts: 139
You cannot query font properties as of yet. It should be possible to find strings with indexOf() or regex(). Not sure what exactly you are looking for.

Mylenium

_________________
[Pour Mylène, ange sur terre]


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Mon Nov 10, 2008 10:55 am 
Offline

Joined: Mon Nov 10, 2008 9:35 am
Posts: 5
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


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Mon Nov 10, 2008 12:24 pm 
Offline

Joined: Wed Jul 20, 2005 12:07 am
Posts: 139
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.


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.

Mylenium

_________________
[Pour Mylène, ange sur terre]


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Tue Nov 11, 2008 3:05 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 695
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 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);
}


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Fri Nov 14, 2008 10:01 am 
Offline

Joined: Sat Jun 14, 2008 9:22 pm
Posts: 11
Location: South Carolina
I can't wait until my AE CS4 upgrade gets here so I can try that new font scripting stuff out! That would be really handy at my job.


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Thu Nov 20, 2008 9:49 am 
Offline

Joined: Mon Nov 10, 2008 9:35 am
Posts: 5
Yes, this should be useful.
I don't suppose anyone knows if the text bounding box is available to scripts in CS4?


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Thu Nov 20, 2008 1:04 pm 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 695
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


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Thu Nov 20, 2008 2:39 pm 
Offline

Joined: Mon Nov 10, 2008 9:35 am
Posts: 5
No I hadn't spotted that, thanks.
I guess my thread search queries weren't on the right wavelength! :)


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Sat Feb 21, 2009 10:01 am 
Offline

Joined: Mon Nov 22, 2004 5:45 pm
Posts: 12
Location: vegas
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!

:-)

_________________
http://jayse.us


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Mon Feb 23, 2009 1:01 pm 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 695
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


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Thu Apr 30, 2009 6:54 pm 
Offline

Joined: Sat Mar 21, 2009 2:01 am
Posts: 5
I am waiting by the phone so to speak for you to call and tell my my prince (pt_edit) is here!


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Thu May 07, 2009 3:50 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 695
Location: London, UK
I'm releasing betas of pt_TextEdit and pt_ExpressEdit right now. See here for details:
viewtopic.php?f=9&t=1380
viewtopic.php?f=9&t=1381


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Tue Feb 02, 2010 3:32 pm 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 695
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


Top
 Profile  
 
 Post subject: Re: Font search
PostPosted: Wed Oct 13, 2010 9:57 am 
Offline

Joined: Tue Jun 16, 2009 1:07 pm
Posts: 35
Location: Santa Clarita, CA
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 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);
}

I'm wondering if I can use the script above that Paul wrote to manipulate multiple styles within the same text field...

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:
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);


I realized that this still doesn't account for the actual text itself... firstName = shawn, lastName = baden...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group