Change color of compoundPathItems created by converting Text to Paths using createOutline()

I used createOutline() to convert Text to Paths. However, the return is a GroupItem and I had difficulty in changing its stroke and fill colors.
Here is my script:
var docActive = app.documents.add();
var textFrame = docActive.pathItems.rectangle( 0, 0, 200, 20);
var areaText = docActive.textFrames.areaText(textFrame);
areaText.contents = "Hello My Friend";
areaText.textRange.characterAttributes.size = Math.round(20*0.85);
var textOutline = areaText.createOutline();
// Trying to change stroke and fill colors of textOutline but got stuck here...

try this, I added comments next to each line
var docActive = app.documents.add();
var textFrame = docActive.pathItems.rectangle( 0, 0, 200, 20);
var areaText = docActive.textFrames.areaText(textFrame);
areaText.contents = "Hello My Friend";
areaText.textRange.characterAttributes.size = Math.round(20*0.85);
var textOutline = areaText.createOutline(); // this is a group
var compoundPaths = textOutline.compoundPathItems; // each letter is a compound path
for (i=0; i<compoundPaths.length; i++) {    // loop thru all letters
    var compoundPath = compoundPaths[i];    // this holds one letter at a time
    var pathItems = compoundPath.pathItems; // all pieces (pathItems) of the compound path make up each letter
    for (j=0; j< pathItems.length; j++) {   // loop thru all letter parts
        var pathItem = pathItems[j];            // this holds one letter piece at a time
        pathItem.fillColor = docActive.swatches[5].color;       // fill it with the 5th swatch
        pathItem.strokeColor = docActive.swatches[4].color; // stroke it with the 4th swatch

Similar Messages

  • What controls the color of the cursor that selects text when you use the "Edit Document Text" tool?

    Hi, I have had a student ask me a question I cannot answer: what controls the color of the cursor that selects text when you use the "Edit Document Text" tool?
    I have only seen it appear as a black semicircle over each letter, but at a different computer in our training facility, this same tool appears as an aqua-green highlight.
    Is it a preference I never noticed? Thanks for any info.

    What version of Acrobat? What operating system?

  • Convert text to mp3 using festival

    Here is an interesting link that I found regarding converting pdf, html, etc to mp3 using festival
    http://linuxgazette.net/117/anonymous.html
    I installed festival, one voice, and ghostscript, but the above method gave me the following error while converting a pdf file to mp3
    [shantanu@bluehead ~]$ ./pdf2mp3.sh -a alok -t aloktheory alok.pdf
    ./pdf2mp3.sh: line 24: text2wave: command not found
    Assuming raw pcm input file
    LAME 3.97 32bits (http://www.mp3dev.org/)
    CPU features: MMX (ASM used), SSE
    Resampling: input 44.1 kHz output 24 kHz
    Using polyphase lowpass filter, transition band: 10548 Hz - 10839 Hz
    Encoding <stdin> to abook1.mp3
    Encoding as 24 kHz average 40 kbps single-ch MPEG-2 Layer III (9.6x) qval=3
    ./pdf2mp3.sh: line 24: text2wave: command not found
    Assuming raw pcm input file
    LAME 3.97 32bits (http://www.mp3dev.org/)
    CPU features: MMX (ASM used), SSE
    Resampling: input 44.1 kHz output 24 kHz
    Using polyphase lowpass filter, transition band: 10548 Hz - 10839 Hz
    Encoding <stdin> to abook2.mp3
    Encoding as 24 kHz average 40 kbps single-ch MPEG-2 Layer III (9.6x) qval=3
    [shantanu@bluehead ~]$
    It seems "text2speech" which I suppose is bundled with festival is not there. Where do I go from here?
    Also, I tried kallpc and don voices which are not good enough. could anyone please suggest some better voice.
    Last edited by ravisghosh (2007-10-27 04:40:30)

    I know how old this thread is
    Extra's Festival package still doesn't include the binary speech tools (e.g. text2wave), and I'm having problems building from the above PKGBUILD.
    This is a partially-highlighted build log, in case anyone is brave enough to have a look at it.
    It's long -- I apologize. There were so many errors and warnings that I wasn't sure where to snip it. CTRL-F "error" and Firefox's "Highlight all" might help here.
    I was a bit gutted; I finally got everything working/found a voice I liked, only to have to uninstall and try again
    P.S. Should I be using Phonon rather than ALSA in KDE 4? Testing KTTSD with Phonon (after I had installed Festival from extra) caused it to crash, but I'm wondering if it's worth trying to iron that problem out as well.

  • S:TextArea How change color for some chars in text?

    I have s:TextArea and i need in runtime change color for some chars displayed in text.
    How i must to do this correctly?

    pcardinale wrote:
    Initially, a control has no caption.  It's not just that the caption string is empty and the caption not visible, but the caption object does not exist.
    I think this should probably be changed in future versions, because even if each control had a caption, it would still be a negligible small part of the VI. The current behavior made sense many years ago where HD and memory space was very precious. Not any more!
    This issue comes up often enough that it warrants addressing the root of the problem.
    It is hard to convince the casual that the caption does not exist if he can simply do a "show caption" at edit time and it will show in all glory, even with the default set to the current label. It is confusing!
    There is even an idea about this that seems worth supporting (also read the link in the discussion).
    What do you think?
    LabVIEW Champion . Do more with less code and in less time .

  • How change color on form SAP 7.5

    How change color on the form when the form load (Form Partners or Invoice form). I can use SDK UI-API programing interface.
    OR
    how change color cell on matrix (matrix chose PH)

    You can use something like this as the custom validation script of the
    drop-down:
    if (event.value=="Customer A") event.target.textColor = color.red;
    else event.target.textColor = color.black;
    Make sure you tick the option to commit the selected value immediately
    (under Properties - Options), so that it will change as soon as a selection
    is made.

  • Text to paths loosing style information

    I've known this as a long standing issue and can't find any information if there's a fix or workaround. When converting text to paths - as some printers demand - I loose things like Rules assigned in the styles. Has this been addressed anywhere? Way I see it this is a huge bug that's just cost me a lot in terms of reprinting a clients material.

    If you have Acrobat, have you tried the flattener from the print production toolset? While in the comments to the linked article someone mentions it doesn't always work, it's always worked for me. I have some people I work with outside of the US where I have to send files like you are doing a few times a year.
    This is how the preset I saved for this is set up.
    The test file I just threw together has a mix of bullets, numbering, character style with a dashed underline, highlighted text that was underlined, etc.

  • How to create a radio button that changes colors

    I'm using Acrobat X and ID CS5 on Mac OS X.
    A couple of years ago someone on the forums explained to me how to create a button that changes color with each click. You can view a sample PDF at https://dl.dropboxusercontent.com/u/52882455/colorcycle.pdf. They gave me the document JS and showed me how to set the properties of the button. I've integrated the button into a particular series of PDF forms and it's worked out very well.
    Now I would like to do the same thing, but using a circle instead of a square. Can anyone tell me the best way to do this? Can I somehow set a radio button to cycle through colors in the same way? I design my forms initially in ID CS5 and then activate and format the fields in Acrobat X. I've tried using circles instead of squares in my ID document, but when I export to an interactive PDF, they're converted to squares.
    Any ideas?

    I understand how to make buttons cycle through colors-- the problem I'm having is that I'm trying to figure out how to make a circular button cycle through colors. When I export my ID document to PDF, my round button maintains it's original appearance, but when I click on it to cycle through the colors, it behaves like a square (see new PDF at https://dl.dropboxusercontent.com/u/52882455/colorcycle2.pdf).
    If I use a radio button, I can get it to cycle through colors, but I don't want it to have a black dot in the middle. Is there a way to format the radio button to not show the black dot when clicked?

  • Change the background color of a particular word without changing the background color of the rest of the text in a textbox

    Hello,
    I'm designing my own website and want to know how to change the background color of a particular word without changing the background color of the rest of the text in a textbox. If i can't do this, how can I create a Table, similar to Excel with iWeb?
    Thank you very much!
    Roger.

    If i can't do this, how can I create a Table, similar to Excel with iWeb?
    Read this :
         Create and add a TABLE in iWeb »
         More about a TABLE in iWeb »
         Sample 1
         Sample 2

  • How to make words in a text field change color in play mode by clicking on them?

    I have a text field on a slide, wanting to change the color of certain words randomly by clicking on them in play mode. I dont know what word in what order will be mentioned by the audience, so I can not set a fixed order in advance.
    Any help is appreciated.
    Thanks a lot.

    create a slide with all the text boxes in place
    duplicate the slide as many times as you have text boxes you want to change colour
    on the second slide, change the colour of one of the text boxes as required
    on the first slide, select one of the text boxes
    open the inspector:     Inspector > Hyperlink >
               enable as hyperlink > link to slide > click slide button > select the correct slide from the drop down menu
    in play mode, clicking on the hyperlink will display the appropriate slide with that text changing colour
    repeate the process for each text box

  • Change color of future typed text in a pasted document?

    How do I change color of future typed text in a copied document? Thanks. My son is doing online home schooling this year and has Study Sheets that he types in his answers.  Currently, he highlights his typed text then chooses the color.   Is it possible to auto-format this somehow? Thanks!

    Pages relies a lot on Styles. Either you can create a paragraph style with a green text colour or just create a character style with a text colour. Here is an image from a document with several character styles in colour.
    In the second image I have instead created a Paragraph style with green text colour. This is the only way you can get a template to remember a change of colour as the default is alway black. To create the styles you click on the small triangle to the left of None (for character style) or Body (paragraph style) and choose Redefine style from selection. Save as Template.
    More about this can you read in the Pages User Guide downloadable from your Pages Help menu.

  • Changing color in a text field?

    I've created a scrolling text field and it works fine but...
    ...how can I have certain lines of text be a different color,
    such as headings? When I change the color of one line, all the
    text's color changes. Thanx.

    I probably should've mentioned that I'm using dynamic
    text.

  • Text deleting when I try to change color or actual font

    I will try to explain. So say I have a photo (or blank canvas) and I have typed words on it. If later I go and double click the word (or layer, etc) so that I can change the color of the word(s) &/or change the actual font, it will just automatically delete the whole word(s) on that layer.... which means I have to go change the color &/or font again BEFORE typing anything, and then re-type it all. So I guess in other words... I guess the text is deleting when I try to change the color or actual font (after it's already typed). Sorry if that's confusing.
    (I have a Mac, and I am using the Photoshop that comes with the Creative Cloud subscription).

    Something is wrong here, the text should not delete when changing font, color or whatever.
    But try this. First off you don't need to double click to change the text atributes.
    Just make sure you are on the correct text layer, have commited the text but keep the text tool the active tool. Now in the options bar you can change any or all attributes (color, size, font etc). The text updates real time.
    You only need to select word(s) if you want that word to be in another color/font/whatever than the other words of that same text layer.
    If you want to change the attributes of more than one text layer in one go then you must select those layers before changing attributes in the options bar.

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • How do you change the color of the sign and fill text to the color blue

    How do you change the color of the sign and fill text to the color blue in a pdf document

    Is this using the "Fill & Sign" tab of https://cloud.acrobat.com/fillsign (for now text input is only black) or maybe using the Fill & Sign tool in Adobe Reader XI, or another application? 
    Thanks,
    Josh

  • How to change color of font in JTextArea without changing existing text ?

    Is there some way to keep the existing text in one color / size and change the color / size
    of the yet "unwritten" part of text ?
    Edited by: pimpcane on Dec 11, 2007 9:53 AM

    The very first paragraph of the API documentation says
    "A JTextArea is a multi-line area that displays plain text. It is intended to be a lightweight component that provides source compatibility with the java.awt.TextArea class where it can reasonably do so. You can find information and examples of using all the text components in Using Text Components, a section in The Java Tutorial."
    In other words, if it isn't obvious from that, no. The actual link to the tutorial doesn't show up here but if you go to the API documentation you'll find it there.

Maybe you are looking for

  • Unable to generate report for a specific user

    Hi all, I have a simple report in Agreements screen. The report is working fine when i Use another developer's id. But when i login using my Id and click the reports icon, it throws the following error. " SBL-DAT-00382: The same values for '<?>' alre

  • App rejected due to non-public api's

    Hi,           My App rejected due to non-public api's. Apple's Comments:  2.5: Apps that use non-public                                   "We found that your app uses one or more non-public APIs, which is not in compliance with the App Store Review G

  • Help Connecting Older Sony HandyCam to MacBook Pro

    I have an older Sony HandyCam which I have not used in years.  Trying to connect to iMove 6.0.3 and can not get the camcorder to mount so I can import.  Using USB connection since my MacBook Pro does not have firewire.  Help?

  • TS4083 Mail says I have unread emails, but no emails are marked as unread?

    When checking my mail using icloud.com, 2 of my VIP folders are saying I have unread emails, when i go into the folders I have no emails marked as unread. I have checked on my macbook mail and I also have no emails unread on there either. How do i kn

  • Problem when using BAPI_PO_CREATE1

    Hi, I am getting error message "Control indicators for controlling area UPS do not exist" when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order. Please suggest me some solution. Thanks, Son