Applying a Character Format to a Character

I am trying to apply a character format to a single character.
I have tried :
MyDoc.SetTextVal(myrange,Constants.FO_CharFmt ,"RoundFont")
and
var charFmtId = MyDoc.GetNamedObject(Constants.FO_CharFmt, "RoundFont");
var myprops = MyDoc.GetProps(charFmtId)
MyDoc.SetTextProps(myrange, myprops); 
neither work unfortunately - I have been trying for two weeks!
I know the "myrange" is Ok because I can delete characters in the range correctly and add a character instead.

I haven't done any conditional formatting yet in either Pages or Numbers, but I do know how to do a fill. Click on a cell to select it then click the tiny circle in the lower right of the cell & drag your cursor down (or right) to fill cells with the content of the first cell.

Similar Messages

  • How to apply a Character Style that's already been made in a template document?

    First of all I'd like to thank everyone that helps. I'm a complete beginner at scripting and appreciate all your help.
    I'm basically using GREP expressions to find patterns in a document and apply a Character Style which has already been made. This Character style was not made using script, but just in InDesign when making and setting up the template.
    var myDoc = app.activeDocument;
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    //GREP Expression for finding all HEADERS
    app.findGrepPreferences.findWhat = ".+\n";
    //Applying formatting changes to put into All Caps, Bold and changing the font size to 12 pt.
    app.changeGrepPreferences.capitalization = Capitalization.allCaps;
    app.changeGrepPreferences.fontStyle = "Bold";
    app.changeGrepPreferences.pointSize = "12";
    myDoc.changeGrep();
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    This is how I currently have it. I will manually define the changes to the text. The problem is, each template uses a different set of fonts and not all of them use Bold e.g. Sabon can use CE Bold.
    I would like to learn how to apply a Character Style and have tried looking around but nothing seems to work.
    Any help would be much appreciated.
    Thanks.

    select the text where u went  and run below  script after change group as per ur template.
    var myDoc = app.activeDocument;
    var mySel = app.selection[0];
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    //GREP Expression for finding all HEADERS
    app.findGrepPreferences.findWhat = "role";
    //Applying formatting changes to put into All Caps, Bold and changing the font size to 12 pt.
    //app.changeGrepPreferences.capitalization = Capitalization.allCaps;
    //~ app.changeGrepPreferences.fontStyle = "Bold";
    //~ app.changeGrepPreferences.pointSize = "12";
    app.changeGrepPreferences.appliedCharacterStyle=myDoc.characterStyleGroups.item("Style Group 1").characterStyleGroups.item("Style Group 2").characterStyles.item("Header")// Header is name of character name
    mySel.changeGrep();
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    If it's help then click yes
    Mi_D

  • How to apply one character tag to paragraphs having different tags?

    Hi,
    I'm using FrameMaker 8 on Windows.
    I'm trying to create a character tag that marks certain paragraphs so they're easier to find later. The only thing I want to change is the color. I want all the other attributes, regardless of the paragraph tag, to remain as they are.
    Here's what I've done:
    First, I highlighted the text to be changed. The text in this paragraph had font size 10 and regular weight.
    I selected New Format from the Commands menu, named it "Rewrite" and added it to the catalog.
    In the Character Designer, I set the size and weight to "As is", selected the new color, and clicked "Apply".
    So far, so good - the text is the same as before in every way except the color.
    Later, I wanted to mark some other text with this character tag. This text was in a paragraph that had a font size of 14 and bold weight. I highlighted the text and applied the "Rewrite" character tag.  I was expecting to see the highlighted text change color, but remain the same otherwise.
    However, instead of changing only the color, the character tag changed the font size to 10 and the weight to regular. It seems that, when I created the character tag and selected "As is" for the font size, this was interpreted as meaning, "Use the font size that is currently defined in this paragraph tag as the font size for this character tag." Sure enough, when I looked at the character Designer, the size was set to 10 and the weight to regular, instead of "As is" for both.
    Am I misunderstanding how to use "As is?" How can I get it to work the way I want it to?
    Thank you!
    Joyce Wermont

    CAVEAT: I'm working from memory, and this may work differently in later releases.
    To create a completely As Is character format, deselect all text before using the character designer. The "SeSet the values for the properties you want in the format. Click Create, or Update All.
    To make it work without problems, select all the text in a paragraph, but don't select the paragraph mark, then apply the character format to the selection. Applying a character format to the paragraph mark confused earlier FM releases - not sure if it's still true in later releases.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    jwermont wrote:
    Hi,
    I'm using FrameMaker 8 on Windows.
    I'm trying to create a character tag that marks certain paragraphs so they're easier to find later. The only thing I want to change is the color. I want all the other attributes, regardless of the paragraph tag, to remain as they are.
    Here's what I've done:
    First, I highlighted the text to be changed. The text in this paragraph had font size 10 and regular weight.
    I selected New Format from the Commands menu, named it "Rewrite" and added it to the catalog.
    In the Character Designer, I set the size and weight to "As is", selected the new color, and clicked "Apply".
    So far, so good - the text is the same as before in every way except the color.
    Later, I wanted to mark some other text with this character tag. This text was in a paragraph that had a font size of 14 and bold weight. I highlighted the text and applied the "Rewrite" character tag.  I was expecting to see the highlighted text change color, but remain the same otherwise.
    However, instead of changing only the color, the character tag changed the font size to 10 and the weight to regular. It seems that, when I created the character tag and selected "As is" for the font size, this was interpreted as meaning, "Use the font size that is currently defined in this paragraph tag as the font size for this character tag." Sure enough, when I looked at the character Designer, the size was set to 10 and the weight to regular, instead of "As is" for both.
    Am I misunderstanding how to use "As is?" How can I get it to work the way I want it to?
    Thank you!
    Joyce Wermont

  • How do I apply a character style to a sentence that has an '&' in it?

    Hi all,
    I'm trying to apply the Character style 'See Figure' to any mention of of the phrase (See Figure x) which  I've figured out is: \(See Figure \d+\)
    The problem I'm facing is that sometimes I will need to list multiple figure references. It will need to read (See Figure x&y) and in rare cases (See Figure x,y&z)
    NOTE: There are no spaces in the above listed numbers.
    Thank you  for your help.

    That works perfectly, thank you very much.
    Can you break it down for me in English if you have a moment please? I think I'm reading it wrong.
    Digit followed by an Ampersand (I'm confused by the square bracket and plus...)

  • How to apply bold character style with grep

    finding bold characters in a particular paragraph style
    I want to apply a character style
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.string = String.Bold;
    if (app.findGrepPreferences.appliedParagraphStyle == myPar) {
    app.changeGrepPreferences.appliedCharacterStyle = myCar1;
    app.activeDocument.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;

    Try this,
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.fontStyle = "Bold";
    app.findGrepPreferences.appliedParagraphStyle = "myPar";
    app.changeGrepPreferences.appliedCharacterStyle = "myCar1";
    app.activeDocument.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;
    Vandy

  • Applying [None] character style

    I have a script that finds text with a certain character style, cuts that text from the main story and anchors it in a frame that sits in the margin.
    Everything works fine except that I'd like to have the option of removing the character style. However, when I apply the [None] character style InD shows [None] in the character style lists but the formatting for the character style that was just removed remains on the text.
    Is there a way to have it work as if the [None] was manually selected from the character style list? i.e.: where the character style formatting is removed as well?
    Thanks,
    Ken

    Hello!
    I'm trying to start understanding this javascript thing... Does anyone know how I can modify this so it will also have the option of removing all the character styles in all the text frames, or all the stories in the document? I have several documents with 10 stories each that will need to have the character styles removed before we continue formatting.
    I took a swing at it myself, but haven't been able to get it to work. I really don't know much about scripting! Here's what I tried:
    if (app.documents.length == 0) ErrorExit("Please open a document and try again.");   
    var gScriptName = "Apply character style None keeping overrides"; 
    var gScriptVersion = "1.0"; 
    var doc = app.activeDocument; 
    var sel = doc.selection[0]; 
    var all = app.documents[0].stories.everyItem()
    if (doc.selection.length != 1) ErrorExit("One text frame or some text should be selected, or the cursor should be inserted into the text."); 
    if (sel.constructor.name == "TextFrame") { // a text frame is selected 
         ApplyNone(sel.texts[0]); 
    else if (sel.constructor.name == "Character" || // some text is selected  
         sel.constructor.name == "Word" || 
         sel.constructor.name == "TextStyleRange" || 
         sel.constructor.name == "Line" || 
         sel.constructor.name == "Paragraph" || 
         sel.constructor.name == "TextColumn" || 
         sel.constructor.name == "Text") 
              ApplyNone(sel); 
    else { 
         ApplyNone(all); 
    //===================================== FUNCTIONS  ====================================== 
    function ApplyNone(sel) { 
         var noneStyle = doc.characterStyles.item("[None]"); 
         var basedOnNone = app.activeDocument.characterStyles.add({name:"None", basedOn:noneStyle}); 
         sel.applyCharacterStyle(basedOnNone); 
         basedOnNone.remove(noneStyle); 
    function ErrorExit(error, icon) { 
         alert(error, gScriptName + " - " + gScriptVersion, icon); 
         exit(); 
    I also tried this, but to no avail.
    ar gScriptName = "Apply character style None keeping overrides"; 
    var gScriptVersion = "1.0"; 
    var doc = app.activeDocument; 
    var sel = doc.selection[0]; 
    var all = app.documents[0].stories.everyItem()
    ApplyNone(all); 
    //===================================== FUNCTIONS  ====================================== 
    function ApplyNone(sel) { 
         var noneStyle = doc.characterStyles.item("[None]"); 
         var basedOnNone = app.activeDocument.characterStyles.add({name:"None", basedOn:noneStyle}); 
         all.applyCharacterStyle(basedOnNone); 
         basedOnNone.remove(noneStyle); 
    function ErrorExit(error, icon) { 
         alert(error, gScriptName + " - " + gScriptVersion, icon); 
         exit(); 
    Any thoughts? I'm thinking that app.documents[0].stories.everyItem() probably isn't right...
    Thanks for your help!

  • Reflection applied to character/paragraph style?

    Can anyone point me in the right direction to create a character or paragraph style for using the web 2.0 reflection on text? example below...
    Thanks!

    Apologies not necessary. That previewColor property has been a mystery for quite some time, and when I finally found out what it is supposed to do, it seemed to be so bug-ridden that I quickly steered away from it and I gave up attempting to make any sense of it. But your script just avoids those bugs popping up!
    As I said in the IDS post: it's rather sad the Adobe team gave up on further developing this great hidden feature into a full one; and it's downright worrying that they left that legacy code in CS5 and later, so it could get infested with all those nasty little bugs. It leads me to think: how many more 'dead' code is there, in CS5, 5.5 and now in CS6? Could that be the reason later versions are so much slower and more buggy than my trusty CS4?
    (Point in fact.
    In CS4 and earlier on the Mac, all plugin resources are gathered into neat, small packages inside a single large indexed file. That makes sense, because every single plugin resource is just a couple of bytes long -- say, a single icon, or a single string "Menu Item Name". With CS5, the programmers suddenly took a Lazy Turn and wrote out every single resource as a single small file. That means that
    1. (Annoying!) Since hard disk space is allocated by the kilobyte (typically 4Kb chunks), 10 tiny resources totalling 1 Kb now will suddenly occupy 40 Kb of disk space. Sure, hard disk space is cheap. Apparently, it's even cheaper than doing some programming -- or even just using the load code from the last version!
    2. (Frustrating!) Locating, opening, loading, and then closing a single file takes time and resources, but after a file got loaded into memory, you can do with it whatever you want. Locating, opening, loading and then closing each of the dozens of small files per plugin takes lots of time. Is that the reason CS5.5 starts up so incredibly slow? Jongware sez: yeah for sure it won't help.
    /Point in fact).

  • How to apply inmath character style to fraction values

    Hi
    I try to apply inmath style to fraction values in indesign file.
    My code here:
    app.findGrepPreferences = NothingEnum.nothing;
                   app.changeGrepPreferences = NothingEnum.nothing;
                   app.findGrepPreferences.findWhat = myText;
                   app.changeGrepPreferences.appliedCharacterStyle = "Fraction Answers";
       app.changeGrep();             
    But it throws error "Invalid value for set property 'appliedCharacterStyle'
    Thanks
    Sangeetha

    Try this,
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.fontStyle = "Bold";
    app.findGrepPreferences.appliedParagraphStyle = "myPar";
    app.changeGrepPreferences.appliedCharacterStyle = "myCar1";
    app.activeDocument.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;
    Vandy

  • Can I have a space (before and after) on each line in a paragraph with an underline style apply on character

    I would like the result on the last image automatically without doing it with forced line and putting space manually. Is it possible with grep style?
    Thank you in advance for your answers. Sorry for my english!

    … Un petit rectificatif !
    En préparant un peu différemment le style de paragraphe "En Exergue", et donc en y intégrant deux styles de ligne imbriqués "alternés" [Red 1 / Red 2 / Red 1 / Red 2 / …],
    les 2 styles de caractère Red 1 et Red 2 n'ayant aucun attribut, il suffira, après avoir copié dans le presse-papier le petit bloc ancré (précité) de lancer une double regex [avec Multi-Find/Change, 1 seul clic !], la première ciblant Red 1, la seconde, Red 2.
    On évite le Hic! soulevé précédemment. Cela peut permettre d'accélérer le traitement. C'est certes moins fun pour les yeux !!
    Résultat :

  • How to apply a number format to a cell within a table in Word 2011??

    I am creating a fillable PDF form and I need to be able to apply a phone number format to a cell in Word 2011 similar to how it is done in Excel...Can someone please HELP me? Thank You!

    846640 wrote:
    I have to import some data form excel sheet. but the number in that sheet have been saveed as the following format mask 1,000.000(2,000.000,1,5000,00) as charchterI am wonder how to apply format mask in excel for the character cell.
    but in may table that field is a number, so how can remove the format mask from the excelsheet?So, while reading from excel how the values is coming in the variable i assume its coming with comma(,) than what happens if you try like below?
    variable_name:=TO_NUMBER(REPLACE(variable_name,',',''));
    -Ammad

  • Apply custom repeat formatting, column deletion, and sorts?

    I download a .csv sales report file weekly.  Is there a way to create and apply a pre-determined/custom formatting, deletion of columns, and "sorts?"
    The .csv data contains the same fields/headers on each week.  Then every week I go through and delete the columns that I don't need and sort the data on the same criteria.  Is there a way to save these steps and apply them with each new report I open?
    It would be the equivant in Photoshop, of "recording" "actions" and "playing" them on opened files.

    There is no way to rtecord actions but if you describe exactly what you need, I may try to write a script doing the trick.
    The most efficient scheme would be to send to my mailbox an exemple of the csv file (ten rows would be sufficient) and the Numbers document which you want to get starting from this source.
    Click my blue name to get my address.
    Yvan KOENIG (VALLAURIS, France) mercredi 24 août 2011 21:29:19
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How do I Apply a Particular Format to cells using the IFBLANK function?

    I have an excel summary tab that copies information from other tabs referencing the cost of a product (guide price and actual price).
    I've set a function on the summary tab, so that if the "actual price" cell (located on the pricing tab) is filled then this is carried over to the summary tab. If it's not, then it uses the guide
    price (from the pricing tab).
    CODE on SUMMARY PAGE
    =SUM(IF(ISBLANK('Pricing '!S14), 'Pricing '!O14, 'Pricing 
    '!S14))
    This is roughly how the data looks on the summary tab. Some of these prices are from the "guide price" cells, and some have been overwritten
    by the "actual price cells" being populated. However there's no way to tell at the moment which are being used as there's no formatting.
    ITEM 1 £0.40
    ITEM 2 £0.45
    ITEM 3 £0.35
    I need to add some sort of formatting (preferably the guide to be grey and the actual to be green and bold) to the summary page prices, so it's clear whether the guide price or the actual price is being pulled
    from the pricing page.
    Hoping someone can help me here!
    ThanksRoxanne

    Hi Roxanne,
    Thank you for posting in the MSDN Forum.
    Since the issue is more relate to the feature of Excel, I'd like to move it to Excel IT pro forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Best regards
    Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using scripting to apply the same formatting to multiple fields

    I have four text fields that when a certain checkbox (CompleteClosure) is clicked become required, accessible, and have a red border.
    When a different checkbox is clicked, they become not required, readOnly, and gray bordered. My scripting on each box contains many lines:
    form1.#subform[0].CompleteClosure::click - (JavaScript, client)
    Page1.DivisionalClosure.rawValue =0;
    Page2.PartialClosure.rawValue = 0;
    //DivisionalClosure and PartialClosure are the other checkboxes
    Page1.CompleteDate.mandatory = "error";
    Page1.CompleteDate.access = "open";Page1.CompleteDate.border.edge.color.value = "225,0,0";
    Page1.CompleteDate.borderWidth = "0.5in";
    Page1.ClosureReason.mandatory = "error";
    Page1.ClosureReason.access = "open";Page1.ClosureReason.border.edge.color.value = "225,0,0";
    Page1.ClosureReason.borderWidth = "0.5in";
    Page1.CompleteCode.mandatory = "error"; 
    Page1.CompleteCode.access = "open";
    Page1.CompleteCode.borderWidth = "0.5in"
    Page1.CompleteCode.border.edge.color.value = "225,0,0";
    Page1.ClosureMgr.mandatory = "error";
    Page1.ClosureMgr.access = "open";
    Page1.ClosureMgr.borderWidth = "0.5in";
    Page1.ClosureMgr.border.edge.color.value = "225,0,0";
    and this is just for the first checkbox.  Is it possible to group these fields or make them a subform and format them with simply:
    Page1.CompSubformName.all.mandatory = "error";Page1.CompSubformName.all.access = "open";
    Page1.CompSubformName.all.border.edge.color.value = "225,0,0";
    Page1.CompSubformName.all.borderWidth = "0.5in";
    for some reason all the formatting does not occur when this is done.  Is this the right track, or does the coding need to be entered individually for each textfield?
    Thanks in advance for any help, I'm new to this and most of the above was crafted from reading helpful info on this site.
    Message was edited by: peppemonkey

    What about an executed_date field on the table and a "where rownum=1" in the cursor?
    proc_a
    begin
         begin
              select batch_id
              into b_id
              from batch ...
              where date > xxx
                   and date > last_executed
                   and rownum = 1;
         exception
              when NO_DATA_FOUND then
                   return;
         end;
         exec(b_id);
         update batch
         set last_executed = sysdate
         where bacth_id = b_id;
         return;
    end;Bye Alessandro

  • Applying Business View format of ARA into Job Monitoring of Process Control

    Hi Gurus,
    I have an issue regarding with the Job Result of when using SOD sub-scenario in Process Control. We have integrated AC and PC and the controls that have been set for automation, however, the fields (User ID, Name, Group, Risk Description, etc.) are not showing on the PC Job result like the ARA can do. Below information are given:
    1. In ARA --> User Level --> Simulate the risk analysis with Business View format --> Result --> choosing Management Summary --> above mentioned fields are shown.
    2. In Automated Monitoring --> Choosing Management Summary --> onlyfields of technical view format are the only ones that can be shown (User ID,Risk ID and Control ID).
    Thus with this, is there any possibility that the Result of the Job Monitoring of the PC can be manipulated? If yes, can you provide some steps?
    Hope you can help me on this.
    Kindly refer on the attached file for more info.
    Thanks!
    Mackoy

    Christopher,
    Re-generating the transfer structure does not need InfoPacks to be re-created. if you are still getting the old error, two possibilities:
    1) You created a new DataSource with new transfer structure, etc. but the InfoPack in the process chain still points to the old trsnfer structure.
    2) The data in the table has some records as MM/YYYY and some as YYYYMM.
    You don't need to re-create the InfoPacks if your transfer structure is re-generated. They should work off the latest definition always.
    Cheers
    Aneesh

  • Cqwp, after succesfully creating an item style, I would like to apply some basic formatting to some fields

    My guide has been
    http://erikswenson.blogspot.co.uk/2010/03/sharepoint-2010-content-query-for-blog.html
    I am not able to figure out myself how to make the title bigger (and/or bold) or to add 'published on' before the date field.
    Also, possibly, adding the hyperlink to the name of user who posted (that links it to his profile page), number of comments (that simply links to the blog post, whether there are comments or not and also the categories that links to blog categories' posts.
    It would be enough to make the title bold or bigger, tho. I just need someone that clues me in on XML/XSL

    You can add a custom CSS class to the title and set the font style in your custom/alternate css.
    <a class="blog-post-title" href="{$SafeLinkUrl}" title="{@LinkToolTip}">
    You can try adding "Published On" text before the date as shown below:
    <div class="custom_date">
    Published On <xsl:value-of select="$StartDate" />
    </div>
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

Maybe you are looking for

  • ASA 5505 Site-to-Site VPN dropping at end of lifetime

    I have 4 ASA 5505's with Site-to-Site IPSEC VPN tunnels built between them.  One of the tunnels stays up just fine but the other 2 drop at the end of the SA lifetime for a period of time equal to 10% of the SA lifetime. Orignially, I had the the life

  • During installation of iTunes appears an error message: Itunes cannot run because some files are missing. What can I do?

    Recently I received an iPad2 as a gift. I had iTunes because an iPod I had. First I put some productivity apps through my computer. Then I bought some other games apps through WiFi. then when I try to synchronize, I lost my productivity apps and just

  • Trouble Setting "Display PDF in browser using" by MCX

    I want to force the PDF viewer in Safari to Mac OS X v10.6 built-in Preview Application instead of Adobe Acrobat Pro (9.4.0). I found that unchecking "Display PDF in browser using:" in Acrobat's Preferences, sets the viewer in Safari to Preview. It s

  • Airport extreme , can Feed through a RJ 45  to a PC laptop

    I really need a splitter / Y for a RJ45 . My G4 powerbook is wireless . I still need to feed my Toshiba laptop from the DSL modem . Nobody has a Y , they want to sell 5 port ethernet router box , ( with yet another power supply on the power strip mor

  • Upload Bank Details

    Hi All, I want to upload All Bank Details from flat file with one report for all the countries. Report-RFBVALL_0 (T code-BAUP) uploads only for one country at a time. There are more that 150 countries. Is there some standard report exist? Or some fun