Remove Local Formatting AS or JS

I'm working on a script (AS, but I can link to a JS script from it if necessary) that replaces italic, bold, bold italic, small caps, etc., with character styles. Once that's done, I'd like to go through an entire ID file and remove any other local formatting (kerning, extra space above and below, leading changes, etc.).
I know how to do this from the Find/Replace dialog (search for TX, replace with TX), but can't quite figure out how to script it and have it do the same for all paragraph styles in a job.
Thanks in advance, gurus!

Hi Rick,
May the below code helpful for you:
I not able test it here, so please check and get back in case of any issues.
//First option
app.activeDocument.stories.everyItem().clearOverrides();    //Clear document including masterpage
//Second option
var myStories = app.activeDocument.stories.everyItem().getElements();
for (i=0; i<myStories.length; i++) {
    if (myStories[i].textContainers[0].parent.parent instanceof MasterSpread || myStories[i].textContainers[0].parent instanceof MasterSpread || myStories[i].textContainers[0].parent.parent.parent instanceof MasterSpread || myStories[i].textContainers[0].parent.parent.parent.parent instanceof MasterSpread) {
         continue;
        myStories[i].texts[0].clearOverrides(OverrideType.paragraphOnly);
         myStories[i].texts[0].clearOverrides(OverrideType.characterOnly);
Thanks
Siraj

Similar Messages

  • How to remove values formatting in export to excel from ALV grid

    Hi all,
    I have small issue, I have ALV Grid with some data, but the problem is with columns containing e.g. gross amounts, because it is displayed in the grid as e.g. 1.764,81, and after export to excel it is still in this format (with dot and comma), so excel doesn't treat it as numeric value but as text, and then when I try to calculate total on the column then this values are not taken to the total. Do you know if that is possible to remove column formatting?
    kind regards,
    Marcin

    I replied too soon to Peter's suggestions.  For some reason, I was able to add new info. to my first new row, but not the second.  However, I finally figured out the problem.
    I found the Help Center page on: "Here are ways to change custom formats and apply changes to table cells:"
    To change the elements associated with a custom format that’s been applied to cells, select the cells and click Show Format in the Format pane of the Table inspector.
    I saw that the "cell format" was listed as "automatic," so I changed it to "Custom;" then left the new custom window at it's default settings. Now my cells would accept pasted info. without spreading it through the lower rows.  Whatever automatic was in the table, it was not what I wanted. Doing this to other new cells, solved my problem.  Thanks again.

  • Apple Mail.app in Leopard removes HTML formatting

    Hi,
    This is not something I see universally, but in many of my mails (Exchange account, company ID, hence, can't post screenshots), sometimes, Mail.app strips the html formatting! Sometimes, something as simple as a table is missing. All I see is the text that would have been inside it. The background colours, etc in certain mails also sometimes go missing.
    Only when someone replies to the same mail and has the original mail included, do I see the formatting!
    Also, when I open my mailbox in Thunderbird or a browser, I can see the formatting correctly in the same mail!
    Am I missing something here?
    Thanks,
    Anup

    Mail > Preferences > Composing.
    You have the option there to send and receive in plain text which will remove all formatting, maybe selected...Change to what you wish to happen

  • Locale Formatting question

    Locale Formatting question
    In the preceding code the number 50 represent currency.
    The output of NumberFormat is 50 with the local symbol
    The output of DecimalFormat is 50.00 without the local symbol
    The question is how to show 50.00 with the local symbol ???
    import java.text.*;
    import java.math.BigDecimal;
    public class LocalFormating {
    public static void main(String[] args) {
    NumberFormat nf = NumberFormat.getCurrencyInstance();
    DecimalFormat decfs = new DecimalFormat("#,##0.00");
    BigDecimal anumb = new BigDecimal(50);
    String temp = nf.format(anumb);
    System.out.println("local anumb = " +temp);
    String temp2 = decfs.format(anumb);
    System.out.println("Decimal format anumb = " +temp2);

    Locale Formatting question
    In the preceding code the number 50 represent currency.
    The output of NumberFormat is 50 with the local symbol
    The output of DecimalFormat is 50.00 without the local symbol
    The question is how to show 50.00 with the local symbol ???
    import java.text.*;
    import java.math.BigDecimal;
    public class LocalFormating {
    public static void main(String[] args) {
    NumberFormat nf = NumberFormat.getCurrencyInstance();
    DecimalFormat decfs = new DecimalFormat("#,##0.00");
    BigDecimal anumb = new BigDecimal(50);
    String temp = nf.format(anumb);
    System.out.println("local anumb = " +temp);
    String temp2 = decfs.format(anumb);
    System.out.println("Decimal format anumb = " +temp2);

  • Remove html-formatting

    Hello,
    is there any Function or other way to remove html-formatting from a string
    example
    <b>test</b>
    i only want 'test' as result
    best would be call function that returns string without formatting
    thanks very much
    Helmut

    Hi Helmut,
    Please try with following FMs:
    SOTR_TAGS_REMOVE_FROM_STRING
    HRDSYS_CONVERT_FROM_HTML
    SWA_STRING_REMOVE_SUBSTRING
    Also, have a look at following threads for more information:
    Remove HTML tag
    Remove HTML tags from a string
    Cheers.

  • Outlook Add-In invoke command 'remove paragraph formatting (CTRL-Q)'

    I want to invoke the Outlook command 'Remove Paragraph Formatting (CTRL+Q)' [1] programmatically at my Add-In. For instance is breaks the blue line on an e-mail reply. Is this possible? The command is not located at the CommandBar.
    Jens
    [1] CTRL+Q – This removes all paragraph-level formatting—weird indents, line spacing, extra spacing before and after the paragraphs, etc. Again, select the text, hold down your Control key and press the letter Q.

    Hi jfrederich,
    Base on my test, I found we could call ClearFormatting() method, then call
    ClearParagraphAllFormatting() method.
    d.Application.Selection.ClearFormatting();
    d.Application.Selection.ClearParagraphAllFormatting();
    Please try it and check whether this meet your requirement.
    Regards
    Starain
    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.
    Hi Starain, that was my first try. It doesn't work. nothing happens. The blue line resists on the front of the selection.
    Jens

  • Date formatting: how to get specific fields showing in localized format?

    Hi all,
    I would like to take a Date object and format it into the localized format while at the same time specifying which fields should be showing. E.g. ensure that I always have, day of week, day of month, month, year, hours, minutes, seconds and milliseconds regardless of locality.
    Is it possible to do this and if so how?

    For that there is java.util.Locale

  • Remove local administrator rights from multiple machines

    Hi all,
    We have a load of Macs on active directory. Most of them have local admin rights. Is there a quick and easy way to remove local admin rights and change them to standard users. I really don't want to do them one by one?
    Please give me some good news 
    Kind Regards,
    BigJava

    Hi baltwo,
    Thanks for the suggestion but I found out how to do it with this UNIX command:
    sudo dseditgroup -o edit -n . -d username -t user admin
    and running it as the "root" user.
    Thanks

  • Show local formatting

    Hello,
    I use a script to detect in InDesign document where there are local formatting styles applied. I found this script under :
    http://www.indiscripts.com/post/2010/05/show-local-formatting-in-indesign-cs4_
    It works well but I am trying to detect also when :
    the style by default is applied [ Paragraphe standard]
    any style is applied  (ex: when text was copy and paste without style applied)
    Do you know if it's possible to declare this thing ? Is there any method ?
    Thanks in advance for your help

    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 can I change a local format (bol, italics) to character style

    Hi, I'm new in scripting. I need to change local formats to character styles in some documents, but I can't find the proper ID Object Model to do it in Java. Can somebody help me?

    Thanks for the help! It worked! But I have two problems now:
    1. The documents use Helvetica fonts (light, lightitalic, semibold, etc.) on headings, and the script doesn't recognize nor replace them as character styles. I guess I should replace those fonts with a compatible one (Times New Roman, perhaps). Is there any script that may do that?
    2. Some paragraph styles use bold by default, but the script generates a character style in that cases too. The perfectpreptex you send me attend to fix this problem, but the styles document crashes!!

  • How do i remove local copies of my iCloud files from my iPhone?

    I have a 32GB iPhone 5. I've been using iCloud since its beginning and it does a great job of keeping everything in sync across all devices, but the more I use it, the more I see it taking up space.  How do I remove all of the local/hard copies of my iCloud files from my device without deleting them from iCloud, also? Particularly, i've noticed that, in Keynote on iOS, my presentations will have the cloud icon, showing that they are available for download, but not actually on my device... once i download a presentation to my phone, how to i remove the actual file from my phone, while keeping my icloud copy available for future download? I would love to be able to do this with all of my iWork files on iOS, as it would save me a few gigs of data storage on my iPhone.
    in similar fashion, is there a way to remove the local files from my Photostream on my iPhone, while keeping them available to view in a "streaming" fashion? As it is now, if i take an HDR photo and save the HDR and the standard to my camera roll, it then uploads both images to Photostream, which is great, but then i have another copy of both images stored locally on my phone in my photostream folder... this means if i hit the shutter once i wind up with four 8MP images stored on my device... that adds up fast. I understand that people want the security of knowing they have a hard copy backup, but I would love to have the option, at least, to keep my photo stream from being stored on my iPhone/iPad... I want to be able to stream my pictures, just like i stream my music with iTunes Match.  Does this make sense? Does this option already exist and i've just missed it?
    Any help with either of these will be a HUGE help, and very appreciated.

    Verizon Wireless Customer Support wrote:
        Hi, rhart-
    Like commonsense101 stated, you can forward the text messages to your email address, that typically does not include the original timestamp, but it's still a good way to keep special texts. If in regards to legal situations, a court order may be obtained for those records as well.
    Thank you,
    AdamE_VZW
    Follow us on Twitter @VZWSupport
    So Verizon keeps every text message that someone sends and/or receives?

  • How to convert Localized formatted String in Amount?

    Hello All,
    I have once scenario where I need to convert localized string amount to parse and make it long amount.
    Example: In russia, people write 1000 as "1 000".
    Now what I need to do is to parse this "1 000" and get 1000.
    Is there any way in java, which can identify if the particular string is localized price in some Locale and give us the normal long output?
    Thanks,
    Jenish

    The char after the 1 of 1 000 is not a space (value: 32) it's a no-break space (value 160). Copy this line and paste it into your code:System.out.println(nf.parse("1&#0160;000"));And please read the announcement(s) at the top of the forum listing, they're there for a purpose. Then edit your post and format the code correctly.
    db
    edit Dang, the forum parsing (or maybe the browser rendering) converts that to a normal space :( Trying again... and again ...
    No, it appears both &amp;nbsp; and &amp;#0160; are corrupted to a &amp;#0032; no matter how I try it. One more try, with pre tags instead of code tags
    System.out.println(nf.parse("1 000"));Nope. With noformat
    {noformat}System.out.println(nf.parse("1 000"));{noformat}
    On a Windows computer, you can type the no-break space using Alt-0160 or copy it from the Character Map. Other than that, here's my best attempt to illustrate what's going on:NumberFormat nf = NumberFormat.getInstance(new Locale("ru", "RU"));
    try {
      System.out.println("1 000".equals(nf.format(1000))); // false
      String thousand = "1" + ((char) 160) + "000";
      System.out.println(thousand); // looks like 1 000
      System.out.println(nf.parse(thousand)); // 1000
    } catch (ParseException e) {
      e.printStackTrace();
    }Edited by: Darryl Burke

  • Best way to remove local variables

    Hello,
    I have been told that I need to remove all the local variables in my VI, because they are slow.  I can not seem to find a good option for replacing them but keeping the same functionality.
    What I am using the local variables for is to update 3 different graphs on the front panel from 3 different sources.  Each of these sources are located in while loops so that data can be acquired asynchronously.  In closing these 3 while loops is a case statement.  The case statement is for switching between acquiring and saving the data or just acquiring data.  The local variables are used to update the indicators and graphs from the acquiring and saving data case.  It is these local variables that I need to remove.
    Does anyone have any suggestions?
    -- Z

    Zurvan wrote:
    I have been told that I need to remove all the local variables in my VI, because they are slow.
    Who told you that?
    As others have said, local variables typically don't cause slowdown (They cause additional datacopies in memory, have the potential of causing race conditions and cause messy code).
    What is "slow" in your definition? (missing data, cannot keep up with the instrument, slugging UI, etc.).
    What is the CPU use when your program runs?
    So apparently you have a loop that updates all indicators from local variables. What is the loop rate of that display loop? Do you spin that millions of times per second or pace it at a reasonable rate? How much data is in the graphs?
    Remember, a graph does not need to update unless the data changes.
    LabVIEW Champion . Do more with less code and in less time .

  • How to ignore/remove number format mask ?

    Hi
    I have to import some numbers from the excel sheet, and that number has been saved along with the format mask like (9,999.99) (2,000.00,1,500,00,......)
    but that field in my table is a number filed and i have to equal that number with the number that exist in my table
    i have write that relation like
    mytable.filed1=to_number('excel_filed',9,999.000)
    but I does not work
    So what the solution for that
    Thank you

    Double post. See How to remove a number format mask ?

  • Cisco Aironet Remove Local MAC Address List (all)

    Hi All,
    I need to remove all MAC addresses in the LOCAL MAC Address List on a Cisco Aironet. I do not want to remove running config on the device as we have changed over to a RADIUS Server.
    Can anyone give me some advice please?

    I have found a solution, please close this forum post.

Maybe you are looking for

  • ORA-01422- exact fetch returns more than requested number of rows in D2K Report

    Hi All, Greetings. I am using a report which is being called from the from in one of my application. The report is working fine from quiet a long time. I have an error with a particular record alone and it is working fine for all other records. When

  • Nokia e6 Belle mms problems

    My e6 is unlocked and with its previous version i had no trouble sending and recieving multimedia messages. i updated it to nokia belle and now i cant send or recieve mms messages. my sim card is telstra 3G. What do i need to do to make it better? it

  • Transferring photos from laptop to Itunes

    I had to do a systems restore on Iphone. The only thing that bothered me was losing the photos, i found most of them stored on my laptop. Is there any way of transferring them to Itunes and thus onto my Iphone when i sync?

  • Audiobooks disappears from Audiobook folder

    I have a 8gb 2gen ipod nano and the problem is that when I start my iPod I can see my audiobooks in the audiobook folder but as soon as I play any music the audiobooks disappears from that folder but can still be seen from artist folder. This only ha

  • How to truncate the first part of ID

    My problem is this. In my Service Request i have create a new field. I want that this field is the last 6 number of the N. SR How do i do? Sostantially if the N. SR is 485218-305439087 my field must be 439087(the last 6 number of N.SR). Thank you Reg