How can I read scale boxes paragraph?

Hello

I'm reading some text boxes values in photoshop for an export script I'm working on. I came across a problem that I can not understand, I hope it's just a small thing.

When reading the text of paragraph values, there are some cases where the values will come out wrong. For example:

I have a layer with the text of the paragraph by indicating that paragraph (text box) size is 400 px by 400 px and the font size is 60 points.

If I am running a script similar to this:

[code]

Get the text layer and save ir to a variable named layer.

If (layer.textItem.kind is TextType.PARAGRAPHTEXT)

{

Log ("Width:"+ layer.textItem.width.as ('px') ");

Log ("size:" + layer.textItem.height.as ('px'));

Newspaper ("the font size:" + layer.textItem.size.as ('pt'));

}

[/ code]

My output reads as follows:

[code]

Width: 200

Height: 200

Font size: 30

[/ code]

Which is obviously false, because all values are half of what they should be. I have other layers of text in the same file that print the correct values!

After trying a lot of different things, I thought a way to reproduce the error, but not a way to remedy, it is here:

-Create a new layer of paragraph text by clicking and drag using the text tool, make the text box about 200 px 200 px

-Type text in the box of

-Select the text and make it 30pt size

-Complete text

-Make sure that the text layer is selected

-Press command-t (ctrl + t in windows)

-In the free transformation parameters, manually type 200% for both with and height

-Accept changes of transformation

-Use the text tool, and then select the text of the layer

At this point, you will notice that the text box reports its size as 400 px by 400 px and font size says pt 60, far, everything is logical, the question arises when you look at the info tab, scale is reported as being 200% for width and height and if I use the previous script printed sizes are the origin of the text box sizes : 200 px 200 px and 30 pt for the font size.

At the beginning I have but it would be easier to use the horizontalScale TextItem as and verticalScale properties as well:

[code]

Log (' vertical scale: "+ layer.textItem.verticalScale");

Log ("horizontal scale:"+ layer.textItem.horizontalScale ");

[/ code]

But even though we know that the scale is 200% the result reads:

[code]

Vertical scale: 100

Horizontal scale: 100

[/ code]

Unfortunately that I have no control over how content is created, so I can't avoid using the tool of transformation on the text of paragraph, or of any text (this problem also affects the font size in single line text layers). So I need to find a reliable way to either read the correct values of the text or to read the scale that affects the text in my diaper.

Any help would be appreciated. Thank you in advance.

Dario Segura

The font size, shown in the DOM model is the original size of the font used, if the text has been the transformation it must be multiplied by the factor of transformation.

For example, create a text layer and change the text and then run the following code on the text layer...

var domTextSize = activeDocument.activeLayer.textItem.size;
var amTextSize = getTextSize();
alert("DOM text size = " + domTextSize +"\rAction Manager text size = "+amTextSize);
function getTextSize(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('textKey'));
var textSize =  desc.getList(stringIDToTypeID('textStyleRange')).getObjectValue(0).getObjectValue(stringIDToTypeID('textStyle')).getDouble (stringIDToTypeID('size'));
if (desc.hasKey(stringIDToTypeID('transform'))) {
            var mFactor = desc.getObjectValue(stringIDToTypeID('transform')).getUnitDoubleValue (stringIDToTypeID("yy") );
    textSize = (textSize* mFactor).toFixed(2);
    }
return textSize;
}

Tags: Photoshop

Similar Questions

  • How can I remove the box the letters VIP?

    How can I remove the box the letters VIP?

    You do not have. You must remove the VIP status to all who come in contact with you. Right-click on the sender of the email in the mailbox and choose to remove VIP.

    Once you do this, the mailbox will disappear. Restart the e-mail if necessary.

  • How can I read a pdf with ebook reader Touch samo

    How can I read a pdf with ebook reader and where I could put the pdf in the day

    > where I could put the pdf in the day
    You can put the files on the SD card that can be inserted into the slot for SD card available on the left. Supported file formats are: PDF and EPUB

  • How can I read reviews of applications on the App Store for Apple TV?

    How can I read reviews of applications on the App Store for Apple TV?

    It is even possible to read or write reviews of applications on Apple TV?

    Access is not for the comments on Apple TV. You need to get the title in iTunes or the App Store on an iOS. Reviews of iTunes can often be found using your favorite search engine.

    TT2

  • How can I remove windows box office and upcoming facebook in the start menu

    How can I remove windows box office and upcoming facebook in the start menu

    I moved your question answers feedback to Windows desktop and personalization areas.

    You care to offer up what version of Windows, you are talking about but if it's Windows 7, I would right-click on the offending list and either:

    1. Remove from this list , is that the entry is in the most recent lower part / area most often used.
    2. Delete the Start Menu if the entry is pinned in the Start Menu (above the most recent / most often used).
  • How can I read or use the unallocated Partition?

    My external hard drive has two partitions. We're "Healthy (primary partition)", the other is "unallocated".

    I can see health as a disc but not the unallocated partition. How can I read or use the unallocated Partition?

    When I right click on the partition menu popup are faded/not usable.

    You can create a partition in the unallocated in disk management space.

    Right-click on the unallocated space and create a partition.

    If you have a partition on the disk using all the space you need to set as GPT instead of MBR.  Windows will not accept a partition of about 2 GB max on a game of MBR disk.

  • The date system in the taskbar indicates the year, month, day (as in the army). How can I read the day, month, year?

    The date system in the taskbar indicates the year, month, day (as in the army). How can I read the day, month, year?

    It's weird, in my version (Windows 7 Pro), it shows much more than that.

  • How can I read Dreamweaver HTML5 coding via my mobile?

    Hello, I am currently a student in HTML5, can someone tell me how can I read the html5 coding via my iphone when I'm traveling?

    Thank you very much!

    Go to HTML5 Introduction

  • How can I include spaces in paragraph before and after in the paragraph styles?

    By specifying the paragraph spacing BEFORE or AFTER a paragraph which differs from the CONDUCT ranging from space, how can I include in my paragraph styles? I'm on a MAC under OS Mavericks.

    Yes, by selecting text/para use space before and after.

    Thank you

    Sanjit

  • How can I read foramt raw Sony Alpha 7 (.) ARW) in Photoshop CS3?

    How can I read foramt raw Sony Alpha 7 (.) ARW) in Photoshop CS3?

    Please check what version of Camera Raw supports this camera

    Camera Raw plugin | Supported devices

    and compare that to what Photoshop CS3 can support

    Applications of camera Raw compatible Adobe

    The free DNG Converter can be an alternative.

  • How can I remove the box ' who is it' in PSE11

    How can I remove the box ' who is it' in PSE11

    Start the Organizer preferences (by pressing Ctrl + K on Windows / Mac Cmd + K)

    Go to the scan tab and uncheck all the options.

  • How can one Reader > 9 v be installed on one volume other than c:?

    How can one Reader > 9 v be installed on one volume other than c:? as g:?

    and is there an available executable distrubution if the reader can be installed on a machine that is not connected to the Internet?

    Download the .exe of the ftp service and use it to target the installation directory:

    ERGO

    FTP://FTP.Adobe.com/pub/Adobe/Reader/

    and choose the operating system and version and language as well:

    FTP://ftp.adobe.com/pub/Adobe/Reader/Win/9.x/9.5.0/en_US/AdbeRdr950_en_US.exe

  • How can I read data from my SQLite database?

    I am new to Adobe Air and am playing with creating something simple to insert data into a database and then display it. I was able to insert data successfully but now encounter difficulties to read from the database and display. How can I display data such as a text box or text box?

    This my code for insertion:

    private void sqlConn(dbName___tring,_dbstmt___tring,_dbInsert___tring):void
    {
    sqlC varQLConnection = new SqlConnection ();
    SQLs varQLStatement = new SQLStatement();
    SQLI varQLStatement = new SQLStatement();

    file: var folder = File.applicationDirectory;
    var dbPath:File = folder.resolvePath (dbName);

    sqlc.addEventListener (SQLEvent.OPEN, dbCreated);
    sqlc.addEventListener (SQLErrorEvent.ERROR, dbError);

    sqls.addEventListener (SQLEvent.RESULT, tbCreated);
    sqls.addEventListener (SQLErrorEvent.ERROR, tbError);

    sqli.addEventListener (SQLEvent.RESULT, recCreated);
    sqli.addEventListener (SQLErrorEvent.ERROR, recError);

    sqlc.openAsync (dbPath);

    sqls.sqlConnection = sqlc;
    SQLs. Text = dbstmt;
    SQLs. Execute();

    sqli.sqlConnection = sqlc;
    SQLI. Text = dbInsert;
    SQLI. Execute();
    }

    private void btn_Click (): void
    {
    dbName var= "test.db" tring
    var sqlStatmttring = "CREATE TABLE If NOT EXISTS test_table (id INTEGER PRIMARY KEY AUTOINCREMENT, first_name TEXT, last_name TEXT);
    var sqlInserttring = 'INSERT test_table (first_name, last_name) VALUES('"+txtTaskName.text+"','"+txtTaskDescription.text+"');';
    var sqlReadtring = "SELECT * FROM test_table;"

    sqlConn (dbName, sqlStatmt, sqlInsert);
    }

    That's what I have so far to read the articles. Is this right? How can I use it to display items on one of my opinions?

    private void readItems(dbName___tring):void
    {
    var sqlrQLStatement = new SQLStatement();
    sqlC varQLConnection = new SqlConnection ();
    file: var folder = File.applicationDirectory;
    var dbPath:File = folder.resolvePath (dbName);

    sqlc.openAsync (dbPath);

    sqlr.addEventListener (SQLEvent.RESULT, recFound);
    sqlr.addEventListener (SQLErrorEvent.ERROR, recFoundError);

    sqlr.sqlConnection = sqlc;
    sqlr. Text = "SELECT * FROM test_table ';
    sqlr. Execute();

    Table of results: var = sqlr.getResult () .data;
    }

    Thank you

    They must be in their own class and each class must be in their own folder. If you need a taskClass.as file and a SQLClass in the SQLClass.as file that has the recFound function.

  • How can I read a book on digital editions?

    For the moment I try to open an eBook, I downloaded, it appears a text box saying that theres a mistake get the liscence, how can I make it work?

    You can simply download the ebook and open it in ADE and read it. You might get this error of license, if you try to open an eBook under license. So, make sure that the ebook that you are trying to open is allowed by your adobe id. If this isn't the case, then you should contact the vendor of the ebook.

    For now, try to download the below sample ebook and try to read it. If you are able to do, then that means that your ADE is fine. Instead, its a problem with this particular ebook.

    http://www.Adobe.com/products/Digital-Editions/eBook.html

  • Satellite Pro L500 - How can I prevent the boxes menu popping up randomly

    How can I prevent boxes menu popping up randomly and the cursor randomly fault as well?

    It settles after a certain time, but can occur at any time.

    Hi mate

    What menu boxes do you mean exactly?
    What exactly happens with your laptop or OS?

    Please provide details.

Maybe you are looking for

  • Upgrade to version 20 broke all bookmarks and URL address bar

    Since I updated Firefox to v19 to v20, the program is not responding when I click on any bookmark or manually enter a web address in the URL address bar. It does not expire waiting for a connection, and there is no "connecting to" message in the stat

  • Can I purchase AppleCare for a non - Apple Store certified refurbished?

    Hi all. I am looking to buy a model 2015 15 "MacBook Pro. I found this on Amazon: "Apple certified re-machined in a State of Grade A. factory sealed and comes with all original accessories." A few questions: third-party retailers actually selling App

  • WiFi Upload faster than loading

    I have a MacPro with an airport card in a room about 20 feet away an airport extreme base station. I ran a speed test and got these results: I thought it was the Airport card, so I had an Extender of the bear that produces the same results. So I boug

  • Sleekbook HP ENVY 14-k027cl: unknown device

    What should I do to fix this? He continues to be and I tried to install almost all the drivers for my laptop.

  • How a loop shape in a misconfigured Etherchannel?

    Dear friends, It is a question frequently observed and practically proven that if both switches are interconnected by a number of parallel links that are grouped in an Etherchannel on a switch (of course, using the mode on ) while being unbundled on