Script to replace small caps that are typed as capital letters with non-capital letters (A = a, B = b, etc...)

I'm looking for a way to replace small caps that are typed as capitals by their normal equivalent.
I've got a text that contains a lot of names which should all be set in small caps.
In fact they are, but because capital letters are used for first letters they don't scale.
Short: I would like to be able to look for A, B, C... (in small caps) and replace them with (a, b, c...) in small caps in one go.
(compare two arrays?? -> is this possible in indesign scripting)

Hi,
Actually, it works only with OpenType fonts and - in this case - can be managed by UI find...change feature.
With other type of font we need a real change of contents (another keyboard hit).
It could be done with this code (activeDocument is a target):
-- works for Open Type as well --
// For Latin Basic (ASCII from 65 to 90)
// changes a "cap" letter to a "small" letter
// if Capitalization.SMALL_CAPS is applied to
app.findGrepPreferences = app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\u";
app.findGrepPreferences.capitalization = Capitalization.SMALL_CAPS;
var
  mSTART = 65, // ASCII number for "A"
  Mstart = 97, // ASCII number for "a"
  mDiff = 0,
  mTarget = app.activeDocument,
  mFound = mTarget.findGrep(),
  len = mFound.length, cString;
while (len-->0) {
  cString = mFound[len].contents;
  mDiff = cString.charCodeAt(0) - mSTART;
  if (mDiff > -1 && mDiff < 26)
  mFound[len].contents = String.fromCharCode( Mstart + mDiff );
app.findGrepPreferences = app.findGrepPreferences = null;
Jarek

Similar Messages

  • Script to report on clients that are not up to date with softwareupdate

    I'm not sure how to do it yet. I just need a script that I can run on multiple computers that will tell me what machines require updates and the number of updates. I considered doing something along the lines of:
    <code>softwareupdate --list |wc -l </code>
    but that does not seem to be fool proof since there are obviously lines of output regardless of whether there are updates or not. I just need to get back the number of patches missing from unpatched machines. We have our own SUS, so the only updates being pulled should already be approved.
    Please help.
    Thanks!

    Actually this is exactly what I need, a script that will read the output of softwareupdate --list and count the asterisks and return with a number of how many there were. If there were no asterisks then it can skip that machine.

  • A  project on iMovie 09 that  Freezes(only the project)  the viwer window blocked in gray ... .. After editing that  took me a year I'm stuck . All my finished projects that are in the Library infected with the same symptoms and it happens only after I w

    a  project on iMovie 09 that  Freezes(only the project)  the viwer window blocked in gray ... .. After editing that  took me a year I'm stuck .
    All my finished projects that are in the Library infected with the same symptoms and it happens only after I went into the problematic project.  
    I tried to open a new project and everything works
    ...I also tried throwing Recent Files, in the past It solved the problem ,not this time ...
    the problem is that this project will take me a long, long time to rebuild
    imovie 09
    Model Name:          iMac 
      Model Identifier:          iMac10,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          3.06 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          3 MB
      Memory:          4 GB
      Bus Speed:          1.07 GHz

    This recently happened to me.  I am a novice, but it seemed like that project got corrupted some how.
    I deleted it.
    Went to time machine and picked it up again when I knew it was working ok.
    I lost a few hours of work, but not the entire project.
    Once I had the project back from time machine, it worked fine (but like I said, I lost a little bit of work).

  • One of my imacs are saving all my files with a capitalized file extension?!

    one of my imacs are saving all my files with a capitalized file extension?! For example: .psd is .PSD this really suck because I keep getting to versions of all my files. Can someone please assist me in fixing this. Thanks! -derek

    Welcome to Apple Discussions!
    Did you format your hard disk on that Mac any differently?

  • Unable to replace the chips that are next to the battery.

    I took out my battery and then removed 2 chips (I guess that is what they're called?) as instructed by the picture in my macbook. Now I am unable to put the chips back in. I know I'm not putting them in properly but don't know what I'm doing wrong. Anyone have advice?

    Go to this page, find your model and watch the instructional video on how to replace RAM (for that is what the chips are called)

  • Calculate Results As Average of Detailed Values That Are Not Zero... with hiearchies doesn't work

    Hi all,
    For the key figures, the option of "Calculate Results As Average of Detailed Values That Are Not Zero, Null, or Error" works fine for characteristics drilldown without hierarchies, but with hierarchies it simply doesn't work; instead of calculate the overall result as average, the system calculates it as SUM. It works like the option "Nothing Defined" where the results provided by the analytic engine are displayed. No local calculation takes place.
    How can I do to display the overall result of hierarchical drilldown of a characteristic as an average?
    Many thanks in advance!
    Abraham

    It is usually best to just keep it as simple as possible.  What do you think the code in the OR Array Elements does?  I imagine it is just a simple FOR loop with a variable to keep the latest OR.  So I would do what GerdW just showed with the FOR loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do i share emails that are saved ON MY MAC with my iPad

    I would like to access old emails that are not in my inbox from my iPad? Is there a way of syncing the info within Mail that is stored under ON MY MAC?

    do you mean to close tabs in safari? On each tab you'll see a little X. Tap on that and the tab closes, which closes the web page

  • On my home page which has Google search block the letters that are typed in are only halve the the letter showing. How do I make that space larger so that all the letters appear full size

    When I open firefox now after installing the new version my homepage which uses Google as my search engine is small along with the space bar that you type the info into. Now when I type for example the letter " P" the bottom leg of the p will not appear. I need to increase the size of that whole section where you type.

    See McAfee support to find out how to disable that McAfee feature - that isn't part of the normal Firefox installation.

  • LG Cosmos phone  can not send/receive texts that are typed

    Hi,
    My family  has 3 of the LG Cosmos phones and we cannot word text either the phones do not receive them even though our phones says we sent them.  They even sometimes do not go through to our other phone which is an iphone.
    We have reset, we have cleared memory, we have tried everything.
    Funny thing is we can send picture texts without a problem and we can send the voice text messages and they all go through.  They don't miss one.  However, if we type the text message (as in normal text) only maybe 1 in every 8 goes through. This has been happening for 2 days now.  Any suggestions? It does not matter if we are out or at home.

        Hi mewith3,
    I know how important it is for your text messages to be received. We want to get to the bottom of this situation to get your messages to be delivered. Other than the messages being typed out, have you noticed any other similarities? Do you have any message signatures set? When the messages aren't delivered, are they going to other Verizon users or all providers? To those Verizon users, are the messages on your phone showing delivered? Please provide us a few more details so we can check what may causing the trouble.
    Thank you,
    MariaC_VZW
    Please follow us on Twitter @VZWSupport

  • How to fix grayed out songs in Itunes that are supposed to be matched with Itunes Match!

    I have deleted a few songs that have the cloud symbol in Itunes Match; however, they are now grayed out and I can't play them from the cloud or download them.  Can anyone offer any ideas?  I was doing this to test whether it is matching correctly and now the songs are listed with the cloud symbol and down arrow in Itunes; however, they are unable to be played (they are just gray).  Please help!

    iTunes has a feature that drops leading articles (a/an/the and regional equivalents) for sorting purposes. This enables "The Beatles" to be sorted under B instead of T, a converntion that most people are used to. The greyed out text shows this current autosort value. If you delete the text it will be regenerated. If you try to put in something like a space you will interfere with the proper action of the sort. However you can put "The Beatles" in if you really want them sorted under T. It is important to use sorting values consistently and not not try to give different things the same sort value as this causes problems. You can hide the column if you have no need to review the information in it.
    See Grouping tracks into albums for more details.
    tt2

  • How can I merge all of the new FF windows that are open into one window with multiple tabs? Safari has a merge windows feature that I like. This is really nice when conducting reasearch on multiple sites at the same time.

    When I clik on weblinks they all open into new windows making it somewhat painful to clik on window in the menu bar to go to each new page. I would rather have a feature that would allow me to merge all of those individual windows into tabs within one page.
    == This happened ==
    Every time Firefox opened

    Thank you. That worked. I was able to open 1 window with multiple tabs. Thanks cor-el!

  • I want to know how to enable the links that are sent in an email, with each upgrade of Firefox it gets harder and harder to do so. What is the trick to this?

    With each upgrade of Firefox, I have a harder and harder time, getting to the links provided in my emails. Some times I am able to trick the link into working, if I continue to to try every link in the email, but most of the time, I just have to give up. I know that I need to change something, maybe in the settings, but I don't know what.
    Please help me. I am considering just going back to Internet Explorer.

    This did not solve my problem. I can sometimes click on a link (word) provided in an email, that leads to a site, but it does not list the website address!! It works sometimes, providing me with a chance to enable links for this address or enable link (I think basically for just that one time).

  • Firefox is opening all .htm files, even those that are intended to be opened with a certain program

    I do have a .chm reader add-on installed, but I don't think that is the problem

    Oh yeah, I should say, I get messages on the console like:
    2/7/09 4:57:12 PM iPhoto[748] com.apple.console have info and image but no ref
    2/7/09 4:57:12 PM iPhoto[748] com.apple.console have info and image but no ref
    2/7/09 5:01:28 PM iPhoto[748] com.apple.console unreadable file: slides-Scan-090206-0023.jpg
    Yet, as I say, I can crop the file fine in Preview and resave, then I can edit it in iPhoto.

  • Heard that are a lot of problems with iOS 6.0.1 update. Is it safe to install yet on my iPhone 4?

    I know a bunch of folks who have had major problems with the iOS 6.0.1 update on their iPhone 4.  Basically, it completely disables the phone, often requiring owner to send in for service.  Has this bug been fixed?  Is there a subseqent update?  I do not want to install the update until I am sure it will not wreak havoc on my phone. Thanks!

    IF you don't need any of these updates - don't install them - its really that simple - and it will be many more people's rule for apple updates since iOS 6 I bet!

  • Any modem/routers that are known to work well with macbook?

    Apart from airport.....
    I have a Dlink now, wich works fine when the macbook runs on windows, but drops the signal every 5min when it runs on Tiger. Also when I try to copy large files from a shared network drive, finder frozes!!!!

    Before ditching you Dlink you may want to see if the suggestions here…
    http://discussions.apple.com/thread.jspa?threadID=518368
    … work. Not to mention I've heard that changing the preamble on the Dlink from a short to a long preamble fixes things as well.
    Apart from that, I've always had good success with 3com wireless modem/routers. You can also turn the wireless off on the DLink and then conenct say an Airport Express/Extreme to it for wireless as well.

Maybe you are looking for

  • Screen Sharing no longer working

    Hello, everyone.  I have developed an issue with screen sharing on my MacBook Pro running OX 10.6.8, and I cannot seem to resolve it.  Perhaps I am missing something.  I realize this is a long post, but I am trying to be as complete as possible with

  • JAR  file:      could not find the main class.

    I have been working with Java satisfactorily for about two years. Installed a bigger hard disk. Installed Windows XP. Downloaded java. Downloaded java jdk 1.6.0_07 Downloaded java3d 1.5.2 Downloaded Eclipse Ganymede. A new project, a new class with a

  • Credit value in sales order

    Hi, How system pick the credit value in sales order.What are the different setting required for this? Regards Prabudh

  • Error "SELECT statement includes a reserved word"

    Dear Sir, I am developing Ms Access 2010 and XP is the operating system. I have placed a combobox on a form, but when I tired to update new string value in the same combobox, it generates  an error "The SELECT statement includes a reserved word or an

  • I want to edit pdf file

    I want to edit pdf file