adding to the text format within the framework

Hello

Im trying to add text with different styles (for example, font, size, color) of formatting that is not separated by a space:

An example:

'frame' is a textframe

frame.parentStory.insertionPoints.item(-1).contents = "text1";

frame.parentStory.words.lastItem () .appliedFont = "Arial";

frame.parentStory.words.lastItem () .pointSize = 10 ";


frame.parentStory.insertionPoints.item(-1).contents = "text2";

frame.parentStory.words.lastItem () .appliedFont = "Times New Roman";

frame.parentStory.words.lastItem (.pointSize) = 12 ";

After that, "text1text2" is formatted in "Times New Roman., 12Pts.

I tried to separate 'text1' and 'text2' with 'SpecialCharacters.hairSpace', but this did not help.

Someone has an idea?

Thank you!!

Use the ranges of characters rather than words:

frame.parentStory.insertionPoints.item(-1).contents = "text1";
frame.parentStory.words.lastItem().appliedFont= "Arial";
frame.parentStory.words.lastItem().pointSize = 10;
endIndex = frame.parentStory.characters.item(-1).index;
frame.parentStory.insertionPoints.item(-1).contents = "text2";
frame.parentStory.characters.itemByRange(endIndex+1, frame.parentStory.characters.item(-1).index).appliedFont= "Times New Roman";
frame.parentStory.characters.itemByRange(endIndex+1, frame.parentStory.characters.item(-1).index).pointSize = 12;

.. Although in this case, it is easier to first change of setting in shape from the last insertion point and then insert the text:

frame.parentStory.insertionPoints.item(-1).appliedFont= "Arial";
frame.parentStory.insertionPoints.item(-1).pointSize = 10;
frame.parentStory.insertionPoints.item(-1).contents = "text1";

frame.parentStory.insertionPoints.item(-1).appliedFont= "Times New Roman";
frame.parentStory.insertionPoints.item(-1).pointSize = 12;
frame.parentStory.insertionPoints.item(-1).contents = "text2";

Tags: InDesign

