Get a sample of the content text layer

It would seem that the width and height of a text layer property are always the model they have. The content of a text layer can exceed the width of comps, but queerying with always returns the width of the model. Is there a way to recover the actual width of the layer of text for use in javascript?

You must use sourceRectAtTime():

layer = app.project.activeItem.layer (1);

Rect = layer.sourceRectAtTime(0,true);

Alert (Rect.Width);

It returns an object with left, top, width and height attributes.

Dan

Tags: After Effects

Similar Questions

  • [ADF, JDev12.1.3] How to align vertically in the middle of the content (text + icon) of an af:button?

    Hallo,

    the answer is in the topic

    I guess it can be done in CSS... I've tried a few, but I managed only to horizontally align the content in the Center.

    Thank you

    Federico

    Hi see Federico - Ashish Awasthi (Jdev/ADF) Blog: Customize with af: button (font, shape, size, color etc) count - Oracle ADF (12.1.3)

    You can use like this in CSS

    AF | : button {text

    padding-top: 12px;

    }

    Thank you

  • How to get changes made to the TLF text

    Hello

    Is there a way to TLF to get the number of changes made to the TLF text? Like if I applied underscore of a text or changed the font size, etc.

    Can I get these changes made to the text?

    As whenever I do an operation, can I keep the operation whenever an operation is complete.

    UndoManager can undo changes through the EditManager, but not the changes directly to the TextFlow. Similarly, we do operations and send messages of operation for the things happening across the EditManager. I would say that if you want to remove the terminal node, you can remove it by getting his range of text and remove it through the EditManager. Then, the change would be infeasible. Try something like this:

    editManager.deleteText (new SelectionState (textFlow, leaf.getAbsoluteStart (), leaf.getAbsoluteStart () + leaf.textLength));

    -robin

  • The PSD text layer is converted as pictures when they are imported for Muse

    I want to import PSD files text layers in Muse as text and not as images. Currently when I insert text layers, they are converted into images. Is there a way to do this?

    Flat copy / paste of text layer psd to a text box in Muse

  • Get a box of the caption text is displayed in 2 places on the same page?

    Hello

    Is there anyway to get the live legend on a page, appears in another area of the page and the update, if the information changes?

    For example... we have images we would like to use the functionality of live of legend, in the version number and the name of this particular, when image its places in the Description field of the Photoshop file.

    Is also on the bottom of my page layout, which this information needs to live. Still, thanks to a variable or something that could be archived, so that the text field of legends may live far from the image as a copy and update if the image information changes?

    I know it's a long shot, but I wanted to put out there?

    Thank you

    Babs

    Hey, if you group the live legend with the image then they do not have to touch.

    I just tried with a picture and he grouped with 2 boxes various legend direct (and placed the other far from the image).

    It works!  They both have the legend.  They must stay together, but I guess you can understand a way of doing that is simple (maybe another layer?).  I hope that's what you hear.

    Thank you, Phyllis

  • How to move all mailboxes to the new text layer?

    Hello

    So, we work with a book that will be printed in both languages. The color plates will be the same in both, with just the black plate text change. We should have implemented in a single document with color as the base layer and the two languages as two separate layers over the top, but we do not have. So now we have the design and to move all the items of text on a new layer. I do not know this should be easy enough for anyone who knows how the script, but I don't.

    Anyone know of any scripts for it? Any other ideas?

    I use ID CS3 on Mac.

    Any help would be appreciated.

    Yes, but it should work...

    var newLayer = app.activeDocument.layers.add ();

    TFS var =

    App

    .activeDocument

    .spreads.everyItem ().textFrames.everyItem () .getElements ();

    While (var tf = {tfs.pop ())}

    TF. Move (newLayer);

    }

    Substances

  • How to get forms to ignore the default text in the fields during the validation of LiveCycle Designer

    Hiya,

    I'm test ss4 Designer to create a simple form that is submitted by e-mail.

    Everything works except for my text boxes...  They are implemented in the form of required fields, but because I've included the text by default with the instructions, if you press on submit without changing the fields, they will not validate as empty and does not throw an error message.

    I searched the forums all day for a fix, but I'm too new to understand where to put the code, etc.  I tried to add

    ' text {! = placeholder}' in the validation box but model that does not work...

    All I have is LiveCycle Designer and I'm on windows 7.  Thanks for your help!

    Hello

    There is a script editor.  If you select the field, then you will be able to select the event in the 'Show' taking place (above the 'Design' tab), and then the code window will be active and you can enter your code.  You can extend the default value of a single line.

    Good luck

    Bruce

  • Move the selection form, not the content, to another layer

    I understand that after the creation of any selection, CTRL-J copy the selection into a new layer, but this isn't what I want to do.

    I want to copy just the selection form (i.e. its contour), not its content, so that I can then apply this form of selection to any other existing layer.

    The goal is to take a selected layer A shape, apply the shape in layer B, remove the box around the selection into a layer B, and end up with a form in the B layer that contains the content of layer B pixels, no layer.

    I have Photoshop version 9, CS2. I tried to study masks, but were not able to find a basic explanation of beginner of masks

    Nice day!

    You can store a selection as an Alpha channel and then load it as often as you wish.

    Also you can use layer masks, those who can the duplicated on other layers (and if necessary reversed) easily.

    I want to copy just the selection form (i.e. its contour), not its content, so that I can then apply this form of selection to any other existing layer.

    It doesn't seem wise, an active selection is a property of the file and not a layer.

    The goal is to take a selected layer A shape, apply the shape in layer B, remove the box around the selection into a layer B, and end up with a form in the B layer that contains the content of layer B pixels, no layer.

    If the selection is anti-aliased or soft that risk unnecessary fringes.

    Could you please post a screenshot with the Panel visible layers to clarify your intention?

    Kind regards

    Pfaffenbichler

  • Editing existing text layer...

    Hello

    I am running CS4 on Vista 64-bit and a PS script in Javascript programming...

    I struggle to change an existing layer in a file .psd I open.

    The script is quite simple:

    1. open the .psd file

    2 change the alignment of the content, size, font of the EXISTING text layer

    -> Note: this text EXISTING layer has an applied existing LAYER STYLE

    3. close the file

    Everything works well except the part 2. The reason why I change this EXISTING text layer is, b/c it is already exactly positioned where it should do and the desired layer style is already applied...

    Here is what I tried:

    I. I thought given that the layer is already a LAYER of TEXT it is not necessary to set the TEXT properties once again - I used this code:

    textLayer var docRef.layers = ['text layer ']; define the text existing in a VAR layer
    docRef.activeLayer = textLayer;

    textLayer.font = "regular"; _Aviano
    textLayer.size = 36;
    textLayer.style = "Regular";
    textLayer.antiAliasMethod = AntiAlias.SHARP;
    textLayer.contents = "test change."

    -> Problem: the script runs without error, but the changes are NOT applied.

    II. I defined the existing text layer to be a LAYER of TEXT - I used this code:

    textLayer var docRef.layers = ['text layer ']; define the text existing in a VAR layer
    docRef.activeLayer = textLayer;
    textLayer.kind = LayerKind.TEXT;
    var T1 = textLayer.textItem;
    T1.font = "regular"; _Aviano
    T1. Size = 36;
    T1.style = "Regular";
    T1.antiAliasMethod = AntiAlias.SHARP;
    T1.contents = "test change."

    -> Problem: this concerns the changes, BUT the actual text font size applied is 120 (!) - I have to multiply by 0.3 to actually get to 36 and this does not work all the time... very, very strange... I guess it has to do with the fact that redefine us a layer of EXISTING text as a text element...

    III. I have of course...:

    1. create a NEW text layer
    2. apply all my properties

    3. then place it at the exact location where the EXISTING text layer

    Problem: creation and styles (properties) work fine, BUT when I get the coordinates through .bounds and when I apply the [0] and [1] values it does NOT match the position (too high)... applying the [0] and [3] values does NOT either (too low) mtach... I have to split the difference between these two?

    Thanks for your help in advance!

    M

    The reason text has not changed in your first example is that you set the font, size, etc to the layer not the textItem prperties. You fixed that in the example following you.

    When you work with pixels, you must assign the baseUnit if the doc is not 72 dpi. Something like that

    UnitValue.baseUnit = UnitValue ((1/docRef.resolution),'in');// the default value is 1/72
    textLayer var docRef.layers = ['text layer ']; define the text existing in a VAR layer
    docRef.activeLayer = textLayer;
    var T1 = textLayer.textItem;
    T1.font = "regular"; _Aviano
    T1. Size = UnitValue (36, 'px');
    T1.style = "Regular";
    T1.antiAliasMethod = AntiAlias.SHARP;
    T1.contents = "test change."

    The size is now 36 pixels. If you do not want to change the baseUnit you can change the resolution as proposed by Xbytor.

    Also if you want to match the position of a text layer, use the property textItem.position instead of the boundaries of the layer.

  • Text layer transitions

    Novice AE here...   I bought a model AE online and understand how to change layers of text in the model, but... Each text layer of transitions in the next layer of text. I'm trying to figure out how to get the first text layer to stay on the screen during the second layer transitions in. I join in the second layer of transition earlier in the timeline. I know my way around PS and PP well enough but AE is new to me. It is not obvious between the layers. Any help is appreciated!

    The model overview is here: http://www.videoblocks.com/video/ae-template-undersea/

    Thank you all!

    I found it!

    Entertainment-> reveal animation properties (hotkey U)

  • How to view the content in indesign DPS.

    Please

    help someone...?

    (Danish)

    Hello

    DPS 2015 relies on a real application installed on a device in order to get an overview of the content. You will need to:

    -Set up a project in the dashboard DPS 2015

    -Download content and implement collections

    -Generate an app of the overview of the project

    -Download and sign the application (this will produce a signed application)

    -Install the app signed on your device

    That's the short version. Details are available in the documentation provided.

    I hope this helps.

  • Change the size of the image without changing the size of the content

    Hello, I'm in CS3 windows

    They gave me a PSD for a Web site, I need to make the overall image size any longer as it is now, but I need the content (text, images, etc.) to stay the same size. I tried all the layers I want to stay the same and turn them off as well, but whenever I do that the result is always the same when I turn the layers back on (after the change of the length of the document)... they are always tight locking.

    How can I achieve this?

    Image > size of the canvas is a way.

    more information:

    http://help.Adobe.com/en_US/Photoshop/CS/using/WSfd1234e1c4b69f30ea53e41001031ab64-763ba.h tml

  • How to get and set the length and the width of the content of the layer?

    How to get and set the length and the width of the content of the layer

    All layers are packed not equal. a layer as adjustment have no limits. Layer to smart object can have two different sizes. The size of the object and the size of the object may be transformed. All smart object layers have an associated transform. To transform a smart object layers you need to work with the size of the object the generated pixels fot the layer. Text layer can be resized with a transform or by changing the font size. Pixelated layers are resize via a transformation.  The script method is resize.  When you resize the number of pixelsits made by interpolation. You can specify what method to use or set Photoshop interpolation preferably by default.

    There is also a bug in Photoshop scripts if you pause the story said make a selection and use resize. Photoshop will properly support up to a State before where you suspended history. This bug seems to be in all versions of Photoshop.

    If you look ate the script in my bug report, you should get a good idea of how to resize a layer.

    Photoshop: Bug Script resize the rear paper folded to a history State

  • I worked on a banner for my website.  I have my background layer, my image photo layer and I try to make my text layer.  I'm haven been able to do this all morning.  Now when I select horizontal T, place the cursor and type... I get only one

    I am designing a banner for my website.  I have a background layer, a layer of photo image and I try to create my text layer.  I select horizontal T, place the cursor in the desired position and type.  I get a horizontal line... no letters.  Can someone tell me what is the problem and how to solve this problem, so I can't see letters?  Thank you!

    Right now, your question is marked as "not responded". If my or anyone's answer solved your issue. Mark your question as answered and mark the answer displayed as 'correct', only you can do. It helps when the moderators of the forums of audit.

  • How can we get the names of police of every text layer in a document?

    Hi all!

    I wanted to know how we can get the names of fonts applied in each text layer in a psd file. I tried the following,

    NumLayers Int32 = 0;

    calculate the number of text layers.

    error = PIUGetInfo (classTextLayer, keyCount and numLayers, NULL);

    for (int i = numLayers - 1; i > 0;--i)

    {

    char * fontName = new char [100];

    Int32 len = 100;

    get the name of the font of each layer by index.

    error = PIUGetInfoByIndex (I, classTextLayer, keyFontName, fontName and len);

    }

    Suppose I have a document that has 2 layers of text and 2 layers of solid color as shown in the screenshot. Note that this document does not have a background layer. So, number of layers is 4.

    Forum.JPG

    If the layer is a layer of solid color, then I get the number of layers 0. But, if the selection of the layer is at all layers of text, I get number of layers 4. Why not get the number of layers 2 I requested info in the instruction text layers, PIUGetInfo (classTextLayer, keyCount and numLayers, NULL).

    In addition, I get error =-25922 to PIUGetInfoByIndex (I, classTextLayer, keyFontName, fontName and len).

    which is errReferenceNotFoundDefine.

    How can I go about it?

    Thank you!

    Hello

    I usually have "remember" United in what image is and then start working on it. This allowes me to iterate through layers when draft information or perform an action, and then set the document (in the previous state, with this wantsof user change course). Using this approach I am using index layers, but I don't know as I work on the layer is curently active layer.

    Now

    Getting the numbers of layer in a document:

    SPErr AMAutoPlugin::GetLayNum()

    {

    SPErr error = kSPNoError;

    numLayers Int32;

    Result PIActionDescriptor = NULL;

    Reference PIActionReference = NULL;

    error = sPSActionReference-> Make (& reference);

    If (error) goto returnError;

    error is sPSActionReference-> PutEnumerated(reference,classDocument,typeOrdinal,enumTarget);.

    If (error) goto returnError;

    error is sPSActionControl-> Get (& result, reference);.

    If (error) goto returnError;

    error = sPSActionDescriptor-> GetInteger (result, keyNumberOfLayers, & numLayers);

    If (error) goto returnError;

    stDocData.iNumLayers=numLayers;// is just my overall

    returnError:

    If (result! = NULL) sPSActionDescriptor-> Free (result);

    If (reference! = NULL) sPSActionReference-> Free (reference);

    error return;

    }

    Here is a part of the code (I hope you can understand that I have cut out a lot of)

    code that is not necessary in order to shorten the post) that retrieves the names of fonts.

    I used this approach since I have to get a lot more detailed information about text layers (not prsented here)

    I guess bu using routines from PIUGetInfoByIndex to aproprite, you can do much shorter.

    SPErr AMAutoPlugin::GetTextLayerAttributes(int index, TxtLayerInfo* info)

    {

    In order to clarify

    'info' is my structure that I filled with the data I need you can use somethong that suites you

    //

    UInt32 stringLength = 0;

    UInt32 STRL = 0;

    "" fontName char [255] = "";

    "" chariot of fontStyle [255] = "";

    "" char fontPSname [255] = "";

    HasKey Boolean = false;

    SPErr error = kSPNoError;

    DescriptorTypeID runtimeKeyID;

    DescriptorTypeID runtimeClassID;

    DescriptorTypeID runtimeTypeID;

    DescriptorTypeID runtimeUnitID;

    DescriptorTypeID runtimeEnumID;

    DescriptorClassID descClass;

    DescriptorEnumID enumValue.

    PIActionList listTextStyle = NULL;

    PIActionDescriptor descLayer = NULL; / / *

    PIActionDescriptor descPosition = NULL;

    PIActionDescriptor descTextLayer = NULL;

    PIActionDescriptor descTextStyle = NULL;

    PIActionDescriptor descFont = NULL;

    PIActionDescriptor descFontColor = NULL;

    PIActionDescriptor descClickPoint = NULL;

    PIActionDescriptor desclayerLocking = NULL;

    PIActionDescriptor descEFFECTS = NULL;

    error = sPSActionDescriptor-> Make (& descLayer);

    If (error) goto returnError;

    error = sPSActionDescriptor-> Make (& descTextLayer);

    If (error) goto returnError;

    error = sPSActionDescriptor-> Make (& descTextStyle);

    If (error) goto returnError;

    error = sPSActionList-> Make (& listTextStyle);

    If (error) goto returnError;

    error = sPSActionDescriptor-> Make (& descFont);

    If (error) goto returnError;

    error = PIUGetInfoByIndex(index,classLayer,0,&descLayer,);

    If (error) goto returnError;

    text

    error is PIUGetSingleItemFromDescriptor (descLayer, keyText, & descTextLayer, & descClass);.

    If (error) goto returnError;

    //

    get the police handle

    error = sPSActionDescriptor-> GetList (descTextLayer, keyTextStyleRange, & listTextStyle);

    If (error) goto returnError;

    error = sPSActionList-> GetObject (listTextStyle, 0, & descClass, & descTextStyle);

    If (error) goto returnError;

    error is PIUGetSingleItemFromDescriptor (descTextStyle, keyTextStyle, & descFont, & descClass);.

    If (error) goto returnError;

    font size

    error = sPSActionDescriptor-> GetFloat (descFont, keySizeKey, & dFontSize);

    If (error) goto returnError;

    Info-> dFontSize = dFontSize;

    name of the font

    error = sPSActionDescriptor-> GetStringLength (descFont, keyFontName, & stringLength);

    If (error) goto returnError;

    stringLength += 2;

    error = sPSActionDescriptor-> GetString (descFont, keyFontName, fontName, stringLength);

    If (error) goto returnError;

    Info-> sFName = fontName;

    NAME OF FONT PS

    error = sPSActionControl-> StringIDToTypeID ("fontPostScriptName", & runtimeKeyID);

    If (error) goto returnError;

    error = sPSActionDescriptor-> GetStringLength (descFont, runtimeKeyID, &STRL);)

    If (error) goto returnError;

    STRL += 2;

    error = sPSActionDescriptor-> GetString (descFont, runtimeKeyID, fontPSname, STRL);

    If (error) goto returnError;

    Info-> sPSName = fontPSname;

    font name style

    error = sPSActionDescriptor-> GetStringLength (descFont, keyFontStyleName, & stringLength);

    If (error) goto returnError;

    stringLength += 2;

    error = sPSActionDescriptor-> GetString (descFont, keyFontStyleName, fontStyle, stringLength);

    If (error) goto returnError;

    Info-> sFStyle = fontStyle;

    etc...

    Hope this helps,

    Kind regards

    Momir

