Title Case Indesign Script?

I have paragraph/character styles set. But I need a script to change these to title case (currently all lower case). I know there is a script, but the only ones I have come across seem to be for CS5 or below. I'm currently on CC 2014. Any sources for this script?

A lot of scripts do not depend on actual InDesign versions (if they do, it's usually only a limit for lower versions, not higher). Just try the one you got. If you get an error, you can use the Script Version Folder workaround:
http://indesignsecrets.com/using-old-scripts-in-cs3.php
That recently worked for me to run a troublesome CS5 script in the very latest version -- I did not have to find out the cause of error and somehow fix it!

Similar Messages

  • Smart Title Case - problem with script

    Having a problem here.
    When multiple paragraphs are selected the start of a paragraph is set to a lowercase
    how can I fix this?
    //DESCRIPTION: Converts selected text to title case smartly
    var ignoreWords = ["a", "an", "and", "the", "to", "with", "in", "on", "as", "of", "or", "at", "into", "that",
             "by", "from", "their", "then", "for", "are", "not","cannot", "be", "is", "which", "can"];
    var intCaps = ["PineRidge","InDesign","NJ","UMC", "FCCLA", "SkillsUSA", "d’Oeuvres", "VAT", "VIES",];
    // or by creating text files named ignoreWords.txt and intCaps.txt in the same folder as the script
    ignoreWords = getIgnoreFile(ignoreWords);
    intCaps = getIntCaps(intCaps);
    try {
        myText = app.selection[0].texts[0].contents;
    } catch(e) {
        exit();
    theWordRanges = myText.split("/");
    for (var i = theWordRanges.length - 1; i >= 0; i--) {
        theWords = theWordRanges[i].toLowerCase().split(" ");
        //First word must have a cap, but might have an internal cap
        myNewText = "";
        for (var j = 0; theWords.length > j; j++) {
            k = isIn(intCaps,theWords[j])
            if (k > -1) {
                myNewText = myNewText + intCaps[k] + " ";
                continue;
            } else {
                if ((isIn(ignoreWords,theWords[j]) > -1) && (j != 0)) {
                    myNewText = myNewText + theWords[j] + " ";
                } else {
                    myNewText = myNewText + InitCap(theWords[j]) + " ";
        theWordRanges[i] = myNewText.substring(0,myNewText.length - 1)
    app.selection[0].texts[0].contents = theWordRanges.join("/");
    // +++++++ Functions Start Here +++++++++++++++++++++++
    function getIgnoreFile(theWords) {
        var myFile = File(File(getScriptPath()).parent.fsName + "/ignoreWords.txt");
        if (!myFile.exists) { return theWords }
        // File exists, so use it instead
        myFile.open("r");
        var importedWords = myFile.read();
        myFile.close();
        return importedWords.split("\n"); // Could filter these, but what's the point?
    function getIntCaps(theWords) {
        var myFile = File(File(getScriptPath()).parent.fsName + "/intCaps.txt");
        if (!myFile.exists) { return theWords }
        // File exists, so use it instead
        myFile.open("r");
        var importedWords = myFile.read();
        myFile.close();
        return importedWords.split("\n"); // Could filter these, but what's the point?
    function getScriptPath() {
        // This function returns the path to the active script, even when running ESTK
        try {
            return app.activeScript;
        } catch(e) {
            return e.fileName;
    function isIn(aList,aWord) {
        for (var i = 0; aList.length > i; i++) {
            if (aList[i].toLowerCase() == aWord) {
                return i;
        return -1;
    function InitCap(aWord) {
        if (aWord.length == 1) {
            return (aWord.toUpperCase());
        return (aWord.substr(0,1).toUpperCase() + aWord.substring(1,aWord.length))

    Hi,
    Looks like it is a 'paragraph mark' problem which can be seen as 1st char in some strings.
    modify these two lines:
         theWordRanges = myText.split("\r");
         app.selection[0].texts[0].contents = theWordRanges.join("\r");
    Jarek

  • How can I use a script in a Livecycle Designer form, to force display of text in Title Case?

    Hello,
    I am a 'novice' who is DIY'ing the construction of a dynamic pdf form, using Adobe Livecycle Designer 7 (I know, it's a VERY old version!)
    [So, any help that comes along must be 'for Idiots'!]
    I need to construct a code (Java script?) so that a few of my text-fields DISPLAY data in Title Case - IRRESPECTIVE of how the user types in the data.
    So, for example, in a "Address" text-field...
    If someone types in ..
    "205 sherborne avenue"
    - OR -
    "205 Sherborne avenue"
    - OR -
    "205 SHERBORNE AVENUE"...
    I need the data to be DISPLAYED ESSENTIALLY as...
    "205 Sherborne Avenue".
    I found the following code online, and tried it in the 'exit' event of the field I need to modify (with 'language' selected as JavaScript)...
    <   this.rawValue = this.rawValue.replace(/\b([a-z])/g, function (_, initial) {return initial.toUpperCase();});   >
    ... This did convert all the 'initial' letters of the words to Upper Case - AS LONG AS they were not ALL typed in Upper Case!
    So, that code worked for the first two of my samples for Sherborne Avenue above - but it did NOT work for the last one...
    That is, "205 SHERBORNE AVENUE" did NOT get converted to Title Case - which is what I need help with.
    Thanks in advance...

    Hey TundraSteve,
    Thanks a tonne!
    Works perfectly!!!
    In fact, your solution is so elegant and direct, that even I am beginning to get a sense of how it works... I have looked at LOTS of similar codes in the past few days, but was not at all getting a sense of how they are working! But comparing your solution with the earlier one I mentioned, I am beginning to get a sense of things!
    Any suggestions for what I should read-up in order to understand this king of coding?
    I have basically been using the built-in 'Help' - and, trial-and-error - and I have designed my first form - a pretty elaborate one, actually!
    So, it would be great if you could guide me through the 'learning curve' a bit!
    [I have figured-out the 'basics' - that is, I can lay out the form, use 'if-expressions' (FormCalc), trigger events, even build Subforms that are hidden but 'appear' when triggered by other actions, and so on. What I can't figure out are the various 'code languages' (syntax?) that are being used - like " var sometext", for eg.!]
    Cheers, and thanks again!

  • Looking for a simple way to convert a string to title case

    New to LiveCycle and Javascript.  Looking for a simple way to convert a string to title case, except acronyms.  Currently using the the following, it converts acronyms to lower case:
    var str  =  this.rawValue;
    var upCase = str.split(" ");
    for(i=0; i < upCase.length; i++) {
    upCase[i] = upCase[i].substr(0,1).toUpperCase() + upCase[i].substr(1).toLowerCase();
    this.rawValue = upCase.join(' ');

    Thanks for the reply.
    Found the following script in a forum, which works fine as a "custom validation script" in the.pdf version of my form.  However, it will not work in LiveCycle?  The problem seems to be with
    "return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g"
    function toTitleCase(str) {
    var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
        return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title){
    if (index > 0 && index + match.length !== title.length &&
      match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
    (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
    title.charAt(index - 1).search(/[^\s-]/) < 0) {
    return match.toLowerCase();
    if (match.substr(1).search(/[A-Z]|\../) > -1) {
      return match;
      return match.charAt(0).toUpperCase() + match.substr(1);
    event.value = toTitleCase(event.value);

  • Canvas support in Indesign scripts?

    Hi there,
    short version:
    I was wondering if it is possible in any way to include auto generated raster content (Using canvas api for example) in in-design using JavaScript?
    Long version:
    I noticed that In-design supports a very old version of JavaScript, and since I'm pretty new to InDesign scripting I thought it's better to get informed about its capability / limitations before planing about what to do with it! I wrote a Javascript code (not in in-design script) that generates unique random patterns of motifs, now I'm interested if I can integrate it in in-design scripts so it would put one of this raster images in each page of an in-design document (IE: left and right side of each relatively facing pages);
    also since my first guess after studying a bit In-design's object-model documentation was that it is very much limited to just what is possible through the software UI itself (and not any/some thing new/more), then I was wondering (in that case) how much is it possible to hook an script to an external script, and sending and receiving data/vars between them; like putting both scripts in the same folder, the first one calls the other one giving it some info (document dimensions, etc.), the second script runs (outside of ID), put the images on disk and return to main script when it's done!! :/
    I have some other solution sketches as well in my mind, but wanted to have your input before doing anything ridiculous!! :-)))
    I really appreciate your in-put on this,
    thx, mim,

    And yeah! It looks like I can execute an external file of any type!
    After reading and looking for a while, finally:
    In 52th page of documentation it says:
    execute()
    fileObj.execute ()
    Opens this file using the appropriate application, as if it had been double-clicked in a file browser. You can use this method to run scripts, launch applications, and so on
    Voila! Exactly what I need (If what I think I need is actually what I need! indeed!!)
    I'll try to see if it works later on (impatient actually!), and thx again!
    ,mim

  • Title Case with Articles in Lowercase

    Is there a script or a way to get true Title Case? Illustrator caps every first letter. Seems word does the same, can't believe that there still is not an option for this.

    Mike, now it works with
    textFrame selection(s)
    and textRange selection
    what is it what you're having problems with? what other scenarios do you have to work with?

  • IDCS Title Case Paragraph Style

    Hi, I'm trying to create a paragraph style That Uses Title Case but my only choices are "Normal", "Small Caps", "All Caps", or "Open Type All Small Caps". I see "Title Case" under the menu: Type > Change Case but not in the paragraph or characters styles dialog box. Any Help Would Be Fantastic. Thanks!

    My Running Headers plug-in has smart title case which gets its words
    based on two different user definable lists: One for lowercase words
    (unless they are at the start or different because of one of the other
    rules...) and another for acronyms and the like (they are always
    capitalized exactly as they appear in the list independent of position).
    InDesign can't even spell its own name! ;)
    I hope to add the smart title case to my Formatting Tools as well. (If
    there's enough interest, I'll probably do it sooner rather than later...) :)
    Dominic that's an excellent point about acronyms which are also words --
    one I hadn't thought about. I believe those can be identified by some
    kind of formatting attribute...
    Harbs

  • Title Case iWork Numbers

    I have a spreadsheet that contains several columns of text which are all uppercase. I would like to format the text so that it has a capital first letter, and the subsequent letters are lower case for that word. The "Title" case which is found in Format>Font>Capitalization>Title Case only seems to work if the text is all lower case. I can't get it to work on any other types of formatted text. Any thoughts on how I can do this? Thanks

    I use an AppleScript to change to title case in Pages. This is based on an old AppleWorks script that I've modified for Pages. Copy & paste your table from Numbers to a blank Pages document then open AppleScript Editor (in Utilities) & paste the following code in a new window & save as a script. You can then run it to convert the text & then copy & paste back to Numbers.
    Give me a couple of days & I'll see if I can make it work in Numbers.
    property lowerOnlyWords : {"a", "an", "the", "and", "of", "for", "from", "in", "on", "before", "after", "between", "behind", "with", "without", "to", "through", "against", "is"}
    property upperChars : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    property lowerChars : "abcdefghijklmnopqrstuvwxyz"
    tell application "Pages"
              try
                        set selectionFail to (count each document) < 1 or class of selection is not text
              on error
                        set selectionFail to true
              end try
              if selectionFail then
                        display dialog "You must select some text in a word processing document before running this script."
              else
                        set theText to selection
                        set theWords to {} & every word in theText
                        set wordCount to count theWords
                        set isFirstWord to true
                        repeat with wordN from 1 to wordCount
                                  set oldWord to word wordN in theText
                                  set doLowerOnly to oldWord is in lowerOnlyWords and not isFirstWord
                                  if doLowerOnly then
                                            set startLowerN to 1
                                  else
                                            set startLowerN to 2
                                            set oldCharacter to character 1 in oldWord
                                            set alphaN to offset of oldCharacter in lowerChars
                                            if alphaN > 0 then
                                                      set character 1 in word wordN in theText to character alphaN in upperChars
                                            end if
                                  end if
                                  repeat with charN from startLowerN to length of oldWord
                                            set oldCharacter to character charN in oldWord
                                            set alphaN to offset of oldCharacter in upperChars
                                            if alphaN > 0 then
                                                      set character charN in word wordN in theText to character alphaN in lowerChars
                                            end if
                                  end repeat
                                  set isFirstWord to false
                        end repeat
      select theText
              end if
    end tell

  • Update IDML with indesign script?

    Hello,
    In an Indesign Script (javascript), after I loop through the page items and find the text frame I wish to edit, I am wondering if it is possible get the IDML from that TextFrame, and then update it, and replace its current IDML with the updated version.
    I only will need to update one of the Story.xml files within the IDML package. Is this possible?
    Thanks in advance!
    -Lloyd

    @Lloyd: by thinking more deeply of your task, it seems to me, that you will go the following route:
    You start with an existing IDML file you want to manipulate (you stated so by choosing the title of this thread by "Update IDML"), no need to change the source:
    1. Unpack the IDML file with scripting (see "unpackageUCF (ucfFile: File, destinationFolder: File)" in the documentation)
    2. Do your stuff
    2.1 search all story.xml files for your text string and it's parent story you want to change or by identifying your story using "idmlComponentName" on the source
    2.2 do the change by reading and writing the xml-file
    3. Repackage the IDML file and give it a new name (see "packageUCF (sourceFolder: File, ucfFile: File)" in the documentation)
    However, if you want to place an updated snippet, you can use the place command as usual; be aware that there are additional options in preferences to export and place a snippet to confirm to its IDML-format during export and there is a "place in original location" option for placing:
    DocumentPreferences: snippetImportUsesOriginalLocation
    application: snippetExportFormat: SnippetExportFormats.INX_EXPANDED_FORMAT (for generating an IDML-snippet instead of an INX-snippet)
    Uwe

  • How to Run Indesign Script in a file from plugin code in CS4?

    Hi,<br />I have the code to execute the InDesign script stored in external file for InDesign CS3.<br /><br />InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss)); <br />InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID()); <br />     IDFile scriptFile(scriptFilePath); <br />     if (scriptRunner->CanHandleFile(scriptFile)) <br />     { <br />       ScriptData returnValue; <br />       PMString errorString; <br />       ErrorCode error = scriptRunner->RunFile(scriptFile); <br />         ASSERT(error == kSuccess); <br />     } <br /><br />But the RunFile() method is cs4 expects an additional argument of the type RunScriptParams. <br />Someone please show me with a code snippet on how to excute a script file in CS4??

    Dear Ian
      Here I'm used the below coding in CS3, Its working fine....
    //In CS3 Coding
      PMString jsFullPath("c:\\windows\\sample.jsx"); // a path to my java script file
    do
    const
    IDFile outFile(jsFullPath);InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
    ASSERT( scriptManager ) ;
    InterfacePtr<IScriptRunner> scriptRunner(scriptManager,UseDefaultIID());
    ASSERT( scriptRunner ) ;
    if(scriptManager){
    InterfacePtr<IScriptRunner>scriptRunner(scriptManager,UseDefaultIID());
    RunScriptParams params(scriptRunner);
    ErrorCode err = scriptRunner->RunFile(outFile, kTrue, kFalse);
    while(kFalse);
    But the same time I used this coding in CS4, Its not woking
    //In CS4 Coding
    PMString jsFullPath("c:\\windows\\MacID\\BIN\\sample.jsx"); // a path to my java script file
    do
    const
    IDFile outFile(jsFullPath);InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
    ASSERT( scriptManager ) ;
    InterfacePtr<IScriptRunner> scriptRunner(scriptManager,UseDefaultIID());
    ASSERT( scriptRunner ) ;
    if
    (scriptManager){
    InterfacePtr<IScriptRunner>scriptRunner(scriptManager,UseDefaultIID());
    RunScriptParams params(scriptRunner);
    ErrorCode err = scriptRunner->RunFile(outFile, params);
    while(kFalse);
    I changed the "RunFile" arguments also
    RunScriptParams params(scriptRunner);
    ErrorCode err = scriptRunner->RunFile(outFile, params);
    But Still I'm facing the problem in InDesign CS4.  That's mean  "Adobe InDesign CS4" shout down for serious error happend.
    Please kindly help me, for solving this problem.
    Thanks & Regards
    T.R.Harihara Sudhan
    Message was edited by: Adobe-InDesign CS4

  • InDesign Scripting Guide/Apple Script

    The command
    set myTop to top of margin preferences of myPage
    described in the InDesign Scripting Guide doesn't work with Indesign CS2. Does anyone can help?
    Thanks

    Hi Morenga 65,
    Try:
    tell margin preferences of myPage
    set myTop to top
    end tell
    But, as Dave says, do come to the Scripting Forum--there's lots of good stuff there!
    Thanks,
    Ole

  • How do I handle Style Groups in InDesign Scripting?

    Hi,
    I am relatively new to InDesign scripting.
    I'm trying to map Paragraph Styles to CSS, and it seemed to be working fine, till I came across Style Groups -
    Styles belonging to a group are identified as - Root Style Group name : Child style group name : ...... : Style name
    Because of this paragraph style  <Style name> was not mapping to the TOC style <Root Style Group name : Child style group name : ...... : Style name> and my TOC styles were not correctly mapping.
    I wrote a fix for this in my app, by fetching parent groups and appending to a string - which i check in the TOC style entries.
    Before calling this a FIX, I need to confirm if there are any more hierarchies/represnetations that could be used to represent a Paragraph Style as a TOC style? I don't want to see that a week later I discover something like <Style : Nested paragraph style> as a TOC style and then I'd have to fix my fix!
    Thanks.

    Hi,
    If YourPara is a paragraph style in myDoc and defined inside group of styles named myStGroup
    you can refer to it using:
    myDoc.paragraphStyleGroups.item("myStGroup").paragraphStyles.item("YourPara");
    Jarek

  • It´s possible to call to Adobe Professional 8 with Indesign scripting (.jsx) [JS/CS3] ?

    Hello, I would like to know if it´s possible to communicate with Adobe Professional through a Indesign script (.jsx). I need to convert the pdf file that I export from Indesign to specific standard type that is only available in Adobe Professional.
    I want to save the Indesign generated file with Adobe Professional and obtain the pdf that I particularly need.
    I would like to know if there is a way to do this.
    Thank u,
    Peter

    That's nothing!
    An engineer and I contacted Adobe technical support by phone to ensure the PC I was having custom built was configured to its optimum. They advised XP64 as the best operating environment. After that discussion we had to completely revise procurement, etc to get the bits and compatible XP64 compatible software, putting the build project back a few weeks as well, Imagine how I laughed when I found out on one of these forums that XP64 is the worst choice and totally unsupported by CS4!
    I have written to Shantanu Narayen, Adobe CEO and didn't even get an acknowledgement I raised this last week on the Adobe stand at BVE and was told they'd get someone to contact me asap but guess what, niet...! To be fair there has been one Adobe executive that recognises the problem and the damage poor customer support is causing the company; he has been as helpful as he can. Unfortunately, it seems the overall Adobe culture at the top is "get the money and run". If your problem goes beyond what's already on their web pages, tough luck!
    Regards,
    Graham

  • Call Photoshop script from Indesign script CS4 JS

    Hi, I open Photoshop linked file from InDesign in Photoshop and I need same InDesign script to run Photoshop script on the file. How I can call the Photoshop script from InDesign script.
    Thank you very much for your help.
    Yulia

    Thank you, Kasyan.
    800 lines of script is little be intimidating.
    What we are trying to achieve is to open jpgs in Photoshop and resave them as tiffs and replace same jpg with corresponding tiff in Indesign as it was placed before.
    Is there a way to call Photoshop from Indesign through appleScript.
    I have most of the script done for Indesign and I have Photoshop shript ready that saves jpgs as tiffs done. I am only missing the part where I can call this existing Ph. script from Indisign.
    We prefer not to use BridgeTalk if possible, because we have a lot of programs open and running in the same time, and would like to avoid to open one more program (BridgeTalk).
    Thank you very much for your great help.
    Yulia

  • How to convert a file name to title case

    hi,
      I have document library where name is displayed for the file that is uploaded. How do I convert the name to a calculated column =PROPER([name])? I've tried creating a new column, which is a calculated field =PROPER([name]) but it doesn't recognized
    the field. There is the title column which I can do a =PROPER([title]), but the title field isn't necessarily the same as the file name. Ideally, I want to convert to title case for any file uploaded. so the Name column is in the PROPER case. Thanks.

    "Title" is a field on the entity in the database. "Name" is what uniquely identifies the SPFile underlying the document.
    So you can think of Title as pretty arbitrary; you can change it just like you would change any other property (description, etc.) but if you change the Name, it is akin to moving the file. Names must be unique in folders/webs.

Maybe you are looking for

  • How do I use harvard outline format in pages?

    I do not know how to use this outline to return to previous levels I.E. I. samplesample      A. SAMPLE           1. Sample                a) sample                b) sample      ?. (This will not go to B.) ? (this will not go to II.) How do I make th

  • Cannot convert to JPEG in Photoshop CS2

    I have a free trial version of Adobe Photoshop CS2 and for some unknown reason when I open a PDF file Photoshop is reading it as a Bitmap Image and when I go to save it as a JPEG it will not let me. Any helpful insight is greatly appreciated.

  • Helppp Plzzz, My Java work needs to be done by 2mrw, Im new 2 java.

    Hiii, plzzz wud sum1 help!!! i need 2 hand in my ork 2mrw n ive benng and trying to do tisbut i cant. i dont know anything about java so if someone could plzzz paste all the souce code here, would be soooo grateful. I need to produce a time clock cal

  • Master Data query

    Hi guys, It's recommended that Master data be not loaded daily but still at regular intervals. (Usually full load) My question is if there is master data for customer and between two loads we have a new customer and he orders something, how do you ha

  • ADI - Excel is not running, or is not available.

    Hi friends, I am trying to upload the journal entries through ADI. When I try to do this I get the following error "Excel is not running, or is not available. You cannot upload at this time.". We are on 11.5.9 and the excel we are using is 2003. This