Search found 203 matches

by nab
June 5th, 2010, 6:20 am
Forum: Scripts Discussion
Topic: Executing Script within another Script
Replies: 4
Views: 5595

Re: Executing Script within another Script

Look at "call_nested_script.jsx" that ships with AE. Its is located in the "(Instructional)" folder, a subfolder of the Script folder.
by nab
May 17th, 2010, 2:59 pm
Forum: Expression Discussion
Topic: including external text file in an expression
Replies: 6
Views: 11301

Re: including external text file in an expression

You can read a file and eval its content using evalFile, like this:

Code: Select all

$.evalFile(path_to_your_file)
This should work in both CS4 and CS5.
by nab
February 27th, 2010, 10:14 pm
Forum: Scripts Discussion
Topic: Determining Width and Height of a Text Layer
Replies: 62
Views: 64129

Re: Determining Width and Height of a Text Layer

Hey guys, Here is another technique to determine the size of a text layer. The trick is to notice that when you "Fit to Comp Width (or Height)" a text layer, the layer is correctly scaled to fit the comp size (because internally AE somehow knows the size of the text). The new scale could then be use...
by nab
January 25th, 2010, 9:23 am
Forum: Scripts Discussion
Topic: Edit Text bug (Snow Leopard)
Replies: 1
Views: 3280

Edit Text bug (Snow Leopard)

Hi guys, Could someone confirm that the appearence of Edit Text control on Snow Leopard differs from Leopard (with AE CS4). It looks like everything below the baseline is not visible. Thanks var pal = new Window("palette"); pal.et = pal.add("edittext", undefined, "Pipeline"); pal.center(); pal.show(...
by nab
January 20th, 2010, 11:30 pm
Forum: Scripts Discussion
Topic: Converting Frames to Seconds
Replies: 2
Views: 3409

Re: Converting Frames to Seconds

Only one loop is required, something like this: var usrIncSec = 0.5; // seconds var layer = app.project.activeItem.selectedLayers[0]; app.beginUndoGroup("Add Markers"); for (var t = layer.inPoint + usrIncSec; t <= layer.outPoint - usrIncSec; t+=usrIncSec) { layer.Marker.setValueAtTime(t, new MarkerV...
by nab
November 27th, 2009, 12:23 pm
Forum: Scripts Discussion
Topic: Embedding images into a script
Replies: 1
Views: 3228

Re: Embedding images into a script

Not sure it is simpler, but here is another road I've explored. Assuming we are dealing with little iconic image, typically of size less 50x50 px, you can sample every image pixel and create for each pixel a 1px group (with backgroundColor set to the current pixel color). In this demo, the icon imag...
by nab
November 21st, 2009, 5:05 am
Forum: Scripts Discussion
Topic: Detecting Photo Image Orientation
Replies: 6
Views: 7847

Re: Detecting Photo Image Orientation

I would say it's not possible but I'm no xmp expert at all.
You could apply the rotation in AE, or use command line tool to rotate the image (e.g. 'convert -rotate' from ImageMagick, look at the doc here)
by nab
November 10th, 2009, 5:37 am
Forum: Scripts Discussion
Topic: Test for sequence
Replies: 2
Views: 3263

Re: Test for sequence

Perhaps with the frameRate (an image sequence should have a frameRate > 0).
by nab
November 10th, 2009, 5:36 am
Forum: Scripts Discussion
Topic: scrollbar not working...docs no help
Replies: 2
Views: 3417

Re: scrollbar not working...docs no help

You could use a ListBox. You may also want to set the multiselect property to true.
by nab
October 4th, 2009, 2:22 pm
Forum: Scripts Discussion
Topic: Detecting Hidden properties
Replies: 2
Views: 3661

Re: Detecting Hidden properties

You could try the elided attribute, cf scripting guide cs3 p142. I've never used it.
by nab
September 28th, 2009, 2:09 pm
Forum: Scripts Discussion
Topic: Detecting Photo Image Orientation
Replies: 6
Views: 7847

Re: Detecting Photo Image Orientation

If the Orientation info is tagged in the photo file, you can retrieve its value using XMP metadata. . import AdobeXMPScript lib . new XMPFile() . getXMP() . closeFile(0) . xmpObj.iterator() . while (next = it.next()) . orientation test . retrieve tag value example of orientation tag value 1:normal 6...
by nab
September 24th, 2009, 8:57 pm
Forum: Expression Discussion
Topic: Roulette expression
Replies: 16
Views: 16132

Re: Roulette expression

As an alternative, you can give a try to this 30-lines script. It doesn't require Null nor expression. When the start button is clicked, the comp time is set to the wheel layer in point (typically 0), and two rotation keyframes are created (with ease interpolation). The second keyframe value is pick...
by nab
September 21st, 2009, 2:21 pm
Forum: Scripts Discussion
Topic: Weird behavior when adding multiple sliders
Replies: 2
Views: 4259

Re: Weird behavior when adding multiple sliders

I've experienced similar problem in my scripts, but in most cases it's easy to find a workaround. In your case, I would write something like this: var sldNames = ["First Opacity", "Second Opacity", "Third Opacity"]; var sldValues = [20, 20, 20]; for (var i = 0; i < sldNames.length; i++) { var sldEff...
by nab
September 13th, 2009, 9:04 am
Forum: Scripts Discussion
Topic: Add project item (solid) to compItem through script
Replies: 5
Views: 5692

Re: Add project item (solid) to compItem through script

When you replace an item with something else, the change is reflected in all comps that use an instance of that item. You don't have to walk through each comp individually. var found = false; for (var i = 1; !found && i <= app.project.numItems; i++) { if (app.project.item(i).name == "3D Bend.mov") {...
by nab
September 10th, 2009, 4:12 pm
Forum: Scripts Discussion
Topic: Add project item (solid) to compItem through script
Replies: 5
Views: 5692

Re: Add project item (solid) to compItem through script

mySolid is a project item, you can add it to a comp like this:

Code: Select all

preComp1.layers.add(mySolid);