get the size of a select text string

I have a script that works in Illustrator 10, but fails in CS5. Here is the code snippet. It fails to textSize = selection.textRange () .size

I was trying different things, but I don't write a lot more code, so I'm rusty. I tried things, like: textSize = TextRange.CharacterAttributes.Size;

Help me, I seem to be a dope.

Douglas


If (documents.length > 0) {}

var doc = activeDocument;

Get the size of the text in the control art number

function findTextSize() {}

selectedItems = selection.

Make sure that option is selected.

If (selectedItems.length == 0) {}

Alert ("nothing is selected");

return;

} else {}

pageObject = selectedItems;

pageItemType = pageObject.typename;

If (pageItemType == 'TextRange') {}

textSize = TextRange.CharacterAttributes.Size;

Alert (textSize);

} else {}

Alert ("selection is not a text element");

return;

}

Return to textSize;

}

}

Hi, Douglas.

Try below:

textSize = selectedItems.characterAttributes.size;

When your selection is textRange, you can get properties characterAttributes.

10.

Tags: Illustrator

Similar Questions

  • How can I get the size of a Cluster in bytes?

    I want to get the value of a cluster size, and I found the function "Get variant attribute" I think that to do this,

    but I can't find in the documentation http://zone.ni.com/reference/en-XX/help/371361D-01/glang/get_variant_attribute/

    Anyone would provide the values of the attribute name that can receive?

    And it's right to get this function I need or there is another way?

    Hi Marco,.

    GetVariantAttribute may not give you the size of a cluster - it will just give you the a variant attributes!

    You can create attributes with any name (but a non-empty string)...

    Why should you get the size of a cluster?

    Perhaps you could serialize to a string and get the length of the string. Or type in a table of U8 conversion and get the arraysize...

  • Get the size of the file for a particular file in a data store

    I was wondering if it was possible to get the size of a particular file on a data store. It seems that this should be trivial, but I'm new to PowerCLI and I see not all the properties of size when I invoke the cmdlet:

    PS fs:------> Get-ChildItem "somefile" * | Get-Member

    TypeName: VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.DatastoreFolderImpl

    Name MemberType definition

    ----              ----------   ----------

    Method of ConvertToVersion T ConvertToVersion [T])

    Equals method Boolean Equals (System.Object, obj)

    GetHashCode method int GetHashCode()

    Type of the method GetType GetType()

    IsConvertableTo method bool IsConvertableTo (type toType)

    String the ToString ToString() method

    PSChildName NoteProperty System.String PSChildName = XXXXXXXXXXXXXXXXX

    PSDrive NoteProperty VMware.VimAutomation.ViCore.Cmdlets.Provider.DatastoreProvider.DatastoreDriveInfo PS...

    PSIsContainer NoteProperty System.Boolean PSIsContainer = True

    PSParentPath NoteProperty System.String PSParentPath=VMware.VimAutomation.Core\VimDatastore::\XXXXXXXXXXXXXX

    PSPath NoteProperty System.String PSPath=VMware.VimAutomation.Core\VimDatastore::\XXXXXXXXXXXX

    PSProvider NoteProperty System.Management.Automation.ProviderInfo PSProvider=VMware.VimAutomation.Core\VimDa...

    Datastore property {get ;} VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore data store

    DatastoreFullPath property System.String DatastoreFullPath {get ;}

    DatastoreId property System.String DatastoreId {get ;}

    FolderPath property System.String FolderPath {get ;}

    FullName property System.String FullName {get ;}

    Property ItemType ItemType of VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.DatastoreItemType...

    System.Nullable'1 [[System.DateTime LastWriteTime, mscorlib, Version = 4.0.0.0 property, Culture = neutral, publ...

    Property System.String name {get ;}

    UID property System.String Uid {get ;}

    Faik, you must use the SDK API to find this HostDatastoreBrowser of information, i.e.

    .

    See for example Re: using SearchDatastore_Task

  • Get the size of a textfield

    Hello

    is there a way to get the size of a textfield via expressions? I'm doing a textbackgound which has an object attached to it, but the text is constantly evolving. Get the position and size of the textflied would be useful.

    Thanks for the tips!

    TS

    If you use AE CC 2014, you can use the sourceRectAtTime() function to do this.

    Mylenium

  • Get the size of the lun by using the name of runtime

    Hello everyone

    Does anyone know how to get the size of the lun using the runtime name?

    $runtimeName = "vmhba0:C0:T0:L3".

    You mean something like this?

    $runtimeName = "vmhba2:C0:T4:L42"
    
    Get-VMHost MyEsx | Get-ScsiLun | where {$_.RuntimeName -eq $runtimeName} |Select RuntimeName, CapacityGB
    
  • Printing problems - I get the sizes of evil when I print from LR 5.5. on my Epson 3880 printer. USB connection. Reinstalled printer driver - not. Want to obey my print settings. What can be wrong?

    Printing problems - I get the sizes of evil when I print from LR 5.5. on my Epson 3880 printer. USB connection. Reinstalled printer driver - not. Want to obey my print settings. What can be wrong?

    I am not familiar with these communities - not provide Adobe and LR all direct support?

    You bet it's your page layout. As I said, the Epson driver has many offers for the same size paper. In addition, do NOT use Auto expand in this selection.

  • How to get the value of a selected character unicode?

    Hi all

    How to get the value of a selected character unicode?

    The content property of a 'Character' InDesign object is a simple Unicode string. For access to the various characters is a basic javascript operation, and a google gives this as a good first result: http://www.w3schools.com/jsref/jsref_charCodeAt.asp

    Therefore, the value of a selected character unicode is

    App.Selection [0]. Characters [0].contents.charCodeAt (0)

  • How to get the size of the binary cache from code

    Is there a way to get the size of the cache in bytes? (size() method retrieves the number of objects, as when the size of the cache is limited in configuration by unit-calculator 'BINARY')?

    Hey Meir,

    As Wei said that there is a JMX exposed for each cache bean and you can just summarize the units attribute. There is a second attribute called UnitFactor that you also use to be precise. In most cases, UnitFactor will be 1 but the appropriate calculation of size in bytes of a cache is

    Units * UnitFactor

    Second, you ask this cache across all members of storage and summarize the results. This will give you then the size that includes the key and value but not take account of all sizes to index.

    An easy way to make JMX requests within the coherence is:

    String cacheName = "";
    MBeanServer mbs = MBeanHelper.findMBeanServer();
    Set names = mbsc.queryNames(new ObjectName("Coherence:type=Cache,service=*,name=" + cacheName + ",*"), null);
    
    long totalUnits = 0;
    for (ObjectName name : names) {
        Integer units = (Integer) mbs.getAttribute(name, "Units");
        Integer unitFactor = (Integer) mbs.getAttribute(name, "UnitFactor");
        totalUnits += (units * unitFactor);
    }
    System.out.println("Total Units = " + totalUnits);
    

    There are other ways to get the size too.
    You could write an aggregator that calls BinaryMemoryCalculator.INSTANCE.calculateUnits with the binary key and the value of each entry that went. This would not be very effective, but would be useful if you want to calculate the size of a subset filtered registration.
    You could write a remained that gets the support of the cache card you want, cast to LocalCache and then call the appropriate methods to get unitfactor and units. You must run this invoked on each Member of storage.

    JK

  • JS CS4: Changing the size of a selected rectangle

    Hi all

    I can get my size to my selection with:

    var f = app.selection [0] .geometricBounds;
    myWidth = app.activeDocument.selection [0] .geometricBounds [3] - app.activeDocument.selection [0] .geometricBounds [1];
    myHeight = app.activeDocument.selection [0] .geometricBounds [2] - app.activeDocument.selection [0] .geometricBounds [0];

    myDimensions = [myWidth, "', myHeight]
    Alert (myDimensions);

    I came not with the code to adjust the size. I want to ruduce the width by. 5 "and the height of. 25 ".

    I still do not fully understand the OMV in terms of finding properties and how to code. Advice will be greatly appreciated.

    John

    Assuming that you already have your dimensions the value in inches:

    var f = app.selection [0] .geometricBounds;

    GB [2] = f [2]. 25;

    [3] go is Go [3]-. 5;

    App.Selection [0] .geometricBounds = GB;

    Now, this gives an incorrect result, if the selection has been skewed or rotated and it only takes into account the point of proxy, but that should help you get started.

    Keep in mind that you should always write an array of four values to the geometric boundaries. You can not write to individual members of the property.

    Dave

  • Get the sizes of tables with the same name but from different schemas

    There are two patterns in my database: HAND and ARCH.
    Each of these schemas contains a table named SPOITEMS. I would like to get the size of the table "SPOITEMS" of patterns one and another.
    I found this script:

    Select
    nom_segment table_name,
    Sum (bytes) /(1024*1024) table_size_meg
    Of
    user_extents
    where
    segment_type = 'TABLE '.
    and
    nom_segment = "SPOITEMS".
    Table_name group

    but it returns only a single element with the name of the table "SPOITEMS" (owner ARCH).

    Any ideas?

    Thanks in advance

    I assume that you run the query in the ARK? Use ALL_EXTENTS or DBA_EXTENTS instead of USER_EXTENTS

  • How to get the size of physical layer DAQmx

    Hi all

    Description of the problem: I use the physical channel DAQmx as control. I selected a few channels of the browse option. Now, I want to get the number of channels selected from the list.

    I checked the extent of I / O-> OR-DAQmx. But couldn't find

    Is it possible?

    I guess that the easiest way is to unflatten in an array first:

  • ERROR: Cannot get the size of the logical block for spfile

    Ran across the following error in the log of alerts for a the 2 node RAC database:

    ERROR: Cannot get the size of the logical block for spfile "+ XXXXXX_SYSTEM/XXXXXX/spfileXXXXXX.ora".

    Looked in MOS and found nothing.  Has anyone go through this before?  If so, what is the cause?

    Just received a resolution of Support from Oracle.  They said that this is a benign error and can be ignored.  Here is their answer to my SR:

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    OK, after reviewing all that there seems to be no problem to fix. All configurations are correct. We believe that these errors are benign and can be ignored.

    COMMENTS

    ===============

    -L' ASM instance is online.

    -The Diskgroup: + XXXXXX_SYSTEM is mounted and has the physical and logical of 512 bytes sector size.

    -No error message in the alerts ASM journal.

    In light of the facts above, the message "ERROR: could not get the size of the logical block for spfile" seems benign and can be ignored.

    However, to avoid these messages, as a workaround, you can try creating the spfile pfile '+ XXXXXX_SYSTEM/XXXXXX/spfileXXXXXX.ora' and then try to create spfile diskgroup + XXXXXX_SYSTEM using this file pfile.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • I'm doing a pdf to a file and I need to get the size of the file to be not more than 10 MB. What is the best way to do

    I'm doing a pdf to a file and I need to get the size of the file to be not more than 10 MB. Even when I save it, the image quality at least the file size is 10.9 MB. What is the best way to do

    Open the PDF in Acrobat Pro. Choose file > save as other > PDF of reduced size or PDF optimized (which gives you more options).

  • How to get the size of the buttons created by JavaFX?

    The codes here:

    ToggleButton tb1 = new ToggleButton("Minor");
    System.out.println(tb1.getWidth());
    System.out.println(tb1.getPrefWidth());
    

    The result is:

    0.0

    -1.0

    But in the swing.

    JButton tb1 = new JButton("Minor");
    System.out.println(tb1.getPrefferedSize().width);
    

    The output is 109, which is I want to get.

    How can we get the size of the button created by 'new Button()... '. "as in Swing? I strongly hope that the answer is Yes, because I find very useful this function in the swing.

    Thank you

    (Note: I discovered that, after the "primaryStage.show ()" code, we can get the width of the button by using button.getWidth (), but when we use button.getPrefWidth () we get always - 1.0, the value considered as junk.)

    For the object in the scene, I used to use "scene snapScene = new scene (root, 700, 500);" for example, if the result of "System.out.println (root.getWidth ());  "of course is 700,

    So do not...

    It gives me 47.0:

    final Button button = new Button("Play");
    final Scene snapScene = new Scene(button);
    snapScene.snapshot(null);
    System.out.println(button.getWidth());
    

    As jsmith suggests however, you shouldn't really need to do. If you really need manage available according to the actual width of a button, something to link to the widthProperty.

  • How to get the size of the Applet in my form?

    I am in the form of Oracle 11 g, I want to focus my use of the window the code below:
      v_app_width := TO_NUMBER(GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WIDTH));
      v_app_height := TO_NUMBER(GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,HEIGHT));
      v_win_width := TO_NUMBER(GET_WINDOW_PROPERTY(p_window_name,WIDTH));
      v_win_height := TO_NUMBER(GET_WINDOW_PROPERTY(p_window_name,HEIGHT));
     -- message("width" ||v_app_width);
      SET_WINDOW_PROPERTY(p_window_name,POSITION,(v_app_width- v_win_width) / 2,(v_app_height - v_offset - v_win_height) / 2);
    This works for 6i, but does not not for 11g. As
     GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WIDTH)
    Returns the value 0.
    But once this line of message without comment, the next shape call this procedure of Center window works fine.

    My problem is similar to this: http://www.orafaq.com/forum/t/149809/2/ but there is no solution.

    I also found this: http://docs.oracle.com/cd/B14099_19/winitan.1012/relnotes.1012/relnotes/forms.htm
     5.1.4.1 GET_WINDOW_PROPERTY Returns 0 on Microsoft Windows
    
    GET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_HANDLE) returns zero even with separateframe=true. Oracle Forms Online Help states that this should work on windows platform. This is incorrect as this Built-in does not support MDI. 
    [Edited 3/12 16:50] Today, I found this code does not work for my first form (login form) when the application is launched. After login, the forms of rest can be focused very well. Don't know what is the reason.

    So, if this does not work, how can I get the size of the applet and focus my window?

    Published by: frank1018 on March 12, 2013 16:53

    If you want to Center your window when MDI is enlarged...

    first create timer... under a time-new-forms-example...

    Declare     timer_id   Timer ;Begin       timer_id := Create_Timer( 'laf_timer', 50, NO_REPEAT ) ;end ;
    

    Use this solution in what timeout... because it will not perform this procedure at a time new forms instance or preform triggers...

    declare     mh number;     rh number;     mw number;     rw number;begin                       If lower(Get_Application_Property( TIMER_NAME )) = 'laf_timer' Then
    
                             mh     :=     get_window_property(forms_mdi_window,height);                    mw     :=     get_window_property(forms_mdi_window,width);                    rh     :=     get_window_property('yourwindowname',height);                    rw     :=     get_window_property('yourwindowname',width);                          set_window_property('yourwindowname',position,(mw/2)-(rw/2),0);  /* i make 0 for the value of Y.. for i liked it on the top but you can change it too */
    
              end if;
    
    end ;
    

    Published by: ck on 14 March 2013 02:44

Maybe you are looking for

  • You forgot the password for Apple?

    Hello Mr President I want how do to reset the icloud password please help my I 6puls phone doesn't work for security reasons. Please help I use my iPhone. Thank you Your V.Rajh

  • Send an Email to Undisclosed Recipients

    I have friends who send me e mails that some me and sent to recipients of Undeisclosed. How is - is, what they do a mailing list and call it something else and hide the names of peples? How is it is done or updated updated...

  • P2-1331il desktop pc: start

    HelloMy pc won't start does not normally from 1 week. When I turn the cpu key turn on a second and start again after 3-4 seconds. its also been a THUMP when I start the pc.When I start the pc the messege appears "Bios default settings have been loade

  • Pavilion HPE h8 - 1360t: the graphics card upgrades

    My current system has used an AMD Radeon HD graphics card 7570.  I am interested in upgrading this map and looking for a recommendation for a mid range to high level card that corresponds to this case / motherboard. My system uses UEFI and I already

  • 2.2 customize the phone button?

    I finally got 2.2! (Yes!) The new phone/apps/browser button that is now at the bottom of each screen is nice, but I want the button phone to go to contacts instead of the Dialer. I am aware that since the Dialer I can hit the contacts tab, but he hav