Read justification info from text layer.

How to read  justification info from text layer?
myLayer.property("Source Text").value.justification;
return
6612 - Left, 6613 - Right, 6614 - Center  in CS6
6814 - Right, 6813 - Left, 6815 - Center  in CC
it is right for any computer and operating system?

I would try to steer clear of using the numbers, only because they have changed in each version of After Effects and probably will continue to. You should compare the justification value against the ParagraphJustification options. Pg. 185 in the CS6 scripting guide has the list of choices:
TextDocument justification attribute
textDocument.justification Description
The paragraph justification for the text layer.
Type
A ParagraphJustification enumerated value; read-only. One of:
ParagraphJustification.LEFT_JUSTIFY
ParagraphJustification.RIGHT_JUSTIFY
ParagraphJustification.CENTER_JUSTIFY
ParagraphJustification.FULL_JUSTIFY_LASTLINE_LEFT
ParagraphJustification.FULL_JUSTIFY_LASTLINE_RIGHT
ParagraphJustification.FULL_JUSTIFY_LASTLINE_CENTER
ParagraphJustification.FULL_JUSTIFY_LASTLINE_FULL
Here is a simple test function that will alert the justification value when it's matched. You can change the alerts to return whatever code you want based on the justifaction value found.
/*     SAMPLE FUNCTION THAT CHECKS FOR JUSTIFICATION VALUE     */
var myLayer = app.project.item(1).layer(1);
textJustVal(myLayer);
function textJustVal(myLayer){
          var val = myLayer.property("ADBE Text Properties").property("ADBE Text Document").value.justification;
          if(val == ParagraphJustification.LEFT_JUSTIFY){
                    alert("Left");
          }else if(val == ParagraphJustification.RIGHT_JUSTIFY){
                    alert("Right");
          }else if(val == ParagraphJustification.CENTER_JUSTIFY){
                    alert("Justified");
          }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_LEFT){
                    alert("Lastline Left");
          }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_RIGHT){
                    alert("Lastline Right");
          }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_CENTER){
                    alert("Lastline Center");
          }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_FULL){
                    alert("Lastline Full");
          }else{
                    alert("There must be an error.");

Similar Messages

  • How to get info from a layer which is  applied  with styles  ?

    How to get info from a  layer  ?  such  as   (  apply  style  or  not , which  effect  have  applied  on  it  etc..)
    I  really  can't  solve  it , Who can hlep me..  By the way , I 'am  using  CS version.  

    xtools/xlib/Styles.js has a set of functions for working with layer styles. I do not know if it works with CS. I wrote it several years ago for either CS or CS2. If this doesn't work, then nothing will. The script retrieves a layer's style by saving it to disk then parsing the file for the desired ActionDescriptor.
    There is a function at the bottom of the file that tests the Styles.js API.
    Styles.test = function() {  var doc = app.activeDocument;
      var layer0 = doc.artLayers[0];
      var gdesc = Styles.getLayerStyleDescriptor(doc, layer0);
      if (!gdesc) {
        alert("There is no layer style associated with the layer");
        return;
    //   this will set the layer style to another layer.
    //   var layer1 = doc.artLayers[1];
    //   Styles.setLayerStyleDescriptor(doc, layer1, gdesc);
      if (!gdesc.hasKey(cTID('FrFX'))) {  // look for a stroke effect
        return;
      var frfx = gdesc.getObjectValue(cTID('FrFX'));
      if (!frfx.hasKey(cTID('Clr '))) {   // look for the color
        return;
      var clr = frfx.getObjectValue(cTID('Clr '));
      // we should really check that the objectType is RGBC
      var r = clr.getDouble(cTID('Rd  '));
      var g = clr.getDouble(cTID('Grn '));
      var b = clr.getDouble(cTID('Bl  '));
      if (r == 0 && g == 0xFF && b == 0xFF) {
        return;
      clr.putDouble(cTID('Rd  '), 0);
      clr.putDouble(cTID('Grn '), 0xFF);
      clr.putDouble(cTID('Bl  '), 0xFF);
      frfx.putObject(cTID('Clr '), cTID('RGBC'), clr);
      gdesc.putObject(cTID('FrFX'), cTID('FrFX'), frfx);
      Styles.setLayerStyleDescriptor(doc, layer0, gdesc);

  • What's the keyboard shortcut for "Extrusion from Text Layer"? (Mac CS6)

    I keep triggering this by accident and can't figure out what combo I'm hitting, or how to disable it. I've looked in the Keyboard Shortcuts but can't find it.
    I'm on a laptop keyboard, so I use the fn key a lot to access enter when I'm finished editing text. Every once in a while (but often enough to be annoying), I attempt to enter out of text editing and suddenly everything stops, the gray rotating "processing" cursor appears, and for a few seconds I'm in a mild panic about how long it's been since I saved. Then a dialog box comes up asking if I want to switch to the 3D workspace or something. Clicking "no" doesn't stop the unwanted 3D thing from happening, and the last History item then says "Extrusion from Text Layer." I then Undo and go on with what I was doing.
    I've always got my left hand positioned over the lower left corner of the keyboard, and move quickly when using shortcuts and switching tools. I have no idea what combination I keep hitting by accident - something with fn, ctrl, opt, cmd, shift, I don't know, plus possibly return or enter. What is it, and how do I disable it?

    Trial-and-error prevails: It's fn + shift + return. (Or shift + enter on a full keyboard, I suppose? Unless that still does a soft line break like shift + return.)
    But only when I'm actively editing the text layer - not with the text layer selected and Move tool active, or even with the text layer selected and Type tool active, but only when in the process of using the Type tool to edit the text layer. I still have no idea to disable it, though.

  • How to store data into database by reading sql statements from text file

    how to write java program for storing data into database by reading sql statements from text file

    Step 1: Create a property file to add various queries.
    Step 2: Read the properties file using ResourceBundle
    Step 3: Use the jdbc to execute the query read from the property file.
    So in future if you need to change query no need do any modifications in java program. But depends on how you use the property file.

  • I cant use Justification when a TEXT Layer is Selected ...

    Hi ...
    please take a look at this image and tell me whats the problem ?!
    http://img3.tinypic.info/files/casc3lpzzmxpt9hu33hl.gif
    when i select a text layer to do a justification on it the menu goes off ! but when i select another Layer it appears !
    how could i use it when text layer is selected?

    As i said, you have to use paragraph type if you want to use the justification options, not point type. And no, that's not how the Paragraph panel should look like.
    Point type:
    http://help.adobe.com/en_US/Photoshop/11.0/WSfd1234e1c4b69f30ea53e41001031ab64-75d3a.html
    Paragraph type:
    http://help.adobe.com/en_US/Photoshop/11.0/WSfd1234e1c4b69f30ea53e41001031ab64-75d2a.html
    Paragraph panel:
    http://help.adobe.com/en_US/Photoshop/11.0/WSfd1234e1c4b69f30ea53e41001031ab64-758da.html

  • How can we read a column from text file

    hai,
    the Text file contains :
    m1 m2 m4 89
    m1 m2 m4 89
    m0 m4 m2 90
    I need one array for each column
    m[0]= m1,m1,m0 (first column from text file)
    m[1]= m2,m2,m2 (second column from text file)
    m[2]= 89,89,90 (third column from text file)
    andvance thanks

    If a 2D array is OK (instead of 4 separate arrays), try something like this
    import java.io.*;
    import java.util.ArrayList;
    class FileReadColumns
      public static void main(String args[]) throws IOException, FileNotFoundException
        String line;
        ArrayList lines = new ArrayList();
        BufferedReader in = new BufferedReader(new FileReader("data.txt"));
        while ((line = in.readLine()) != null) lines.add(line);
        String bits[];
        bits = lines.get(0).toString().split(" ");
        String grid[][] = new String[bits.length][];
        for(int i=0;i<grid.length;i++)grid[i] = new String[lines.size()];
        for(int i = 0; i < lines.size(); i++)
          bits = lines.get(i).toString().split(" ");
          for(int ii = 0; ii < bits.length; ii++) grid[ii] = bits[ii];
    for(int i = 0; i < grid.length; i++)
    for(int ii=0;ii<grid[i].length;ii++)System.out.print(grid[i][ii]+" ");
    System.out.println();
    System.exit(0);

  • Reading first word from text file

    Hello all,
    I created a program which I can type in a line and store it into a file. What I need my next program to do is read and display just the first word from each line on the text file.
    Here is what I have:
    import java.io.*;
    public class ReadFromFile
    public static void main (String args[])
         FileInputStream firstWord;          
              try
                  // Open an input stream
                  firstWord = new FileInputStream ("FileofWords.txt");
                  // Read a line of text
                  System.out.println( new DataInputStream(firstWord).readLine() );
                  // Close our input stream
                  firstWord.close();          
                   System.err.println ("Unable to read from file");
                   System.exit(-1);
    }

    what i would like is my program to get the first word of every line and put it in my array.
    This is what i have attempted.
    import java.io.*;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    public class testing {
         String[] tmp = new String [2];
         String str;
         public void programTest()
              try
                             BufferedReader in2 = new BufferedReader(new FileReader("eventLog.log"));
                             while ((str = in2.readLine()) != null)
                                  tmp = str.split(" ");
                                  System.out.println(tmp[0]);
                        catch(IOException e)
                             System.out.println("cannot read file");
    public static void main(String[] args)
                 testing B = new testing();
                 B.programTest();
    }//end classAny help is most appreciated

  • Need help reading the info from GSpot...

    I've got an uncompressed .mov file that someone exported from FCP (not sure which version) for me to put a new music bed on and upload to our website. I attempted to import it PrPro, but it failed to import and gave me an unknown codec error. I opened the file in GSpot and got the below screenshot, which I don't really know how to read properly. I also tried repackaging the file using MPEG Streamclip, but got a file with audio and no video... Help?

    Thanks, Bill... here's the info from MediaInfo (I don't own QT Pro):
    General
    Complete name                    : F:\PCI\MLK\MLK Day 2012\Barber_MLKDay_sans_music.mov
    Format                           : MPEG-4
    Format profile                   : QuickTime
    Codec ID                         : qt 
    File size                        : 3.31 GiB
    Duration                         : 4mn 32s
    Overall bit rate mode            : Variable
    Overall bit rate                 : 104 Mbps
    Encoded date                     : UTC 2012-01-20 00:24:50
    Tagged date                      : UTC 2012-01-27 16:13:10
    Writing library                  : Apple QuickTime
    ©TSC                             : 2997
    ©TSZ                             : 100
    Video
    ID                               : 1
    Format                           : Intermediate Codec
    Codec ID                         : icod
    Codec ID/Hint                    : Apple
    Duration                         : 4mn 32s
    Bit rate mode                    : Variable
    Bit rate                         : 103 Mbps
    Width                            : 1 920 pixels
    Height                           : 1 080 pixels
    Display aspect ratio             : 16:9
    Frame rate mode                  : Constant
    Frame rate                       : 29.970 fps
    Scan type                        : Interlaced
    Scan order                       : Top Field First
    Bits/(Pixel*Frame)               : 1.655
    Stream size                      : 3.26 GiB (99%)
    Language                         : English
    Encoded date                     : UTC 2012-01-20 00:24:50
    Tagged date                      : UTC 2012-01-20 00:31:22
    Color primaries                  : BT.709-2, SMPTE 274M, SMPTE 296M
    Transfer characteristics         : BT.709-2, SMPTE 170M, SMPTE 274M, SMPTE 293M, SMPTE 296M
    Matrix coefficients              : BT.709-2, SMPTE 274M, SMPTE 296M
    Audio
    ID                               : 2
    Format                           : PCM
    Format settings, Endianness      : Little
    Format settings, Sign            : Signed
    Codec ID                         : sowt
    Duration                         : 4mn 32s
    Bit rate mode                    : Constant
    Bit rate                         : 1 536 Kbps
    Channel(s)                       : 2 channels
    Sampling rate                    : 48.0 KHz
    Bit depth                        : 16 bits
    Stream size                      : 49.9 MiB (1%)
    Language                         : English
    Encoded date                     : UTC 2012-01-20 00:24:50
    Tagged date                      : UTC 2012-01-20 00:31:22
    Menu
    ID                               : 3
    Duration                         : 4mn 32s
    Language                         : English
    Encoded date                     : UTC 2012-01-20 00:31:22
    Tagged date                      : UTC 2012-01-20 00:31:22

  • How to read the info from the card?

    I'm using the GemPC410 reader and i'm succesfull to get the atr # of the card. Now i'm trying to get all the info that is in the card. Can someone help me out on how I can read all the info from this card?

    You need to establish a secure channel between reader/card using Global Platform.
    Look at the Global Platform Specifications on how to Authenticate to the card using ExAuth. That is the command to establish the secure channel. If you have developer cards, everyone ( except Gemplus ) uses keyset 0xff , 40 41 42...4f.

  • Managed server startup script not reading login info from boot.properties

    To encrypt the username and password in weblogic admin server, I used a boot.properties file and setting some properties like StoreBootIdentity=true. This works as expected.
    Now, I have a weblogic managed server within the same folder i.e.
    under /bea/user_projects/domains/mydomain
    To get the similar behaviour on this managed server, I created a boot1.properties file and set the following in the startup script
    java -Djava.compiler=NONE -ms200m -mx200m $HOTSPOT_OPTIONS -classpath $CLASSPATH -Dweblogic.Domain=mydomain -Dweblogic.Name=$SERVER_NAME -Dweblogic.management.server=$ADMIN_URL -Djava.security.policy==$WL_HOME/server/lib/weblogic.policy -DRCP_PROPS=/data/css/adixit/samsung/scc612/server/cfg/RCP.props -Dlog4j.configuration=log4j.xml -Dweblogic.system.BootIdentityFile=/bea/user_projects/domains/mydomain/boot1.properties -Dweblogic.RootDirectory=/bea/user_projects/domains/mydomain weblogic.Server
    When I run the script I get the following :-
    <Jan 24, 2005 3:41:44 PM GMT+05:30> <Info> <Security> <BEA-090065> <Getting boot identity from user.>
    Enter username to boot WebLogic server:
    Why is it not able to pick the username and password from the boot1.properties file ? Any clues ? What settings can I change to make it work ?
    Thanks in advance.

    Being that you posted this problem a few months ago, I am assuming you found the cause of your problem. I too experienced this same symptom (boot.properties not being read) when trying to start a managed server on a different server than the admin JVM. I found the resolution in the following documentation:
    http://e-docs.bea.com/wls/docs81/ConsoleHelp/startstop.html#BootIdentityFiles
    Basically, you have to copy the SerializedSystemIni.dat from the server that the admin JVM is on to the secondary server where the managed JVM is going to run. I was able to do as the link says (add the boot.properties file with plain text passwords and have it encrypted). Hope this helps you or someone else down the road.

  • Info From Text Fields

    Hi, i was jsut wondeirng how to get the information submitted from a text field. Like, let's say i have a text field, and when the user types what they want in it, and hits the "Submit" button, it writes that information to a file. Thanks in advance
    PS: I know how to write info to a file, i just need to know how to get the information from the text field.

    Encephalopathic wrote:
    I recommend switching to Swing.Absolutely. Writing your app in AWT makes no sense these days. It doesn't really make your app look more "native" than Swing, due to its severe lack of features (accelerators for menus, toolbars, using the wrong fonts, etc.).
    If you really want to use a "native" toolkit instead of Swing, go with SWT, which has a much fuller feature set than AWT. Just be prepared to build different versions of your application for different platforms.

  • [Developer] How to RELIABLY get Acrobat Reader Version info from registry

    (Using Wise Installation system 9.02)
    First, we get the path from here:
    SOFTWARE\Classes\SOFTWARE\Adobe\Acrobat\Exe
    if it is not found, we get it from here:
    SOFTWARE\Classes\Applications\AcroRD32.exe\shell\Read\command
    and if it is still not found, we get it from here:
    SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe
    Then we check the version info for the file AcroRd32.exe that is
    located in one of those directories and compare it to the version
    we are installing; if it is less, we install the version included
    in our setup package.
    Now, is this the most RELIABLE way to do this?
    Should we just search for the file and get it's version info?
    What if you have > 1 version of Reader installed?
    What if you have Full Acrobat installed?
    Is there also a way for Reader installation to NOT change the
    PDF file association from Full Acrobat?

    If you look at our current process, you'll see that we are checking
    for multiple versions. However, there have been times when our version
    installed over a later version and we cannot understand why this
    happened that is why I'm addressing this here to see if anyone had
    any "fool-proof" way to do it.
    I know I can also check the PDF association but it may be set to Acrobat
    and we do not want to modify that. We just want to check the latest
    version of Reader they have installed against the one we have in our
    package.

  • Read in array from text file

    hello,
    i have managed to save the content of a 2d array to a text file, but i am a bit stuck reading it back and placing the data back into a 2d array.
    i have a Scanner object that can read the the integers from the file using nextInt(), but i am not sure how to place them back into the 2d array.
    i need something like:
            Scanner inputStream = null;
            try{
            inputStream = new Scanner(new FileInputStream("out.txt"));
            catch(FileNotFoundException e)
                System.out.println("out.txt not found");
                e.printStackTrace();
            for(int i = 0; i < 13; i++){
                for(int j = 0; j < 13; j++)
                    matrix[i][j] = inputStream.nextInt();
            inputStream.close();but it doesnt like the for loop.
    thanks

    morris7 wrote:
    but it doesnt like the for loop.1) You'll have to be much more specific than this if you want "helpful" help.
    2) You may need to call inputStream.nextLine() after the inner for loop but inside the outer for loop.
    3) Always, always use curly brackets "{" and "}" to enclose your for loops, while loops, if and else statements. They may seem like extra work if you are only processing one line, but they will save your life someday. Always.
    4) Consider closing your scanner in a finally block.

  • Reading connection parameters from text or XML file

    Hello,
    Rather than hard coding my connection data into the source, I would like to be able to read it from a configuration file in either text or XML format.
    Does anyone have a configuration file and source code example for doing this? Or have any suggestions on how it might be done?
    Many Thanks and Happy New Year!

    Thanks for the pointer. A review of the utils Java doc gave me the framework of what I needed. I also found a good example of the config file and code in the Core Java 2, Vol 2 book.
    As to the password, a concept I have is to create a small UI for users to manage the config params. When I write the password to the text file it would be encrypted. When used in the app, it would be un-encrypted. Granted not the most secure method, but a nice compromise on convenience and security.

  • Reading XML payload from text file

    Hello,
    I have a text file with XML payload in it. The text file has some header information and then the XML payload. How do I read only the XML payload for processing in PI?
    the structure of the text file is something like this..
    Header Information
    Payload
    Sample:
    #Datetime: 20140318-09:28:50.129
    #MessageID: sample123
    #Sender: TEST
    #SenderParty: TEST
    #ReceiverService:
    #ReceiverParty: Test
    #Interface: Test123
    #InterfaceNamespace: http://test.com
    <?xml version="1.0" encoding="UTF-8"?>
    <Sample ><Header>......
    Please advise.
    Thank you.
    Larry.

    package com.learning.utils;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class FetchPayload extends AbstractTransformation {
      String strData = null;
      @Override
      public void transform(TransformationInput arg0, TransformationOutput arg1)
      throws StreamTransformationException {
      // TODO Auto-generated method stub
      getTrace().addInfo("File Reading started ");
      String strData = convertStreamToString(arg0.getInputPayload()
      .getInputStream());
      getTrace().addInfo("File Reading successfully completed ");
      try {
      getTrace().addInfo("Generating XML started");
      strData.substring(strData.indexOf("<?xml"), strData.length());
      arg1.getOutputPayload().getOutputStream().write(
      strData.getBytes("UTF-8"));
      getTrace().addInfo("Generating XML started");
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      public String convertStreamToString(InputStream in) {
      StringBuffer sb = new StringBuffer();
      try {
      InputStreamReader isr = new InputStreamReader(in);
      Reader reader = new BufferedReader(isr);
      int ch;
      while ((ch = in.read()) > -1) {
      sb.append((char) ch);
      reader.close();
      } catch (Exception exception) {
      return sb.toString();
    and u can get  the xml as a resultant which  u can use as input for next message mapping.
    thanks and regards,
    Praveen T

Maybe you are looking for