Similar Questions

  • Is it possible to find a xmlelement within a framework of specified text or the specified page?

    Hi all

    Is it possible to find a xmlelement within a framework of specified text, or in a specified page?

    Kind regards

    Cognet

    Try this (not tested...)

    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "\\d+|\\w+";
    found = app.selection[0].findGrep (false);
    for (j = 0; j < found.length; j++)
    {
        if(found[j].texts[0].associatedXMLElements[0].markupTag.name == "xref")
        {
            found[j].texts[0].associatedXMLElements[0].select();
        }
    }
    

    Vandy

  • Are you limited the number of subfolders that can be added to a current folder within the document library?

    Original title: new folders

    Are you limited the number of subfolders that can be added to a current folder within the document library? I tried to add folders using the new folder tab and it will create not one. I hope I make this clear enough question. I'm not computer savy.  Thanks for your help.

    If you cannot create a new folder anywhere, this could apply.
     
     
    Do, or you have installed Chrome? It appears that an update of Chrome, (mid April 2013), is responsible for the loss of the option new folder. Even if Chrome has not been installed, here are two patches.
     

    How to remove and restore the default context Menu items 'New' in Windows 7 and Windows 8
    http://www.SevenForums.com/tutorials/28677-new-context-menu-remove-restore-default-menu-items.html
     
     
    If for any reason, the zip file doesn't work for you, check out the 'response' by Linda Yan in this thread.
    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/thread/97de8a2a-12f2-4381-A409-a78f4ae551cf/#99395761-56de-4a76-8C2A-eab498ad735a
     
     
    Tip: When you save the text in Notepad, the default file format is .txt. Replace all files.

     
  • Sequence step results in the report in Simple text format

    I use Teststand 2012 and that you have installed the plugin from model simple text report.

    My main test sequence called a number of subsequences that contain the test steps and contain also several subsequences. A number of the subsequences is only stocks. My test result file contains all the results of measures of test as expected, but it also contains a line of output for each call of sequences - makes it difficult to see the results that count. I would only record the test steps.

    Looking at the code SimpleTextReport.dll in CVI I see it is stepping into the results and updated list in the form of each line (I changed some of the formatting). Is this the right place to filter the levels of appeal of sequence or can I stop the call sequence steps to be added to the list of results?

    You can put it in the sequential model. Just use ProcessModelPostResultListEntry with the same code. If it's in the template, you won't need it in other files. In addition, he is probably already stuff in the model. You'll have to code around it. This is how they do it on the fly.

  • Adding Notes to text on the diagram

    I'm working on a data model with about 250 paintings - there are several paragraphs, isolated in the model that I had to be able to identify with free shape on the diagram text notes - this possible to do?

    If this isn't the case, I want to present this as an enhancement request. He made models of big data, much handier and more readable by less technical people working on the project.

    Hello

    Yes, you can add Notes to a diagram by clicking on the yellow "New Note" icon on the toolbar, and then clicking where you want the note to be added to the schema.

    You can change the default size of color or font for the Notes on the page of Modeler/schema/data Format of the Preferences (open the menu Tools/Preferences) dialog box.
    Or you can change the size of color or police for an individual Note by using the Format option in the menu when you right-click on the Note.

    David

  • Well, how to trim the sides of my 1.33: 1 HD which is within a framework of HD 16 X 9?

    I looked and looked, but I don't see tutorials on zoom in 2.35: 1 things to crop the upper and lower bars.

    I had families Super8 film transferred to HD, and they are 1.33: 1, within a framework of 16 X 9 (1.78: 1). So that they have side bars. I'd love to get rid of them for certain exports no HD on Vimeo. BUT HOW? The files are mjpegs 1080 p at 29,98 fps.

    Yes, I messed around with the settings, but always just come with a few wonky sh *.

    Where my question.

    super8example.jpg

    On the Source export settings, click crop. You can select 4:3 in the drop-down list of the Proportions of harvest. This will push crops how to one size, but you can adjust the size and position of the harvest as needed to center the top.

    Once you choose your Format and preset (or tweak you want out of the 4:3), switch back and forth between the tabs Source, and output to make sure that you get a clean culture. Once you have it if you want, save yourself trouble and create a new preset, which you can then apply to clips as much as you want.

  • After re - install, when I "answer" text of the sender is in plain ASCII text format, regardless of the settings.

    I had trouble with Thunderbird, I so re-installed. (Version 38.2.0) I use TB for years, usually with no problems. But this time, after re - install, when I "answer" text of the sender is in plain ASCII text format, regardless of the settings. And plain text is bright blue!

    I want to preserve the HTML format (usual) of e-mail of the sender when I answer. My settings specify the HTML format.

    I don't want to use TB with this "disability" - help! Thank you!

    I don't see where you checked the compositions and the addressing of adjustment to your account. For all accounts also.

  • Text formatting on SegmentedControl and inside the drop-down list

    Hello

    I'm trying to change the color of the text on the buttons of a SegmentedControl and part of a drop-down list.

    I don't want to change the skin, but only the text. With the drop down menu, I managed to change the upper part (just what you see when the drop down menu is closed) using

    myDropDown.button.setTextFormatForState(myUpColor, SkinStates.UP);
    

    etc, but with the elements inside the list and buttons SegmentedControl I can't find a property that lets me set the text format...

    Any ideas?

    It doesn't seem to be an easy way to do.

    The only way would be to extend the SegmentedControl and then override the following method with the following code. It should do the trick. We will work on making that it puts far more easily in the future.

    override protected function onButtonAdded(child : RadioButton) : void
            {
                var dpLength : int = __dataProvider.length;
                child.width = Math.round( width / dpLength );
                // change this to be percentages
                child.groupname = __groupName;
                //Set your formats to whatever you like here.
                            child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_DISABLED ), SkinStates.DISABLED );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_OUT ), SkinStates.UP );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_DOWN ), SkinStates.DOWN );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_SELECTED ), SkinStates.SELECTED );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_SELECTED_DISABLED ), SkinStates.DISABLED_SELECTED );
                child.drawNow();
                // set the button text formats here
            }
    
  • How to show the white space of the text formatted?

    Hello

    I use Jdev 11.1.1.6.0 with ADF Faces.

    I have a requirement to show a text report page in recorded format. The report in text format is saved as a text report several records with each line containing the maximum 78 characters.

    Each drive is formatted with a space to display the data in the column. For example:

    SUMMARY

    -------

    Col1 Col2 Col3

    xyz1234 abc9999 mno1234

    ...

    The report data appears currently unformatted. It removes the white space and shows just with a few default spaces. Something like:

    SUMMARY

    -------

    Col1 Col2 Col3

    xyz1234 abc9999 mno1234

    ...

    Thus, you cannot read the data with the appropriate column header. If you query the table in SQL Developer, it shows with perfect formatting. Also our legacy Oracle Forms application to display with the correct format.

    Currently, I tried following, but it does not work:

    < af:outputText value = "#{row.rptText}" id = 'ot1' "

    inlineStyle = "do-family:"Courier New";" font-size: 12.0pt; »

    noWrap = "false" / >

    I tried this on af:column too, especially noWrap = 'false', but so far without success.

    Any help is appreciated.

    Thank you

    JAI

    If you can use a converter custom jsf (validation and conversion of entry) to change in the query using "pre" helped the (text with pre sourrounf) when the data is rendered. The converter must implement two methods. Then you can try to use ' ' as a space of unbreakeable instead of simple spaces.

    Timo

  • Paste the text formatted in inDesign

    Hi all

    I'm trying unsuccessfully to paste text formatted in InDesign CC (2015)

    I tried the following:

    Preferences ()Clipboard handling > option button for pasting of formatted text) in InDesign are defined to manage information. No chance!

    I tried with different formats, .rtf, .doc, etc., using the show import options when placing the text. No luck.

    Can someone guide me in the right direction?

    Best/Jonas

    Sorry about the URL, try this: http://www.lynda.com/InDesign-tutorials/Using-Word-InDesign-Together/122930-2.html

    You can map Word styles to Indesign Styles.

    Derek

  • How to identify the fonts used in text format?

    How to identify the fonts used in text format?

    Hi DSB.

    Open the document in Reader, go to the menu file-> properties, then click on the tag are. You will see a list of the fonts used in the document.

    Another option is to copy the text and paste it into MS Word, where you can simply move your mouse over the text to display the name of the font.

    Kind regards

    Nicos

  • Whenever I have save my PSD, it automatically rasterizes all text layers within the entire file. Help

    I'm an Art Director who is very familiar with the following Adobe CC - but something strange happening that I can't understand. I'm working on a project that must constantly updated Web pages when providing info, etc. changes - so I need to make small alterations quick both imaging and copying. My big problem is everytime I save the PSD, it automatically rasterizes all text layers within the entire file. I have never experienced this problem before - and it's super super frustrating. Help

    Hi steffi_steff,

    Would suggest to reset the preferences of Photoshop to the default state and then try to save the PSD file.

    You can follow this link to reset the Photoshop preferences:

    Using Photoshop | Preferences

    Kind regards

    Claes

  • Hi, I would like to add an image in my video for 2 seconds, then only within a framework of the video running (to cover some part of the picture in video for 2 seconds. Is it possible to do?

    I would like to add a photo in my video for 2 seconds, then only within a framework of the video running (to cover some part of the picture in video for 2 seconds. Is it possible to do?

    Just add your photo on a higher video track, it will cover up to a below. You can use the effects of movement to move and scale the image.

  • How to get the text formatting in the tables

    Dear experts and aid

    For my project, I import an RTF file and then read the data into 3 tables. It works fine when just using the contents of the string of paragraphs. However, the final script should be able to read and to replace the text formatted...
    Why use intermediate tables? Because otherwise I need to swap between two fm-documents (and you can be a part of the book).

    The imported file starts with a certain number of lines separated into two parts by a TAB ("designates a TAB in \x08 FM)
    [[Garneau, 1990 #12]]    »   [9]
    The good article can also be locally as text, e.g. [9]
    Then follow the same (or smaller) number of paragraphs with text formatted like this:
    [9]"D. Garneau, ed., National Language Support Reference Manual (national language Information Design Guide. Toronto, CDN: IBM National Language technical Centre, 1990.

    Is it possible to replace in the body of the function below the next song

      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      }
    

    with this

      while(pgf.ObjectValid()) { 
        gaBibliography.push(pgf);
        pgf = pgf.NextPgfInFlow;
      }
    

    Do I need a special statement of the gaBibliography range?
    And how to get the right part of the lines as formatted intro thingy in table gaFmtCitsFmt ?

    Currently, I read in the tables as "strings" (function GetText not shown):

    var gaFmtCitsRaw  = [];                           // left column in processed RTF
    var gaFmtCitsFmt  = [];                           // right column in processed RTF
    var gaBibliography= [];                           // bibliography lines from processed RTF
    // filename is something like E:\_DDDprojects\FM+EN-escript\FM-testfiles\BibFM-collected-IEEE.rtf 
    
    function ReadFileRTF (fileName) {
      var nCits=0, nBib = 0, openParams, openReturnParams, newDoc, pgf, pgfText ;
      var TAB = String.fromCharCode(8);               // FM has wrong ASCI for TAB
      var parts = [];
      
      openParams = GetOpenDefaultParams();
      openReturnParams =  new PropVals();  
      newDoc = Open (fileName, openParams, openReturnParams);  
      pgf = newDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  // get first pgf in flow
    
    // --- read the temp/formatted citations  
      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        if (pgfText.substring (0,2) == "[[") {        // citation lines start with [[
          parts = pgfText.split(TAB);                 // get the two parts of the line
          gaFmtCitsRaw.push (parts[0]);               // Push the result onto the global array
          gaFmtCitsFmt.push (parts[1]);
          pgf = pgf.NextPgfInFlow;
        } else { break }
      }
    
    // --- read the bibliography
      while(pgf.ObjectValid()) {                      // until end of doc
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      }
      newDoc.Close (Constants.FF_CLOSE_MODIFIED);
    } // --- end ReadFileRTF
    

    The following questions will then be how to change the script of FindAndReplace of Ian Proudfoot for managing text formatted as replacement. I will need to use the copy and paste IMHO...

    Klaus, okay, before pasting, you must assign the TextSelection object at your insertion point.

    // Add a new paragraph after the current paragraph.
    var newPgf = oDoc.NewSeriesPgf (lastPgf);
    var textRange = new TextRange (new TextLoc (newPgf, 0), new TextLoc (newPgf, 0));
    
    oDoc.TextSelection = textRange;
    oDoc.Paste ();
    

    -Rick

  • How can I activate the bold/italic text formatting in the module of blog on the Web site?

    For some reason, I can't figure out how to activate more options on our blog of text formatting. We used a model of muse blog module. I customized the module to apply fonts, we used on our Web site. The body of the text on the blog is Lato.

    Link to the blog: Coupar Consulting

    When we're going to write a post, you can use the bold/italic options and it appears in the editing window, as shown in the screenshot below:

    Screen Shot 2014-11-07 at 12.31.07 PM.png

    The police is not correct, but because I placed the police in the module to use Lato it shows as lato when you publish, see overview below (don't note any text in bold or in italics):

    Screen Shot 2014-11-07 at 12.32.32 PM.png

    What Miss me?

    Thanks in advance!

    Use your browsers console and inspect the tool. It becomes very easy.

    address, caption, cite, code, dfn, em, strong, th, var, optgroup

    {

    font style: inherit;

    Police-weight: inherit;

    }

    Line 34 ish in French - http://www.couparconsulting.com/css/site_global.css?3869595648

    This overides the fat police style on fort.

Maybe you are looking for

  • can firefox sync please send my recovery key to my email so I can recover my data?

    I built a new pc and formatted my old hard drive and before I formatted I thought to create a firefox sync account to get my stuff back, and I didn't notice I have the key recovery needed to do this.firefox help would be appreciated

  • Disassembly of the Qosmio G50

    A few months ago I spilled a glass of wine the keyboard of my G50. End of G50, flashing orange power light and would not turn. Insurance replaced with a nice model of Satellite AC and no data has been lost. I would now like to see if the G50 can be r

  • both simple timestamp

    This should be easy. I would get a timestamp in the simple long format. The timestamp in seconds gives me this in a weird form that I can't get a long. How can I convert to this basic format?

  • Slate 21 - How to save apps on sd card...

    Hi all Recently got my slate 21 and love him - it's a little amazing Kit, but... Is there a way to save apps to sd card, as you would on other devices? Also, even if I'm here, is it peripheral s still under development for? Be it get updated for the

  • CHKDSK does not complete

    I tried to run chkdsk for several days without success.  I'm running it with the switches / r/f. The error message I get is: CHKDSK checks the files (stage 1 of 5)...360896 file records processed.Verification of complete filesDelete orphan file recor