Creating Styles.. and then nesting styles

Seems simple enough:
tell application "Adobe InDesign CS5.5"
tell active document
  set myCharacterStyle to make character style with properties {name:"Year", size:26.0, fill color:"Paper", stroke color:"Black", stroke weight:0.75, font:"Helvetica", font style:"Black"}
  set myCharacterStyle to make character style with properties {name:"Years", size:18.0, fill color:"Black", stroke color:nothing, stroke weight:nothing, horizontal scale:80.0, vertical scale:80.0, font:"Helvetica", font style:"Black"}
  set myParagraphStyle to make paragraph style with properties {name:"Year"}
  set nested styles of myParagraphStyle to {{applied character style:"Year", repetition:1, inclusive:false, delimiter:any word}, {applied character style:"Years", repetition:2, inclusive:true, delimiter:any word}}
end tell
end tell
The font and the point size do not come through when the style is created. The nested styles also do not come through.
I tried applied font:"Helvetica" to get 'font family not available'. Also, font:font "Helvetica"...
What I get right now I is no font defined or size. The rest works.
So what am I doing wrong here?

Hi lithodora,
as Mary Posner wrote a character style doesn't have the property 'font', but 'applied font' and 'font style'.
"... specified as either a font object or the name of font family."
just look it up in the dictionary ...
Try always to work with references.
tell application "Adobe InDesign CS5.5"
    --you've got to set myHelvetica to your needs!
    set myHelveticas to (font family of every font whose name contains "Helvetica") --will return the helvetica font familiy names
    set myHelvetica to item 1 of myHelveticas --just randomly pick one for my example, hoping it's got a 'black' style ;-) ...
    tell active document
        set myCharacterStyle01 to make character style with properties {name:"test", size:26.0, fill color:"Paper", stroke color:"Black", stroke weight:0.75, applied font:myHelvetica, font style:"Black"}
        set myCharacterStyle02 to make character style with properties {name:"tests", size:18.0, fill color:"Black", stroke color:nothing, stroke weight:nothing, horizontal scale:80.0, vertical scale:80.0, applied font:myHelvetica, font style:"Black"}
        set myParagraphStyle to make paragraph style with properties {name:"nextTest"}
        tell myParagraphStyle
            make new nested style with properties {applied character style:myCharacterStyle01, repetition:1, inclusive:false, delimiter:any word}
            make new nested style with properties {applied character style:myCharacterStyle02, repetition:2, inclusive:true, delimiter:any word}
        end tell
    end tell
end tell

