Skip to main content
dublove
Legend
July 20, 2026
Question

Reset to Base still hasn't really solved it?

  • July 20, 2026
  • 1 reply
  • 37 views

Hi everyone.​

Is there no corresponding code for the Reset to Base option?
There is no information in the script manual, and only I have asked about the relevant content in the forum.
For example, the basic style is A, but after running, B is not completely based on A
Originally,  @m1b  wrote a function, but now I have found that the outer major items have been selected(inherited), but the internal values have not been inherited.

Pay attention to the changes in the style of object B, which was originally based on "TrueNone".

In fact, every time based on it, it needs to be reset to the bese. But the relevant code is missing for some unknown reason.

var A = app.documents[0].objectStyles.itemByName('A');
var B = app.documents[0].objectStyles.itemByName('B');
B.basedOn = A;
resetObjectStyle(B);
function resetObjectStyle(style) {
var baseStyle = style.basedOn;
var oldName = style.name;
if (!baseStyle.isValid) {
return alert('Object style cannot be reset due to missing base style.');
exit();
}
style.properties = baseStyle.properties;
style.name = oldName;
style.contentEffectsEnablingSettings.properties = baseStyle.contentEffectsEnablingSettings.properties;
style.objectEffectsEnablingSettings.properties = baseStyle.objectEffectsEnablingSettings.properties;
style.basedOn = baseStyle;
}

 

    1 reply

    rob day
    Community Expert
    Community Expert
    July 20, 2026

    Hi ​@dublove , Not sure if this is related to your problem, but the sample file you have attached (and files you have attached in other posts) have a corruption in the Object Styles’ Text Frame Options First Baseline Offset setting.

     

    The Offset field is blank, which I don’t think is possible with a new document—the default for [None] should be Ascent with options for Cap Height, Leading, x-Height, and Fixed. Null or nothing is not an option, a TrueNone object style would be set to Ascent:

     

     

    dublove
    dubloveAuthor
    Legend
    July 21, 2026

    Hi ​@rob day 

    It has nothing to do with this.
    This is just an example of my performance.
    There are also issues with 'Reset to Base' in many other documents.
    The example is not complicated, you can do a test yourself.
    I have re uploaded a new file.

     

    rob day
    Community Expert
    Community Expert
    July 21, 2026

    It has nothing to do with this...I have re uploaded a new file.

     

    The new version is also corrupted:

     

     

     

    The only way that I can think of to alter the read only [None] style would be to unzip an .IDML file and edit the Styles.xml file inside the Resources folder—yours is set to EmboxHeight. Did you edit the Styles.xml file?