1 Reply Latest reply on Mar 31, 2009 12:18 AM by Polarbeer101

    getting an objectStyle that is in a format group

    Polarbeer101
      I have a script that is working with object styles. I grouped my styles and can't find out how to access them within the group. I tried with groupname.Stylename as I thought that would have been logical but doesn't work. Would appreciate any input on this, thanks.

      var myObjectStyle_CategoryTableCorner = myDoc.objectStyles.item("CategoryPage.CategoryTableCorner");

      item.parent.applyObjectStyle(myObjectStyle_CategoryTableCorner, false, false);
        • 1. Re: getting an objectStyle that is in a format group
          Polarbeer101 Level 1
          I found some help in the scripting reference and came up with this:

          myDoc = app.activeDocument;

          var myGroup_CategoryPage = myDoc.ObjectStyleGroups.itemByName("CategoryPage");

          var myObjectStyle_CategoryTableCorner = myGroup_CategoryPage.ObjectStyles.itemByName("CategoryTableCorner");

          However I get an error, code 55:

          (translated to english):

          The object doesn't support the property or method 'ObjectStyleGroups'

          EDIT: I totally forgot about case sensetivity, problem solved.