Expressions/Scripts/Presets

Search found 22 matches

  • 1
  • 2
by runegan
Wed Apr 19, 2017 5:17 am
Forum: Script requests
Topic: need modification in rd_slated.jsx script
Replies: 4
Views: 171

Re: need modification in rd_slated.jsx script

You can do this by removing this line (239): slateComp.workAreaDuration = slateComp.frameDuration Now the script does not change the workArea at all. Then change 'Photoshop' on this line (243) to the name of the OutputModule template you want to use: rqItem.outputModule(1).applyTemplate("Photos...
by runegan
Wed Apr 19, 2017 5:09 am
Forum: Scripts Discussion
Topic: How can I get the number of word in a text layer?
Replies: 2
Views: 117

Re: How can I get the number of word in a text layer?

There is probably a more accurate way to to this is, but this will be accurate most of the time:
function getNumWords( string ) {

  // Split the string where there is spaces, then count the array length
  return string.split( ' ' ).length
}
by runegan
Thu Mar 30, 2017 1:29 am
Forum: Scripts Discussion
Topic: Cut layer through Marker
Replies: 2
Views: 206

Re: Cut layer through Marker

I'm guessing you are trying to set the inPoint of the layers without moving the outPoint? Your code works when used on comp/footage layers, but when used on solids the outpoint is also moved, but any keyframes stay in place, so the only thing you have to do is store the outPoint before setting the ...
by runegan
Sat Mar 11, 2017 5:14 pm
Forum: Expression Discussion
Topic: How to Apply specific values to a Slider Control
Replies: 3
Views: 321

Re: How to Apply specific values to a Slider Control

@zlovatt:
In case you don't know: there is a 'clamp' expression function that does the same as your min/max code.

Math.max(0, Math.min(slider, valuesArray.length - 1));

Is the same as:

clamp( slider, 0, valuesArray - 1 )
by runegan
Sat Mar 11, 2017 5:03 pm
Forum: General Scripts Library
Topic: AE is crashing
Replies: 4
Views: 304

Re: AE is crashing

Are you able to create some sample code that reproduces the problem? How are you importing your libraries? Are you using @include/#include? Using multiple files should not be a problem. I have been dealing with 30+ files without any trouble. I'm thinking it may be a problem with the resolution or du...
by runegan
Tue Mar 07, 2017 9:45 am
Forum: General Scripts Library
Topic: Create sort of Metadata in AE project
Replies: 8
Views: 315

Re: Create sort of Metadata in AE project

Pulling the variables out to the outer scope is not a bad idea, as long as they are still inside your main function (i.e not polluting the global scope). Putting the variables so they are accessible from all functions can be tricky if they are going to change between executions (e.g a layer variable...
by runegan
Mon Mar 06, 2017 3:41 pm
Forum: General Scripts Library
Topic: Create sort of Metadata in AE project
Replies: 8
Views: 315

Re: Create sort of Metadata in AE project

Just to be clear: any variable you declare in your script that is not inside a function will become a global variable. You should look up javascript scope. Most people would recomend wrapping your script in a function. So you do not declare or modify any global variables, which can have unforseen co...
by runegan
Mon Mar 06, 2017 12:02 pm
Forum: General Scripts Library
Topic: Create sort of Metadata in AE project
Replies: 8
Views: 315

Re: Create sort of Metadata in AE project

You are already able to read most of the comps metadata: comp.bgColor; comp.width; comp.height; comp.numLayers; All of those, except numLayers, are read/write. So you can set to something else to change the comp. Take a look at http://docs.aenhancers.com/compitem/, http://docs.aenhancers.com/avitem/...
by runegan
Thu Feb 23, 2017 6:36 am
Forum: Scripts Discussion
Topic: How to update UI apps ?
Replies: 3
Views: 1769

Re: How to update UI apps ?

Do you have to close and reopen the comp? Or just deselect and select it in the project panel? I can't see any function to close a comp, but if you have to close it, you could try creating a new comp, open it, with comp.openInViewer(), then opening the comp you have changed in the same way. This wil...
by runegan
Thu Feb 23, 2017 5:57 am
Forum: Scripts Discussion
Topic: RegExp bug ?
Replies: 1
Views: 236

Re: RegExp bug ?

It seems to be a bug, but I can't find any information if that is because negative lookahead regex was not implemented in the javascript engine extendscript is using or a bug in extendscript itself. Either way, you can achieve what you are trying to do by using two regexes and testing the string aga...
by runegan
Tue Feb 07, 2017 7:00 am
Forum: General Scripts Library
Topic: Target specific words in text
Replies: 1
Views: 375

Re: Target specific words in text

You can only set one style for a text layer via script, if you need multiple styles you need to create more text layers and find a way to place them. If you only need to change the color, or other properties that is not the font, you can maybe look into using an expression selector on the text layer...
by runegan
Sun Jan 29, 2017 9:07 pm
Forum: Script requests
Topic: post render script to move the rendered file
Replies: 3
Views: 2106

Re: post render script to move the rendered file

Here is a script that adds a comp to the renderqueue, sets its output file, watches the renderqueue item's status changes and when the item is done, uses the MacOS shell command "mv" to move the file to the correct location. function renderAndMoveFile( compToRender ) {     var outputFolder...
by runegan
Tue Jan 24, 2017 6:08 am
Forum: Script requests
Topic: Convert 3d Rotation to Orientation
Replies: 10
Views: 4651

Re: Convert 3d Rotation to Orientation

Hey, this is a rewrite of that script which will convert orientation values to rotation values for keyframes on all orientation properties in the active comp. It does not take the original values of the rotation properties into account, so any values or keyframes on those properties may be overwritt...
by runegan
Fri Jan 13, 2017 4:05 pm
Forum: Scripts Discussion
Topic: Could somebody help out with a modified script?
Replies: 4
Views: 378

Re: Could somebody help out with a modified script?

Hmm, when I try to run the script, and there is already a comp in the renderqueue, the script works just fine. What is not working for you?
by runegan
Fri Jan 13, 2017 6:16 am
Forum: Scripts Discussion
Topic: Could somebody help out with a modified script?
Replies: 4
Views: 378

Re: Could somebody help out with a modified script?

Hi Marc! Welcome! When I run this script, I first get an error when trying to access the renderqueue, because there is nothing added to the renderqueue, somewhere in you should add a comp to the renderqueue using  app.project.renderQueue.items.add( yourCompItemVariable ); // In your code that could ...
  • 1
  • 2