Adding properties with ParagraphStyles.add()

Hi!
I must be misunderstanding how the property "properties" of classes ParagraphStyle and CharacterStyle works. I have a function which looks for text with provided attributes and assigns an existing paragraph style to it. If the requested paragraph style doesn't exist a new style should be created and that's where I'm having trouble. I'd thought I could just write...
app.activeDocument.paragraphStyles.add({
            name: styleName,
            properties: myProperties
...and that the style would be created with all those properties but it doesn't work that way. However if I write
app.activeDocument.paragraphStyles.add({
            name: styleName,
            fontStyle: myProperties.fontStyle
then the right fontStyle gets applied to the new paragraph style, so the values are in the variable myProperties for sure. Any ideas on how to get this workning? See the full function with caller below if you need the context.
applyParagraphStyle("s-heading", {pointSize: 12, fontStyle: "Bold"});
function applyParagraphStyle(styleName, myProperties) {
    app.findGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.properties = myProperties;
    var styles = app.activeDocument.paragraphStyles;
    var style;
    var found = app.activeDocument.findGrep();
    try {
        style = styles.item(styleName);
        //try to assign style.name to value to see if an error is thrown
        var n = style.name;
    catch (myError) {
        alert("Couldn't find paragraph style '" + style.name + "'. New style created.");
        style = styles.add({
            name: styleName,
            properties: myProperties
    for (i = 0; i < found.length; i++){
        found[i].applyParagraphStyle(style, false);

Hi,
First:
myProperties supposed to be set like:
myProperties = {prop1: value1, prop2: value2};
Second:
"name" is a property as well. If you want to set it separatelly you should do it in a separate code line;
Finally adding PStyle use:
styles.add(myProperties);
rgds

Similar Messages

  • Just updated my iphone. Now I can se I have two? iCloud accounts? One of them appears on my phone, and I have forgotten the password. When I try to add the other account, I get the message that this account is already added, but with the name of the first

    Just updated my iphone. Now I can se I have two! iCloud accounts? One of them appears on my phone, and I have forgotten the password. When I try to add the other account, I get the message that this account is already added, but with the name of the first account where there is no available password. I have tried several times to reset the password, bun I don't get the information I need - I have no access to email. What can I do?

    Hi, thanks for the suggestion. I have tried as you suggested, and when opening the "purchased" apps some have the icloud logo next to them, but I only have "OPEN" against "Find My iPhone". When opening it up, it goes through the same routine; needs to be updated before proceeding, and wouldn't update because I don't have IOS8.
    Anything else I could try, or am I doomed!
    All of your help is much appreciated, thanks

  • Batch Input : Adding component with C002

    Hi all
    I try to add component on a production ordrer with C0O2 but i have problem with the item category 'R' (Variable-size item). In fact, SAP ask me to fill variable-size item data but i can't run this step with batch input.
    For example with the batch input recorder, i obtain :
    SAPLCOKO1 0110 X
         BDC_OKCODE                         /00
         CAUFVD-AUFNR          10001280
    SAPLCOKO1 0115 X
         BDC_OKCODE          =KPU2
    SAPLCOMK 0120 X
         BDC_CURSOR          RESBD-LGORT(23)
         BDC_OKCODE          /00
         FILTER_BOX          NO_FIL
         SORT_BOX          ST_STA
         RESBD-MATNR(23)      SAM6506P00055
         RESBD-MENGE(23)          2
         RESBD-EINHEIT(23)     M
         RESBD-POSTP(23)          R
         RESBD-VORNR(23)          0040
         RCOLS-APLFL(23)          23
         RESBD-WERKS(23)          0200
         RESBD-LGORT(23)          0010
         BDC_SUBSCR          SAPLCOKO1                               0800ORD_HEADER
         BDC_SUBSCR          SAPLCOMK                                0050BUTTONS
         BDC_SUBSCR          SAPLCOMD                                0160SUBSCR_0100
         BDC_CURSOR          RESBD-ROMEI
         RESBD-MATNR          SAM6506P00055
         RESBD-ROMS1          1000
         RESBD-ROMEI          MM
         RESBD-ROKME          M
    Is there other way to fill variable-size item ? Have you got ideas to simulate this step ?
    I don't use FM because i have to fill the field RESBD-VORNR.
    Thanks in advance for your response.
    Patrick.

    In fact the choice that i have made was wrong.
    Adding component with CO02 is possible with ls_params-nobinpt = ''.

  • Translation of Properties of "ParagraphStyle"

    Hi everybody,
    I need a little help with the translation of some properties for a user interface. Some properties of “ParagraphStyle” should be displayed for the user in German.
    Does anyone know how “Ruby Font” or “Kenten Font” is best translated into German?
    And what is meant by “previewColor” in connection with “ParagraphStyle”?
    The Reference Guide says only: “The color to use for preview, … representing R,G, and B values, …”. But what preview?
    Thanks for the help!
    Roland

    I need a little help with the translation of some properties for a user interface. Some properties of “ParagraphStyle” should be displayed for the user in German.
    Does anyone know how “Ruby Font” or “Kenten Font” is best translated into German?
    Just as we do not translate "Ruby" and "Kenten" into English, so you should not translate them into German. InDesign does not localize these terms, and that is correct. Anyone who wants to use them will refer to them by their transliterated-into-English names, Ruby and Kenten. Trying to come up with German names will simply cause confusion.
    As for your second question, in this post, Helpful AnswerRe: Fast Display always gray, Jongware suggests it doesn't do anything.

  • HR -- adding year with date and month

    Hi all,
    Can any one let me know what is the logic for adding Year with date and month in HR.
    ex: 01.10.2008   from this date it should be 2 years.
    thnks
    joshi.

    Hi
    u can add days to the date directly ....
    if u have the date V_DATE of type sy-datum u can add directly number of days to get disired date ..
    v_date1 =  v_date + 365 .
    hope it helps ..........

  • My idvd wont play sound in some parts of my i movie project, even though i can hear the sound in imovie. dont get it??? and at the end of my i movie i added pictures with music. it appears as tough there is some kind of ripple effect when i play in idvd??

    my idvd wont play sound in some parts of my i movie project, even though i can hear the sound in imovie. dont get it??? and at the end of my i movie i added pictures with music. it appears as tough there is some kind of ripple effect when i play in idvd??? i dont know why, i did not add anty effect.

    any suggestions

  • Firefox won't load/show images on some websites with Disconnect add-on enabled

    I've been having trouble with Firefox not loading images on some websites. I tried clearing my cache/cookies, checking permissions disabling the AdBlocker add-on but nothing worked. I've attached a screen shot of the page info for one of the pictures that didn't load. Something was changing the picture's file type to 'text/html.'
    I finally gave up and reset Firefox and that solved the problem. I began slowly adding back my previous add-ons and found that the Disconnect add-on was the cause. I've seen this issue discussed here and on other support websites as well as Bugzilla so I just wanted to offer up my solution in case anyone is having the same issue and can't pinpoint the origin.

    I also wanted to know if anyone has any alternatives to Disconnect that don't cause this to happen.
    ETA: I've replaced it with Ghostery and that looks be working great without blocking any pictures.

  • The document could not be saved. The server said: "The operation failed because an unexpected error occurred. (Result code 0×80020005)" Please ensure you have completed all required properties with the correct information and try again.

    I am having problems  saving documents back to SharePoint when any of the document properties (metadata columns) are set to be "managed metadata". The check-in/save fails with error:
    The document could not be saved. The server said:
    “The operation failed because an unexpected error occurred. (Result code 0×80020005)”
    Please ensure you have completed all required properties with the correct information and try again.
    I have seen similar threads that suggest this is a known issue with this version of Acrobat but I would like conformation from Adobe that this is a known issue and whether it is fixed in a newer version?
    Adobe Acrobat version 10.1.13
    SharePoint 2010

    Hi quodd,,
    We are sorry for the issue being faced by you. I need some information from you so that I take further steps:
    1. Which Adobe product are you using Acrobat or Adobe reader- what is the complete version?
    2. How are you opening and saving the PDF, the exact workflow?
         Are you doing it from within Adobe Reader/Acrobat application or opening it from browser, doing changes and saving it using browser itself.
    3. Can you try to save a PDF to library with Custom template and managed metadata columns using browser directly.
    4. Please verify that columns name do not contain spaces or some other special characters.
       Can you try to save PDF to library with Custom template and just a single managed metadata column  with a simple name
    Thanks,
    Nikhil Gupta

  • Reg creation of  value added service with delivery material

    hi
    I want to create the material which is used for the value added service with delivery .do u know the material type for creating the service material other than material type 'dien '. if i use the material type as ' DIEN ' , then i can't create the shipment. in  my scenario , i need to create the shipment. kindly help me in this scenario with the material type & the procedures

    hi
    I want to create the material which is used for the value added service with delivery .do u know the material type for creating the service material other than material type 'dien '. if i use the material type as ' DIEN ' , then i can't create the shipment. in  my scenario , i need to create the shipment. kindly help me in this scenario with the material type & the procedures

  • Major issues with a add-on Emoji Cheatsheet and missing add-ons in Firefox 37.0.2 ?

    As soon as Firefox updated me to 37.0.2 installed I started having issues with missing add-ons and missing tool bar buttons.
    Instead spending all day reloading add-on from "Refreshing" Firefox I just started going through my add-ons and disabling them and restarting (4-5 at a time) till thinks went right. I spent a hour last night till I got down t last few that could because it . I left FIREBUG disable and things started working as is and Compatibility Reporter started working too.
    Well I woke up to start Firefox and to my shagrin it was messed up again. So I went back through and and remembered the few last add-ons I re-enabled right before I disabled Firbug. So I disable it and sure enough things went back to normal.
    What Add-on was that?
    '''Emoji Cheatsheet :: Add-ons for Firefox'''
    [https://addons.mozilla.org/en-US/firefox/addon/emoji-cheatsheet/?src=ss]
    When the icon for it shows on my toolbar everything else shows, yet when it goes awal many other things malfunction. I tried reloading Firfox several times and nothing change. So when I disable it and restarted things were normal and working.
    Anyone else experience this?

    Sorry, the post about clearing your cache was meant for a different question.
    I suggest opening a ticket on the issue forums for this plugin: https://github.com/johannhof/emoji-helper/issues
    P.s. If it helps, I currently have 16 add-ons installed.

  • Issue with Excel add in

    Hi Experts,
    Some of the users receive the following error message while attempting to retrieve data on a previously-working query in essbase excel add in:
    "Essbase has encountered an internal Excel error. Your sheet will not be overwritten and none of your data will be lost. However, you are strongly urged to exit Excel and restart in order to clear up the problem"
    Also tried uninstalling and reinstalling Essbase client and also tried with essbase add in version 9.3.1.3, but nothing worked.
    Please let us know your thoughts on the below issue.
    Thanks,
    Raja
    Edited by: user647562 on Apr 27, 2009 1:21 PM

    I, too, would recommend rebuilding the workbook.. Excel workbooks can get some funny behaviors, particularly if they contain VBA code. VBA in Excel stays 'semi-compiled' and never really clears itself out and a bunch of phantom references remain (and are completely hidden). I have seen some very strange behavior cleaned up by rebuilding the workbook..
    My old friend, Excel MVP Rob Bovey, has a utility specifically built to rebuild workbooks at http://www.appspro.com/Utilities/Utilities.htm.
    Tim Tow
    Applied OLAP, Inc

  • Problem with Essbase add-in 9.2.1 and office 2010.

    Hi all,
    we have a problem with Essbase add in 9.2.1 and office 2010.
    Every time when a user opens Excel a new (additionally) euntry in the ad-on menue appears.
    Indeed what happens is, that the add-in is loaded n-times.
    At the first start of excel one time, second two times and so on...
    Thtas's very annoying.
    Can someone confirm this issue or even better know a workaround.
    (A way we have found so far to ease the pain a bit -well only temporary- is to disable the ad-in, close Excel and start it again.
    However with every new start of execel the issues begins again.
    But that's not a solution you can recommand to the end user.)
    Any help is welcome.
    Thank you in advance!
    Andre

    Have a read of the following on Oracle Support - Support for Office 2010 in Essbase Excel Add-In and Smart View [ID 1191235.1]
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • My daughter added songs with her I Tunes Card and My credit card was charged, what do I do?

    My daughter added songs with her I tunes card and my credit card was charged, how do I get it off my credit card?

    What process did your daughter use, there is a specific format to redeem an iTunes gift card. The gift card must be redeemed using the Redeem link in the Quick Links on the right side of the iTunes Store in iTunes on a computer or the Redeem button at the bottom of both the iTunes and App Store apps in iOS. Redeeming the gift card then applies the value of the card as an available credit to the user's iTunes account. The credit is used first before any bank card also stored in the account. If the purchases use the entire credit and there is an additional balance due, it will be charged to any bank card stored in the account.

  • I have never been able to use Firefox to view my OWA until I added the IE-Tab Add-on. Was this a known limitation for Firefox?

    I have never been able to use Firefox to view my OWA (Outlook Web Access). It always prompts for creds that it doesn't accept anyway. Until I added the IE-Tab Add-on, was this a known limitation for Firefox?

    Hi prime_anthony and thank you for asking. I do not think this is a Firefox limitation because I have been accessing my OWA too via Firefox on a Linux machine. I can login using my domain account and password without any problem and without using IE-Tab add-on.
    It probably depends on the version of the Outlook Web Access or the Exchange Server. Newer versions of these already have Firefox supported.

  • I was adding items with the intent of command z 'ing them back to their original when it crashed, autosaved, and my original numbers were lost to the temp numbers plugged in... how can i get back to the previous version? Because it had closed, command z

    I was adding items with the intent of command z 'ing them back to their original when it crashed, autosaved, and my original numbers were lost to the temp numbers plugged in... how can i get back to the previous version? Because it had closed, command z

    Sorry, this happened in CLOUD numbers....

Maybe you are looking for

  • Can I have several itunes libraries on one computer at the same time?

    can I have several itunes libraries on one computer at the same time?

  • Problems on selecting views with french characters into column names

    Hi All, I have views with column names such as "Détermination Planimétriq" or "Année de construction:*"; I can get in my c# function this columns names from ALL_VIEWS dictionary table, but if I try to make a selectionby use of an OracleCommand, Oracl

  • EPM 11.1.2 hyperion integration services is not started

    Hi People, I have an issue in my EPM 11.1.2, sometimes the service "Hyperion Integration Services" not start up. I dont know if I need this service running... all others services are running sucessfully. Does anyone know why would I need that service

  • Math.cos result WAY off

    I have a function that takes an angle in degrees and converts it to radians. From there it takes the cosine of that angle and multiplies it by another number. The problem is the result of the Math.cos is way off. The first line of code is this: var t

  • Another itunes:image thread

    I'm having problems getting my images to show up in the iTunes client.. It shows up here in the iTunes site: http://itunes.apple.com/podcast/political-notebook/id211870917 The image is a 300x300 JPG. They do not show up in the client on my computer,