Find without small caps italic and apply cstyle

Hi All,
I have small caps (nested) line with italic text (see the screenshot), I have tried to apply the "small caps italic" character style successfully. After that I will apply the "small caps" cstyle to only small cap's text, but not working my script, can you please correct this.
var itals = ["Italic", "Light Italic", "LightItalic", "Book Italic", "Cursive", "Light Condensed Italic", "Book Condensed Italic", "Ultra Condensed Italic", "Ultra Italic", "Condensed Italic", "ThinItalic", "BookItalic", "LightItalic", "BookItalic", "UltraItalic"]
var smallCaps = ["Small Caps & Oldstyle Figures", "55Roman Small Caps & Oldstyle Figures", "smallCaps"];
Fix_All_SmallCaps_Italic()
function Fix_All_SmallCaps_Italic()
    try
        var myCStyle7 = app.activeDocument.characterStyles.item("15 Small Caps Italic").name;
    catch(myError)
        var myCStyle7 = app.activeDocument.characterStyles.add({name: "15 Small Caps Italic", capitalization: Capitalization.SMALL_CAPS, fontStyle: "Italic"})
    for(i=0; i<itals.length; i++)
        app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
        app.findTextPreferences.fontStyle = itals[i];
        app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS;
        app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps Italic";
        app.activeDocument.changeText();
//~ exit(0);
Fix_All_SmallCaps();
function Fix_All_SmallCaps()
try
    var myCStyle6 = app.activeDocument.characterStyles.item("15 Small Caps").name;
catch(myError)
    var myCStyle6 = app.activeDocument.characterStyles.add({name: "15 Small Caps", capitalization: Capitalization.SMALL_CAPS})
for(sc=0; sc<smallCaps.length; sc++)
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.fontStyle = smallCaps[sc];
    app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps";
    app.activeDocument.changeText();