Similar Messages

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • Mapping XML tags to paragraph styles that contain nested styles

    I am importing XML into InDesign (CS5.5) and the tag mapping to styles is working fine until I get to a paragraph style that contains a nested style.
    I have a sentence that starts with a number:
    1the dog runs fast.
    In InDesing properly styled looks like this:
         1  The dog runs fast.
    (tab)1(tab)The dog runs fast.
    The number is styled with a character style (Number) and the whole sentence is styled with a paragraph style (Sentence). In order to get the tabs in between the number, I have a nested style within the paragraph style (Sentence). This triggers the tabs when it hits the character style (Number) like this:
    Number up to 2 Tab Characters
    In XML, it looks like this
    <sentencetag><numbertag>1</numbertag>The dog runs fast.</sentencetag>
    Sentencetag is mapped to Sentence paragrph style and Numbertag is mapped to Number character style, but the nested style for the tabs are not displaying. I just get this in IND.
    1the dog runs fast.
    Everything works beautifully until I hit the nested styles, which I do need to get to work somehow. Any help would be much appreciated.
    Thanks in advance!

    It sounds like your tab characters are actually disappearing from content in the XML. Jeff was responding to the fact that they need to be there, and you state that you originally had them in your document, but they are not showing up once imported through the XML.
    The tabs may be disappearing in the XML document due to the "TAB" character in your text editor not being a tab, or at least not properly-formed XML TAB equivalent, OR because you are not "importing whitespace elements" when you import your XML.
    Importing whitespace elements can wreak havoc on other things in your XML structure and styled layout within the Indesign document, so I would put the XML quivalent of TAB everywhere a tab should be in your XML, and make sure NOT to import whitespace (when importing XML using "Merge Content", select not to import whitespace items from the import options).
    I believe the XML friendly character code for a TAB character is "&#9;" or "&#09;" but have not tested this. Don't include quotes when adding the character code, just the ampersand, semicolon, and everything in-between.
    Also, sounds like your tags are mapping ok for you, so your XML should look something like:
    <sentencetag>&#9;<numbertag>1</numbertag>&#9;The dog runs fast</sentencetag>.
    It should't matter where you put the TAB character equivalent in relation to your nested tag.

  • CS3: typography and end nested style delimiters

    Hello,
    I'm trying to trick InDesign into exporting INX files in which all nested style delimiters are marked by an ENS character (a processing instruction in the exported INX). This makes the transform to XML much easier, because you can group adjacent, like-styled text without actually processing that text to find instances of character delimiters.
    I've written a JavaScript to process a layout, inserting an ENS character at every instance of any non-ENS delimiter (as defined in the paragraph style). The problem is that this seems to affect the layout in unanticipated ways.
    All seems well -- the nested character styles are properly applied, and InDesign seems to be paying attention to the required character delimiters and ignoring the inserted ENS characters. Mostly.
    In some cases, the ENS characters affect the typography of a paragraph. They seem to adjust applied kerning. The flow of text adjusts slightly at the insertion of the ENS character.
    I'd much appreciate any input on how InDesign handles ENS characters, especially when they aren't called for by the nested style definition.
    Thanks,
    Andrea

    Hi Dave,
    Thanks for your speedy reply.
    There are enough instances of nested styles that we're trying to avoid explicit ENS characters at all cost. There will be so many of them to enter!
    So ENS characters affect the resolution of nested styles even when they aren't used as delimiters in the nested style definitions? Is InDesign essentially looking for either the declared delimiter *or* an ENS character?
    If so, is there any way that can be overridden?
    Thanks,
    Andrea

  • Search and replace nested style in JS CS3

    I need to find and replace numbers at the beginning of paragraph which is styled as nestedStyle. What is the code? ST Dishon

    Hi dishon,
    I have attached the script to convert the applied nested styles to character style.
    After that you can easily do what you required.
    Regards,
    Ramkumar .P

  • 'Clear Paragraph Style' and 'Clear Selection Style'

    In an old archived topic, someone wrote:
    quote:
    In DWMX, you could select text in the design view and in the
    "HTML Styles" window (which no longer exists in MX 2004) all you
    had to do was click "Clear Selection Style" and all HTML formatting
    (paragraph tags, font faces, colours, bold, italics etc) would be
    removed. This was marvellous for reformatting <font> tag
    based text with CSS. MX 2004 claims to be a CSS machine, but it
    seems to lack this very important feature which helps to re-inforce
    the use of CSS over font tags.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=189&threadid=714513&arc tab=arc
    I absolutely agree, and none of the alternative methods
    people suggested in that thread matched this lost feature for speed
    and ease of use.
    I've not seen a replacement for these commands in Dreamweaver
    8 either (although I've often wished for one). Does anyone know of
    a hidden feature that exists in version 8 for removing all the HTML
    formatting in one fell swoop?

    I count 4 steps.
    1. Copy the entire line
    2. Paste into notepad
    3. Copy the entire line
    4. Paste into DW
    That does it nicely no matter how much presentational markup
    there is.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Kals" <[email protected]> wrote in message
    news:[email protected]...
    >
    quote:
    I think what the O/P is wanting is a quick and easy method to
    remove
    > all of
    > those presentational tags.
    >
    > Thanks Gary ? spot on! I'll use the term 'presentational
    markup' rather
    > than
    > 'HTML styles' from now on. (Excuse my ignorance, but
    what's an 'OP'?
    > Should I
    > like being called such a thing? :)
    >
    >
    quote:
    Murray: ? but you just cannot create predefined "HTML STYLES"
    any
    > longer.
    > It's no great loss....
    >
    > Agreed! Okay, we've established that no one's lamenting
    the loss of 'HTML
    > styles' in the sense of a style sheet that stores HTML
    presentational
    > markup.
    >
    >
    quote:
    And if "HTML STYLES" were not used in the first place, then
    even having
    > that feature available now wouldn't help OP, if your
    interpretation is
    > correct.
    >
    > Perhaps you are misinterpreting what those commands did.
    'Clear Paragraph
    > Style' was the equivalent of applying a predefined 'HTML
    style' with no
    > presentational markup ? making it as far as I know, the
    quickest, easiest
    > way
    > to strip all presentational markup out of your HTML
    (irrespective of
    > whether
    > the markup originated through the use of 'HTML styles').
    This could have
    > very
    > easily been replaced by a stand-alone command.
    >
    >
    quote:
    There are certainly quick and easy ways to remove many of
    them.
    > Okay then, here's the test. How many steps does it take
    you to clean up
    > the
    > following paragraph?
    >
    > <p align="center"><font size="+1" face="Times
    New Roman, Times, serif">The
    > quick
    brown fox
    jumps over the
    <font
    > color="#FF0000">lazy</font>
    dog</font></p>
    >
    > I count 10 steps if you select the entire paragraph and
    use nothing but
    > the
    > Properties panel and/or Text menu. Perhaps you can beat
    my attempt. If I
    > use
    > the 'Clean Up HTML' command, it takes me about 20
    seconds to check for and
    > type
    > in all the individual tags I want removed, then I still
    have to manually
    > fix
    > the alignment. Do you know of a quicker, easier way?
    >

  • Creating BP and then a Lead transaction from the incoming Email.

    Hi CRM Gurus,
    I am in a situation where our business needs to create a BP and then a Lead Transaction from the incoming mail from the customer.
    Can some one please help me out with the configuration, which needs to be done to achieve the mentioned requirement.
    Thanks in advance..
    Cheers!!!
    Ajay

    Hi
    this example is not for ERMS but in it there should be quite similar possibility.
    for Interaction Center you have Agent Inbox functionality, in SPRO tcode your will find configuration for Agent Inbox, where you may review it. To find workflow which is used by system you may go to SWETYPV tcode and look for object CICSUPRT2 and event MAILRECEIVED. Or go to SWEL and check whuch workflows were executed at a time when email arrived.
    Then best will be to copy this workflow in tcode SWDD to a new one, and set it in above configuration to be executed.
    In SWDD in this workflow add tasks for BP creation and Lead creation. Possibly you will find methods to be used in tcode SWO1 for objects like Lead or Business Partner. Or you may develop yours object in SWO1 with own menthods, and use it later in SWDD for tasks creation.
    Regards

  • Need steps to create: Users, and then allocate authorization profiles.

    Hello,
      I have set up release procedures using a how to doc which was posted an sap123.com. It doesnt go through how to do this, only gives a screen shot. The SAP environment is a test environment for training. We have maybe 4 users existing in system. I would like to know how to first create a user, then go through PFCG and create and allocate authorization profiles. They need to be able to approve PR's/ PO's using the two release codes and release groups I have set up. The steps I followed are posted here: http://www.sap123.com/showthread.php?t=59.
    Thanks for any help.

    Thanks. I do have authorization to create users/ roles & such. I have created 3 specifically to test the workflow I am trying to set up that contains release procedures.
    In PFCG - I created a new role MATMGT. On the Menu tab, Assign Transactions screen, could someone please tell me what the Transaction Code would be so that, when I goto the Authorizations tab and click on the Change Authorization Data button, I get a "Materials Management: Purchasing" row displayed in the Change Role: Authorizations screen. I am following http://www.sap123.com/showthread.php?t=59 - and am stuck at the "Create and allocate authorisation profiles" section, as there are no steps detailing the usage of PFCG.

  • Tool for creating UML and then convert to Java code?

    Hi,
    Does anyone have a suggestion for a free tool that allows for the creation of UML diagrams and then converting it to Java code?

    Try the Omondo plugin for eclipse: http://www.eclipseuml.com. I would rather use it or buy MagicDraw than work with Poseidon -- terribly terribly slow even on gigaherz PCs... :(

  • Is there a way to create, save, and access new styles in Mail?

    I'm curious if there's some magical way to add styles to the choices offered in Mail. I've hunted through Mail's Help program, and found nothing. Nothing intuitive under the Styles... menu option, either. The Document Styles seem to be Lucida Grande (ick) 13 pt and nothing else (despite arrows that look as though they're designed to shuffle through potential styles); Favorite styles give me Default, Bold, Courier Double Spaced, Italic, Outlined, and Shadowed, none of which is really very helpful at all.
    I would like to have easily accessible styles that are, say, 18 point (1.5) line spacing; different fonts, etc. Perhaps this is more a stationery question...but then that seems to beg the question of why have an unintuitive "Styles" option at all.
    Clueless seeking clues here.

    Hello,
    You can try to use the default Matching Question slide where dragging is possible.
    If you want more functionalities, have a look at the interactive Drag&Drop widget by InfoSemantics (my fav) or the Dag&Drop Lite Question widget:
    Drag&Drop Interactive Widget
    Lilybiri

  • RoboHelp - how to create Number1 and Number list styles?

    In RoboHelp 11, I have multi-level lists and normal lists. The multi-level list will continue numbering after a break in the list, like so:
    1. step one
    2. step two
    break
    3. step three
    If I want step three to start a new list, I go to the HTML and manually add a start="1" attribute. The normal list will start over at 1 after each break, and if I want it to continue I need to add a start attribute for wherever I left off.
    What I want is what I use in FrameMaker: a list style for Number1 that I can add when I want to restart lists, and a Number/Number_next for continuing where I left off, without having to manually alter the HTML. I feel like I'm missing something because I can't find an option to create a list like this in the CSS editor, and I can't figure out what to add manually to the CSS file in a text editor that makes RoboHelp recognize what I want it to do. But obviously the option exists because the multi-level list and the normal list exhibit both behaviors that I want.

    In RoboHelp (or HTML), there is no feature like you have in Frame. Both Multilevel list and regular HTML lists require you to set the numbering after you break.
    An alternative way of working may be to not create real paragraph but to end line feeds pressing Ctrl+ENTER. This won't break the list numbering while you can add multiple lines.
    Kind regards,
    Willam

  • FAQ: How do I clear out my font cache to fix font style and duplicate font style issues?

    We have a Script availabe for CS6 beta users who are experiencing particular font related issues.
    This script will help by clearing the font cache and will test for corrupted fonts.
    This will solve some of the type issues with duplicate font names and some of the other font errors.
    This script is to help to find corrupted fonts. The script itself doesn’t solve the problem.
    This script doesn’t solve duplicate font name, but clears out your font cach .  It it will solve some duplicate font style name issues such as the one  in the link below.
    http://forums.adobe.com/message/4306828#4306828
    There is a pdf file explaining how to use the script and what it will do.
    See attached files.

    Monica, I know the Normal Character Style in Illustrator must be defined. But my question is about the Normal Paragraph Style, not the Normal Character Style. As Larry just said, in most of my documents, and in my New Document Profiles, these fields in the Normal Paragraph Style are blank (undefined), so I know this is possible. In a few older documents I'm converting, the Normal Paragraph Style has a defunct font, and even though my Normal Character Style is correctly defined with the current font, it's creating some weird behavior.
    Larry, it doesn't appear to be the document itself, it just appears to be not knowing what the right keystroke combo is to clear it. Just make a new file from a Document Profile where the Normal Paragraph Style does not define one of those font fields, define a font and/or font size, save, then reopen the paragraph style settings and try to clear any field that has been set. I can't clear it, I can only change the font.

  • Photoshop CS5 creates file and then doesn't allow me to open it.

    I created a file on Photoshop CS5, saved it, and now when I try to open it says: "Could not complete your request because the file is not compatible with this version of Photoshop." How can I open the file? How come the same program cannot open its own file? Can anybody help me with this? Thanks.

    That can happen in any version of Photoshop and it can be for one of at least two reasons:
    1.— The file was over 2 GB in size and was saved as a PSD rather than a PSB file; or
    2.— The file got corrupted.  This can happen when attempting to work across a network or with Norton Anti Virus (NAV) running on your computer. 
    Always work locally.  To open a file stored on a network volume, copy the CLOSED file in the Finder to your local hard drive first, then open the local file.  Once you are done working on the image, save the file on your local hard drive, close it and copy the CLOSED file back to the server.
    Sometimes, Illustrator or GraphicConverter can recover the flattened composite in a corrupted file if you're lucky, but the layers will be toast.
    If the file was indeed over 2 GB and saved as a PSD rather than a PSB, I know of no way to open it.
    Give us some more details of the history of the file and maybe someone else will have other ideas.
    Wo Tai Lao Le
    我太老了

  • Cannot create Folder and then add AppV sequenced apps in the Start menu

    Hi,
    I have managed to sequence the apps properly using the App-V 5.0 SP2 sequencer. But after adding the package and publishing it globally, when i mount the package in my App-V client machine, it creates a direct application shortcut in the Start menu. What
    I want is to create all the App-V sequenced apps in a Folder in start menu so that users do not get confused by the overwhelming list of apps. Please suggest if there is a way possible.
    Thanks!

    Hi 
    I managed to install App-V client on a new server and mount the package again.
    But still I can't seem to get it work the way I want. I want to see a Folder in the start menu hosting my App-V apps. Even though I have given the same setting in the APP-V management server, it still publishes the app directly in the start menu. I can't
    understand how else to test this. What am I missing? Pls point me correctly
    Ben
    De Vriese & Tiberivs
    Find some screenshots for better understanding the issue.
    Also when i try the Publishing server URL from my client machine or any machine, I get the below output. Has this got something to do with the problem I am facing? Is it able to load the changes that I am doing, any SQL permissions problem?
    <?xml version="1.0"?>
    -<Publishing Protocol="1.0">
    <Packages/>
    </Publishing>

  • Break link to Cell and Table Style and keep the style setting

    For cell Selection is work (but can't keep the style setting after break the link), but I also want to break the table style, but error
    For both Break link to cell/table style, I want to keep the style setting after break the link
    BreakLinkToTableStyleSelection();
    BreakLinkToCellStyleSelection();
    function BreakLinkToTableStyleSelection () {
    var
         mNone = app.activeDocument.tableStyles.item(0),
         mSel = app.selection[0];
    if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {
        mSel.tables.everyItem().appliedTableStyle = mNone;
        return;
    if(mSel.hasOwnProperty("baselineShift")){
        mSel.tables.everyItem().appliedTableStyle = mNone;
        return;
    function BreakLinkToCellStyleSelection () {
    var
         mNone = app.activeDocument.cellStyles.item(0),
         mSel = app.selection[0];
    if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {
        mSel.cells.everyItem().appliedCellStyle = mNone;
        return;
    if(mSel.hasOwnProperty("baselineShift")){
        mSel.tables.everyItem().cells.everyItem().appliedCellStyle = mNone;
        return;

    For cell Selection is work (but can't keep the style setting after break the link), but I also want to break the table style, but error
    For both Break link to cell/table style, I want to keep the style setting after break the link
    BreakLinkToTableStyleSelection();
    BreakLinkToCellStyleSelection();
    function BreakLinkToTableStyleSelection () {
    var
         mNone = app.activeDocument.tableStyles.item(0),
         mSel = app.selection[0];
    if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {
        mSel.tables.everyItem().appliedTableStyle = mNone;
        return;
    if(mSel.hasOwnProperty("baselineShift")){
        mSel.tables.everyItem().appliedTableStyle = mNone;
        return;
    function BreakLinkToCellStyleSelection () {
    var
         mNone = app.activeDocument.cellStyles.item(0),
         mSel = app.selection[0];
    if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {
        mSel.cells.everyItem().appliedCellStyle = mNone;
        return;
    if(mSel.hasOwnProperty("baselineShift")){
        mSel.tables.everyItem().cells.everyItem().appliedCellStyle = mNone;
        return;

Maybe you are looking for

  • Can I cut/paste my backups to an external hdd and then back to my mac?

    Ok, here's my issue and I'm sure I'm not the only one. I have an iPhone6 and my wife has one as well, and we both have iPads. I have to backup all of these somewhere, and my current device is a Macbook Pro with 250gb SSD. As you understand, backing u

  • Error while installing RCU 11.1.1.7.0 on 10g XE?

    Hi All, I am trying to install RCU 11.1.17.0_win_64 on Oracle XE 10g. I am facing Error https://dl.dropboxusercontent.com/u/78609236/RCU%20ERROR.png Regards

  • Modification of an existing form

    Hi, as mentioned by Vishnu, after using the entire code that was given by him the 'update' button did not reflect in the form,and i am not clear about what exactly should be done in this case.Will be very helpful if some one can assist in this situat

  • Accessing session variables

    Hi , I have session variable defined using portals (forms or plsql portlets). Can i access these variables using jsp portlets ?? This is an urgent requirement .. Regards, Vijaya

  • HDV Always having to render?

    Hello, I--after over two years--got a project we shot on a difficult JVC HDV U100 format digitized and onto a hard drive. I am very excited to get this project underway. My problem: when I drag the footage onto the time line the red line appears that