Maybe you are looking for

  • Upgrade of VAIO SVT15115CXS-SSD

    Dear friends, I have sony vaio SVT1511CXS (SVT151A11U) with 1 TB HDD and SSD of 24 GB container. I need to replace the SSD more capacity SSD inorder to install the top OS. Please let me know 1 is it possible / updated 24 GB SSD in to higher capasity?

  • Black screen on my Satellite L750 - 1 M 8

    Hello I have a big problem with my screen, the display is very very dark. I change new screen and problem still exist... Maybe someone I have this same problem and know how to fix. PS im not and fool I try a bright thought shortcut keys... Post edite

  • How to maintain the life of your printer

    It seems more common that everyone feared how to maintain the service life of the cartridges from the printer itself.  As many variations of parameters and environment may play a role in how long your ink will actually last. A more official document

  • What was the last Windows 7 PCs made by Dell?

    I want to buy a desktop computer Windows 7 for my elderly mother (I HATE WINDOWS 8!)  What is the model name and number info on latest Windows 7 Dell PC?  She has only to e-mail and browsing the internet.  It has wifi, it can use it on a cable.

  • I lost my administrator password. And I don't have any other accounts that are admins

    I have 2 accounts on my computer, one of which is an administrator and I don't have the password for it. Anything that can have an admin password necessary for there for example change my current account to an administrator. I also tried to use the c