//find attribute and apply character style
var myDoc = app.activeDocument; 
var mcstyle = app.activeDocument.characterStyles.item("15 Small Caps Italic").name;
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS;
app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps";
var myFind = myDoc.findText(); 
for(var j=0; j<myFind.length; j++){
if(myFind[j].appliedCharacterStyle.name == mcstyle){
    alert(myFind[j].contents)
    continue;
else if (myFind[j].appliedCharacterStyle.name != mcstyle){
app.activeDocument.changeText();}

Hi Jarek,
I can't get the output,
itals = ["Italic", "Light Italic", "LightItalic", "Book Italic", "Cursive"]
Fix_All_SmallCaps_Italic()
function Fix_All_SmallCaps_Italic()
    try
        var myCStyle7 = app.activeDocument.characterStyles.item("15 Small Caps Italic").name;
    catch(myError)
        var myCStyle7 = app.activeDocument.characterStyles.add({name: "15 Small Caps Italic"})
    try
    var myCStyle6 = app.activeDocument.characterStyles.item("15 Small Caps").name;
catch(myError)
    var myCStyle6 = app.activeDocument.characterStyles.add({name: "15 Small Caps"})
    for(i=0; i<itals.length; i++)
        app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
        app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS;
        app.findTextPreferences.fontStyle = itals[i]
        var myFind = app.activeDocument.findText();
        for (j=0; j<myFind.length; j++)
        if (app.findTextPreferences.fontStyle == itals[i])
            app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps Italic";
            app.activeDocument.changeText();
        else if (app.findTextPreferences.fontStyle != itals[i])//I locked here
            app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps";
            app.activeDocument.changeText();
Can you please correct this.
selva

Similar Messages

  • Find/Change words (with GREP) and apply a style...

    I need a Script for Find/Change words with GREP, and apply a paragraph style...
    Thanks...

    Hi Marcos,
    If you want the script to create character styles: Bold , Italic, Bold Italic, etc, and replace local formatting with these styles, use scripts in post #3.
    But if you want find and change words, or/and replace local formatting with styles defined by you, use FindChangeByList script.
    If the latter, I recommend you to download and install Record Find Change script (written by Martin Fisher).
    Then choose settings you need in Find-Change dialog – make sure they work as expected – and run Record Find Change script. A Notepad/TextEdit file will pop up with a line containing the recorded setting. Copy it, open FindChangeList.txt, delete the contents of this file and paste the line you just copied (or add it to the bottom of the file).
    Repeat the process for all find-change operations you need.
    Finally run FindChangeByList.jsx to make all changes in one go.
    However, while using Record Find Change script, you may encounter a problem: it doesn’t record paragraph and character styles placed inside a group. But you can write references to such styles like so:
    appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Style Group 1"). paragraphStyles.item("Paragraph Style 1")
    Kasyan

  • Find a window in XMonad and apply some actions to it

    Hi everyone, I think this should be really easy for someone who's good at Haskell but I just couldn't figure it out as I'm bad at it.
    Basically I want to search through the list of windows in the current workspace, find one matching some condition and apply some action to it; if not found then create this window.
    I had a skeleton code like this
    import qualified XMonad.StackSet as W
    import XMonad.Actions.WindowGo
    findWindow condition actionIfFound actionIfNotFound =
    ifWindow (condition <&&> member W.current) windowFound actionIfNotFound
    where windowFound = ask >>= w -> do actionIfFound w

    Hi guymatsuda,
    If you are having an issue locating a previously purchased song, you may find the following articles useful:
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Apple Support: Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/HT2519
    Cheers,
    - Brenden

  • CS4 small caps size and tracking

    Found something annoying. Maybe someone can confirm it (or explain it?)
    before I file a bug report. I'm using 6.01.532 on Windows XP SP2.
    Set some type in full/small caps using a font that doesn't have true
    small caps. Change the small caps size to something ridiculous (like
    30%) in Preferences and you should be able to see the change when you
    okay Prefs. Now set some tracking on the type and try to change the
    small caps size in Preferences again.
    Does your type show the change, or does it ignore your setting in
    Preferences?
    Kenneth Benson
    Pegasus Type, Inc.
    www.pegtype.com

    Thanks, Peter
    I can't duplicate it today. I did try restarting ID yesterday (and it's
    been restarted again this morning), and it was showing up yesterday only
    hours after trashing prefs due to a different problem (that was fixed by
    trashing prefs). Mystery.
    Kenneth Benson
    Pegasus Type, Inc.
    www.pegtype.com

  • AMs and PMs - how to search for small-caps?

    In my book I'm proofreading I have a mixture of (because I was undecided when I was putting it together):
    i 7.00 a.m.
    i 7.00 am
    i 7.00am
    I ran these three options past about twenty people this morning, 6 voted for the first, 8 voted for the second, 3 voted for the third, and 1 person and myself voted for the option I can't show properly here: small-caps: 7.00 AM. Then of course there was the wag who told me: "Why don't you just say '7 o'clock in the morning' "? And the complete ratbag who suggested, in the interests of avoiding confusion: "7.00 am o'clock in the morning before lunch at 0700 hours."
    Before I make them all the same format, which will very likely be small-caps, I want to make sure I can easily search for them so I can replace with an alternative style if I change my mind again later on.
    QUES: How do I search for "AM" and "PM" (spaces before and after) if they are formatted in small-caps? I can't use paragraph styles because the AMs and PMs appear in a variety of styles already.

    Thanks for all the hints. I'm going to try some of them to see how they work. I should make it clear though (my original post may have been unclear about this) that I was asking how to search for AM in small caps AFTER I had changed all time-formats to that form.
    As for why I asked for input: I treat my book a bit like a democracy and give people a chance to vote on certain aspects and make comments just in case they have a good idea that I hadn't thought of; but yes, I'm the boss, and in terms of votes mine counts for 95%. In this case, someone suggested using a colon -- which I have taken on board. So I will be using the time format 7:30 AM to see how it looks. But if I don't like it, I want to be able to find all the small-cap AMs and change them to something else in one go.
    My interest in time-formats has stirred some interest locally. My partner proof reads a walking club magazine and she received the latest edition lat night. She has never concerned about time formats before, but after my foray into different options, she came up with the following variety (the club has lots of reports that include times when walking trips start and end), even though she thought she had done a thorough job of proof reading:
    9 am
    9.00am
    9:00 am
    9:00am
    9.am
    9 AM
    9.00a.m.
    9.00 a.m.

  • Why does CS6 InDesign Book epub output generate and apply new graf and character style names in CSS?

    I created an InDesign book composed of documents that had had no paragraph or character styles in the palettes until text was copied over from a single overall document. I worked absolutely as clean as I could.
    I synchronized the book to that single overall document several times, including immediately before exporting the book to epub. My export settings disallowed any local formatting. Character styles were restricted to one named "Italic" for which the only format applied was Italic in the Font Style field, and one named "Small Caps" for which NO formatting was included in the character style.
    There was, as far as I can see, no reason for any character or paragraph styles to export to anything but identically-named CSS entries. That is to say, any text with the character style "Italic" applied in the InDesign doc should have output with the same text with a span class entry of "Italic" around it.
    I still ended up with p and span CSS entries with extra numbers appended to them:
    span.Italic {
    font-style:italic;
    font-weight:normal;}
    span.Small-Caps-1 {
    font-variant:normal;}
    span.Italic-1 {
    font-style:italic;
    font-weight:normal;}
    span.Small-Caps-2 {
    font-variant:normal;}
    span.Italic-2 {font-style:italic;
    font-weight:normal;}
    span.Small-Caps-3 {
    font-variant:normal;}
    span.Italic-3 {
    font-style:italic;
    font-weight:normal;}
    and
    p.x-SECTION-BREAK, p.x-SECTION-BREAK-1, p.x-SECTION-BREAK-2, p.x-SECTION-BREAK-3  and so on.
    Why would the InDesign epub output engine choose to generate and apply new spans and paragraph-level styles, which multiply the complexity of editing the CSS directly? How can I prevent InDesign from doing this?

    Perhaps I wasn't clear. When I wrote "an InDesign book composed of documents that had had no paragraph or character styles in the palettes until text was copied over from a single overall document" I meant to emphasize  the part where I CLEARLY said "UNTIL text was copied over." The text I copied over had plenty of paragraph styles. I was trying to point out that each individual document had no PREVIOUSLY EXISTING character or paragraph styles that might have added complexity to the epub output. .
    So, every paragraph in each document had a paragraph style attached, a total of maybe 20 different paragraph styles throughout the book. The only CHARACTER LEVEL styles I cared about exporting were Italic, for text that was set in italic, and Small Caps, for CAPITALIZED text that I wanted to be able to make smaller in the CSS, since I am not allowed to embed fonts and therefore have no other way of creating small caps in the xhtml files inside the epub.
    So, given that I had two character styles applied to various bits of text throughout my InDesign book ("Italic" and "Small Caps"), I would like to know why there are multiple CSS entries generated: Italic, Italic-1, Italic-2, Small Caps, Small Caps-1, Small Caps-2, and so on.
    Ditto paragraph styles. I had a paragraph style called "SECTION BREAK" in each document. Not only did paragraph style "SECTION BREAK" contain identical specs in each document--I know they did because I copied each from one single doc where they were being used identically--but I also synchronized the book repeatedly.  So why would the xhtml docs and the CSS output need p.x-SECTION-BREAK-1, p.x-SECTION-BREAK-2, and p.x-SECTION-BREAK-3?

  • Small Cap Bug

    Apologies if this has been answered, but I tried to do a search on the forum.
    I know in CS2 there was a bug with small caps. Has this been fixed in CS3?
    Thanks
    doc

    >The typesetting houses can't tell the a Random House, Simon & Schuster, or a HarperCollins (or whoever) what to do.
    Where did I ever say they could? All along, I've noted that these sort of decisions are often made by people at a level higher than those doing the typesetting and that they're not negotiable. However, you wrote that in this case "Their designers did their design", and I just posed the question why those designers would choose a typeface without small caps when they knew that the text required them. And it was actually meant as a rhetorical question - rightly or wrongly, I assumed that the reason they did was because they simply didn't care or know about the difference between true and faked small caps.
    >if they want to use fake small caps I'm not going to tell some guy behind the oak desk that he's full of crap.
    Where did anyone ever suggest telling the client that he or she was "full of crap"? If a client comes in and says "use typeface X for this book", I don't see what the problem is with the designer saying "you realise that this means that we're going to have to fake the small caps/artifically bolden the text/oblique the text?". There's a world of difference between that and abusing them. And I never said that the typesetting house was to do this - I said that the designer should. You do say that "We can advise", which is all I ever suggested. I don't know where you're getting this impression from that I'm saying you should abuse them and tell them what to do.
    >I haven't lowered my standards.
    Never said you had. You seem to be getting very worked up about what was, as I say, a simple rhetorical question.
    >And personally I'd rather see fake small caps used than gaudy CAPS.
    Gosh, never heard of caps being gaudy before!
    >Are you in book publishing?
    Yes, though it's a lot smaller market in New Zealand than the States.

  • Simulated helvetica small caps not displayed acceptably in PDF

    It's a never ending battle, this trying to get some sense out of computers. In a post earlier this year (http://forums.adobe.com/message/1287805#12878) I asked how to overcome the lack of proper small caps in Helvetica. Sandee came back with a suggestion, which I followed up, and it seemed to give reasonable results. And within InDesign, and when printed, it works.
    However, when I export to PDF the small caps are not shown correctly on the screen. (The PDF file can be downloaded from http://www.mediafire.com/download.php?nmjlhmiwt3i). They look a mess unless you zoom in about 500%. They print okay, but I'm not having a messy looking PDF sent to the printer. It's nothing but offputting.
    If that was the only difficulty I could probably accept it, but I intend making my two books freely available for download in PDF form and I certainly don't want rubbish-looking fonts on display.
    It looks like my mock small caps may have to be replaced with caps.
    QUES 1
    Is it possible to make my mock small caps display acceptably on the screen within a PDF? I have tried exporting to PDF at various resolutions, and with optimize for web turned on and off, but that makes no difference.
    QUES 2
    Another option is to get hold of a Helvetica font (or similar) that does have small caps. Where could I get hold of one of those?
    The original InDesign file from which the PDF was obtained, can be downloaded from http://www.mediafire.com/?zddtj5m5d3q in case anyone wants to play around.

    Thanks for the responses. I'm surprised the PDF looked okay, so I've emailed it to half a dozen people to see how it looks on their system. Maybe it's my screen or my Adobe Reader that's at fault.
    I have attached two screen captures of what it look like on my screen. One at 100%, the other at 200%.
    I'd like to continue using Helvetica because it's the one I've used in about 200 sidebars. If I change fonts, I imagine I could be days cleaning up the text oversets or undersets. I did think of changing fonts, and looked at all the sans serifs on my system, including the Open Type ones, but none had small caps. And buying an expert set: I could spend the next two days trying to sort out where to buy one of those and whether it actually contain small caps. Plus, I can't justify a price in excess of $100 for the sake of 400 words.

  • I would like to insert an e with circumflex accent in small caps on word office MAC, any tips?

    I would like to insert an e with circumflex accent in small caps on word office MAC, any tips?

    In Word Command/Shift-k turns on and off small caps. e and 3 gives you what you are looking for.
    HOPê this helps
    PJRS

  • How to find out the list of patches applied without using inventory?

    Hi,
    I have been asked this question once.
    How will you find out the list of patches applied to Oracle Database Home without using commands like opatch lsinventory -detal etc...
    I think registry$history is a view from where we can find out the list of patches applied.
    But I think it will not include all the bug fixes,stand alone or one-off patches.It will mainly list out the CPU patches applied(correct me if I am wrong).
    Thanks,
    Rushi

    Hi;
    Thanks Helios,
    Your welcome
    Could you tell me how do you all senior people manage to find metalink note for almost everything?There is nothing special, For me I just make more search at metalink than googling so after sometimes you started to notice which note could be related wiht issues more clearly.. Just keep searching at metalink and focus what you are searching only.. ;)
    If you could guide me I can do it my self and stop bothering you for some silly doubts.You dont bother me and also I belive the other forum users ;) We are also learning new information wiht user questions ;)
    Regard
    Helios

  • Table and columns in small caps!

    Dear All,
    My database is 11gR2 and Linux is the OS.
    One of my application, whose code I am unable to access, it trying to insert records in Oracle database. The problem is that application is case sensitive and try to find table name and columns in small caps, while it gets upper case from Oracle and give error or invalid identifier.
    Is there any option to create table and fields with small letters.
    Kindly help.
    Regards,
    Imran

    misterimran wrote:
    ...The problem is that application is case sensitive and try to find table name and columns in small caps...What application could look for tables/columns in small caps ? As stated above, creating tables/columns enclosed by double quotes might help, but that'd mean the code must use double quotes everywhere...
    while it gets upper case from Oracle and give error or invalid identifier. It get as is, please show the error.
    Nicolas.

  • Finding mailboxes with no retention policy applied and apply a policy?

    We manually apply retention policies at the time accounts are created.  However, some get missed and therefore, I assume that means they have no retention policy at all.  So, there is no true "default" policy that is automatically applied
    when you do not manually choose one?
    How can we find the ones that were missed and apply a retention policy to those?

    Hi
    This will return all the mailboxes without any policy set:
    Get-Mailbox -Filter 'retentionpolicy -eq $null'
    So you could do this:
    Get-Mailbox -Filter 'retentionpolicy -eq $null' | Set-Mailbox -RetentionPolicy <name of your policy>
    Steve

  • Photoshop CS3 can't do lowercase type-only large and small caps

    Photoshop CS3, G5 PowerMac Dual 2GHz w/ 7GB RAM
    A weird Photoshop problem: using the type tool, I can only produce type in large-and-small-caps, as opposed to upper and lower case. I can't generate any lowercase text. I've tried all the usual diagnostic tools: trashing the prefs seemed to work at first, but it's destructive of other stuff I don't want to lose, and anyway the problem came back after a while. I tried the Phantom User, and learned that the problem is tied to my User Identity, i.e., the problem doesn't exist in other User identities, but how do I make use of that information? I considered migrating to a new user identity, but I would have to go through every single appliciation, blah blah blah. So: does anybody have a quick, elegant solution to this, or is this a problem that has suddenly cropped up elsewhere? I'm not crippled by it, thanks to Illustrator CS3, but it's a convenience that I miss. And how do I trash the PS prefs without losing my brush tool presets?

    Birck,<br />>trashing the prefs seemed to work at first, but it's destructive of other stuff I don't want to lose,<br /><br />What "destruction" are you talking about?<br />>and anyway the problem came back after a while.<br /><br />I assume this happens with fonts other than those (such as Trajan Std) that were designed with just caps and small caps. It sounds like it may be a duplicate or corrupted font issue. Did you use a good font manager to check for duplicate or corrupted fonts? Did you clear font caches (with Cocktail)?<br />> tried the Phantom User,<br /><br />I see a black mask, cape and scary organ music here. <g> If logging in as a new user clears the problem, you may have a corrupted user identity and should stop using it.<br /><br />Neil

  • Removing underline on link that is small caps and different sizes

    I have this in a section of my HTML page. This is what is says but it is in small caps, 2 of the words are larger, and it's a maroon color and centered. I'd love to make it a link without the underline. None of the codes I've found online have worked. It looks fine except for the underline when it's a link issue.
    Since 1958:
    America's First
    Geosynthetics
    Company!
    CODE FOR THIS SECTION OF THE HTML:
    <div align="center"><span class="t2"><font color="#770506"><span style="font-variant:small-caps"><font color="#770506">Since</font></span> <strong style="font-size: 150%;"><font color="#770506">1958:</font><em> <br>
              </em></strong><span style="font-variant:small-caps">America's</span> <em><span style="font-variant:small-caps">First<br>
                </span></em><span style="font-variant:small-caps"><strong style="font-size: 150%;">Geosynthetics</strong></span><br>
              <span style="font-variant:small-caps">Company!</span></font></font></span></div>

    <div style="text-align:center;color:#770506;font-variant:small-caps;" class="t2">
    <a href="#" style="color:#770506;text-decoration:none;">Since<strong style="font-size: 150%;">1958:</strong><br>America's<em>First<br></em><strong style="font-size: 150%;">Geosynthetics</strong><br>
    Company!</a>
    </div>

  • I erased an iphone on find my iphone , so i wanted to know what happened and I erased my without a sim card and now I says I cant go on it until i put in a sim card. Did i ruin the phone please help thanks.

    I erased an iphone on find my iphone , so i wanted to know what happened and I erased my without a sim card and now I says I cant go on it until i put in a sim card. Did i ruin the phone please help thanks.

    You did not ruin the phone, you will need a sim card to activate the phone and then connect the phone to itunes and do a restore from back up.
    http://support.apple.com/kb/HT1414

Maybe you are looking for

  • Can I use one Apple ID/account on multiple devices?

    My 2 kids have an iPod Touch 4th generation. I used my (parent) Apple ID to set one up. Can I use the same apple ID/account on the second iPod? Or do I have to create a new ID? The kids are not old enough to create their own Apple IDs.

  • Possible to block document when someone read it?

    Hi everyone, my client want a specific pdf file in the portal km to be blocked once someone read it, and unblocked when the person close the opened file. I did not found any pertinent infos on this, and I don't think it can be made without creating a

  • SuperDrive making noise or lagging

    Hello, My SuperDrive is slow at reading/playing DVDs and/or makes "reading" noises. The playback is choppy and pixelated. I have never experienced this before. All playback was pristine and crisp until recently. I have not installed or done any upgra

  • How to execute sqlplus command like 'show parameters '  in SQL Developer?

    Hi guys, here's another problem i just ran into, is it possible to run sqlplus cmd like 'show parameters ' in this tool? anyone can help? thanks in advance.

  • Generation of DDL similar to Oracle Designer (Data Modeler 3.0 EA1.)

    Hi, Will the production version of SQL Data Modeler allow the creation of separate DDL files similar to that which Oracle Designer does? For example, I can create a sequence number generator in Data Modeler (DM) and then make a call to that in an Obj