Skip to main content
dublove
Legend
May 18, 2026
Answered

How to enable the "Auto Resize" function under the preferences and "Regional Text Options"?

  • May 18, 2026
  • 6 replies
  • 1028 views

I want to activate two functions of text:
One is:
Preferences>Text>Automatically adjust the text size in the new area“


The second one is the menu:

"Text>>Regional Text Options>Auto Resize“


I have searched a lot of information but have not been successful, and it seems that I can only open the preferences option.
A single text object cannot be set, which is a bit unscientific.

function setAutoTextFrames() {
//var autoSize = app.preferences.getBooleanPreference("text/autoSizing");
//app.preferences.setBooleanPreference("text/autoSizing", true);

var autoSize = app.preferences.getStringPreference('text/autoSizing');
alert(autoSize);

}
setAutoTextFrames();

https://judicious-night-bca.notion.site/app-getIntegerPreference-e4088e6caef64b3ba5b801d86fba7877

 

 

    Correct answer m1b

    @dublove The best I could do is to use Action code. Unfortunately, it is a bit of a hack, but I cannot think of any other way.

    — Mark

    /**
    * @file Auto Size Selected TextFrame.js
    *
    * Invoke the "Auto Size" area text option on the selected text frame(s).
    *
    * @author m1b
    * @version 2026-05-19
    * @discussion https://community.adobe.com/questions-652/how-to-enable-the-auto-resize-function-under-the-preferences-and-regional-text-options-1623882
    */
    (function () {

    if (
    0 === app.documents.length
    || 0 === app.activeDocument.selection.length
    )
    return alert('Please select one or more text frames and try again.');

    const KEEP_AUTOSIZE_ON = false;
    autoSizeSelectedTextFrames(KEEP_AUTOSIZE_ON);

    })();

    /**
    * Auto-sizes the given `textFrames`.
    * @param {Boolean} [keepOn] - whether to leave Auto Size turned ON (default: true).
    */
    function autoSizeSelectedTextFrames(keepOn) {

    // this is the .aia markup to invoke "Auto Size" in Area Text Options
    const AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_ON = '/version 3 /name [ 4 54656d70 ] /isOpen 1 /actionCount 1 /action-1 { /name [ 8 416374696f6e2031 ] /keyIndex 0 /colorIndex 0 /isOpen 0 /eventCount 1 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 1 } } }';
    const AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_OFF = '/version 3 /name [ 4 54656d70 ] /isOpen 1 /actionCount 1 /action-1 { /name [ 8 416374696f6e2031 ] /keyIndex 0 /colorIndex 0 /isOpen 0 /eventCount 2 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 1 } } /event-2 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 2 } } }';

    var aia = keepOn
    ? AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_ON
    : AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_OFF;

    // invoke the auto-size
    doActionFromString(aia);

    };

    /**
    * Create and execute an action using the markup supplied.
    *
    * Loads the .aia into a "DeleteMeNNNNN" action set,
    * which will be unloaded after running.
    *
    * Example of .aia markup:
    * const AUTOSIZE_AREATEXT = '/version 3 /name [ 4 54656d70 ] /isOpen 1 /actionCount 1 /action-1 { /name [ 8 416374696f6e2031 ] /keyIndex 0 /colorIndex 0 /isOpen 0 /eventCount 1 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 1 } } }';
    *
    * @author m1b (and thanks to Charu Rajput for initial idea of loading a temporary aia).
    * @version 2026-05-19
    * @param {String} aia - the action markup.
    */
    function doActionFromString(aia) {

    // replace the set name with a unique throwaway name to avoid collisions
    var setNameHex = encodeHex('DeleteMe' + Math.floor(Math.random() * 99999 + 1));
    aia = aia.replace(/\/name \[ [0-9]+ [0-9a-f]+ \]/, '/name [ ' + (setNameHex.length / 2) + ' ' + setNameHex + ' ]');

    var findName = /\/name\s\[ [0-9]+ ([0-9a-f]+) \]/g;
    var setName = decodeHex(findName.exec(aia)[1]);
    var actionName = decodeHex(findName.exec(aia)[1]);

    try {

    // save temp action, load it, do it, unload it, delete it
    var tmp = File(Folder.temp + '/' + setName + '.aia');
    tmp.open('w');
    tmp.write(aia);
    tmp.close();
    app.loadAction(tmp);
    app.doScript(actionName, setName, false);

    }
    catch (error) {
    alert('Script failed: ' + error.message);
    }
    finally {
    app.unloadAction(setName, '');
    tmp.remove();
    }

    };

    /**
    * Returns an ASCII string, given hexadecimal number.
    * @param {String} hex - the hexadecimal to decode.
    * @returns {String} - the decoded string.
    */
    function decodeHex(hex) {

    var result = '';

    for (var i = 0; i < hex.length; i += 2)
    result += String.fromCharCode(parseInt(hex.substr(i, 2), 16));

    return result;

    };

    /**
    * Returns a hexadecimal string encoding of an ASCII string.
    * @param {String} str - the string to encode.
    * @returns {String} - the hex-encoded string.
    */
    function encodeHex(str) {

    var result = '';

    for (var i = 0; i < str.length; i++) {
    var code = str.charCodeAt(i).toString(16);
    result += (code.length < 2 ? '0' : '') + code;
    }

    return result;

    };

    Edit 2026-05-19: added better error handling and documentation. 

    6 replies

    jennymartin806
    Participant
    June 6, 2026

    Thanks for the detailed explanation and the code snippet.

    From what you described, you’re trying to enable two related text behaviors:

    1. Preferences → Text → “Automatically adjust the text size in the new area”
    2. Text → Regional Text Options → “Auto Resize” (per text object setting)

    At the moment, these are handled differently internally:

    • The Preferences-level setting (auto-sizing for new text frames) can usually be toggled globally through app.preferences.
    • However, the “Auto Resize” under Regional Text Options is typically not exposed as a global scriptable preference, and in many versions it is only available as a per-text-object property inside the UI.

    That’s why your script:

     
    app.preferences.getStringPreference('text/autoSizing');

    may return a value, but doesn’t necessarily allow full control over both behaviors.

    Key limitation

    In most current implementations:

    • Global auto-size preference → scriptable (limited support depending on version)
    • Regional Text “Auto Resize” → not fully accessible via scripting API, only UI-level or object-level internal property

    What you can try

    If your goal is to enforce auto-resize on newly created text objects, you may need to:

    • Enable the preference manually in UI first
    • Then apply settings per text object (if the API exposes textFrame.autoSize or similar in your environment version)
    • Use a creation hook (if available) to apply settings immediately after text frame creation

    About your code

    Your approach is on the right track, but getStringPreference('text/autoSizing') may not reflect the actual toggle used in the UI—it often differs from internal flags.

    Suggestion

    If this is for production workflow automation, it would be worth confirming:

    • The exact application/version you are targeting
    • Whether the scripting API supports textFrame auto-size properties in that version

    If you want, I can help you rewrite the script to attempt per-text-object auto-resize based on your environment.

    dublove
    dubloveAuthor
    Legend
    June 6, 2026

    Hi ​@jennymartin806 

    app.preferences.getStringPreference('text/autoSizing');

    This simply enables the preference.
    The toggle in the Regional Text settings cannot be turned on.

    My version is the latest 2026

    blibliapps@123
    Participant
    June 2, 2026

    You can enable Auto Resize by opening Illustrator and navigating to Preferences > Type. Depending on your Illustrator version, the Auto Size New Area Type option should be available there.

    For Regional Text Options, check your language and text settings under Preferences and make sure the appropriate language support is enabled. Some regional text features may only appear in specific versions or language configurations.

    If the settings are not visible, updating Illustrator to the latest version and restarting the application often helps.

    I recently faced a similar issue while working on app-related graphics and UI assets, and updating the software resolved several missing text options. Hopefully, this helps.

    hamzarazza
    Participant
    June 1, 2026

    Hi,

    I faced a similar issue while working with Illustrator scripting. From what I found, the "Auto Resize" options under Preferences and Regional Text Options are not currently exposed through the standard scripting preference APIs. That's why methods like getBooleanPreference() or getStringPreference() don't return a usable value for these settings.

    The workaround shared by m1b is currently one of the most reliable solutions because it triggers the internal Area Text Options action directly. While it feels a bit like a hack, it allows you to enable Auto Size on selected text frames when the preference itself isn't accessible through scripting.

    If your goal is to apply Auto Resize automatically across multiple text frames, you could wrap the action-based approach into a batch-processing script and run it on all selected objects.

    I spent quite a bit of time researching this as well and found that Illustrator exposes only a limited set of text preferences to scripts, which is why many developers end up using Actions for advanced text automation.

    For anyone working with Illustrator automation and text-related scripting, I also found some useful scripting resources and examples here that may help with similar issues:https://ps2biosonlines.com/

    Hope this helps someone else who runs into the same limitation.

    dublove
    dubloveAuthor
    Legend
    June 1, 2026

    @hamzarazza 

    What is this website you recommended?
    It's a game, right? You're not mistaken, are you?

    Anna33
    Participant
    May 31, 2026

    Thanks for sharing this script. The Illustrator architecture for toggling Auto Resize is indeed overly complicated. The workaround with converting to point text and back works, but it's risky for overflowing text. I wish Adobe would just expose a simple preference toggle for individual text frames instead of requiring these hacks. For those interested in practical tools and niche communities, check out https://picardclub-belge.be/

    dublove
    dubloveAuthor
    Legend
    May 18, 2026

    Hi ​@m1b 

    Look at this, I happened to reply to myself before you.

     

    This front-end code can enable the preference "automatically adjust the size of the text box in the new area".


    But the following code cannot enable automatic resizing of individual text boxes.
    I don't know why it needs to be converted into dotted text.
    And it may accidentally delete overflow text.

     

    Strange Illustrator architecture, is it so complicated to turn on a switch?

    //app.preferences.setBooleanPreference("text/autoSizing",!app.preferences.getBooleanPreference("text/autoSizing"));
    app.preferences.setBooleanPreference("text/autoSizing", true);
    function setAutoTextFrames() {
    var autoSize = app.preferences.getBooleanPreference("text/autoSizing");
    app.preferences.setBooleanPreference("text/autoSizing", true);
    var doc = app.activeDocument;
    var items = doc.selection;
    var content;
    for (var i = items.length - 1; i > -1; i--) {
    if (items[i].kind == TextType.AREATEXT) {
    content = items[i].contents;
    items[i].contents = "This is just a random string of text to keep the width of the text frame stable while we convert to point text then back to area text";
    items[i].convertAreaObjectToPointObject();
    items[i].convertPointObjectToAreaObject();
    items[i].contents = content;
    }
    }
    app.preferences.setBooleanPreference("text/autoSizing", autoSize);
    }
    setAutoTextFrames();

     

    m1b
    Community Expert
    m1bCommunity ExpertCorrect answer
    Community Expert
    May 18, 2026

    @dublove The best I could do is to use Action code. Unfortunately, it is a bit of a hack, but I cannot think of any other way.

    — Mark

    /**
    * @file Auto Size Selected TextFrame.js
    *
    * Invoke the "Auto Size" area text option on the selected text frame(s).
    *
    * @author m1b
    * @version 2026-05-19
    * @discussion https://community.adobe.com/questions-652/how-to-enable-the-auto-resize-function-under-the-preferences-and-regional-text-options-1623882
    */
    (function () {

    if (
    0 === app.documents.length
    || 0 === app.activeDocument.selection.length
    )
    return alert('Please select one or more text frames and try again.');

    const KEEP_AUTOSIZE_ON = false;
    autoSizeSelectedTextFrames(KEEP_AUTOSIZE_ON);

    })();

    /**
    * Auto-sizes the given `textFrames`.
    * @param {Boolean} [keepOn] - whether to leave Auto Size turned ON (default: true).
    */
    function autoSizeSelectedTextFrames(keepOn) {

    // this is the .aia markup to invoke "Auto Size" in Area Text Options
    const AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_ON = '/version 3 /name [ 4 54656d70 ] /isOpen 1 /actionCount 1 /action-1 { /name [ 8 416374696f6e2031 ] /keyIndex 0 /colorIndex 0 /isOpen 0 /eventCount 1 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 1 } } }';
    const AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_OFF = '/version 3 /name [ 4 54656d70 ] /isOpen 1 /actionCount 1 /action-1 { /name [ 8 416374696f6e2031 ] /keyIndex 0 /colorIndex 0 /isOpen 0 /eventCount 2 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 1 } } /event-2 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 2 } } }';

    var aia = keepOn
    ? AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_ON
    : AUTOSIZE_AREATEXT_OPTIONS_AIA_AND_KEEP_OFF;

    // invoke the auto-size
    doActionFromString(aia);

    };

    /**
    * Create and execute an action using the markup supplied.
    *
    * Loads the .aia into a "DeleteMeNNNNN" action set,
    * which will be unloaded after running.
    *
    * Example of .aia markup:
    * const AUTOSIZE_AREATEXT = '/version 3 /name [ 4 54656d70 ] /isOpen 1 /actionCount 1 /action-1 { /name [ 8 416374696f6e2031 ] /keyIndex 0 /colorIndex 0 /isOpen 0 /eventCount 1 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_SLOAreaTextDialog) /localizedName [ 17 417265612054797065204f7074696f6e73 ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 1 /parameter-1 { /key 1952539754 /showInPalette 4294967295 /type (integer) /value 1 } } }';
    *
    * @author m1b (and thanks to Charu Rajput for initial idea of loading a temporary aia).
    * @version 2026-05-19
    * @param {String} aia - the action markup.
    */
    function doActionFromString(aia) {

    // replace the set name with a unique throwaway name to avoid collisions
    var setNameHex = encodeHex('DeleteMe' + Math.floor(Math.random() * 99999 + 1));
    aia = aia.replace(/\/name \[ [0-9]+ [0-9a-f]+ \]/, '/name [ ' + (setNameHex.length / 2) + ' ' + setNameHex + ' ]');

    var findName = /\/name\s\[ [0-9]+ ([0-9a-f]+) \]/g;
    var setName = decodeHex(findName.exec(aia)[1]);
    var actionName = decodeHex(findName.exec(aia)[1]);

    try {

    // save temp action, load it, do it, unload it, delete it
    var tmp = File(Folder.temp + '/' + setName + '.aia');
    tmp.open('w');
    tmp.write(aia);
    tmp.close();
    app.loadAction(tmp);
    app.doScript(actionName, setName, false);

    }
    catch (error) {
    alert('Script failed: ' + error.message);
    }
    finally {
    app.unloadAction(setName, '');
    tmp.remove();
    }

    };

    /**
    * Returns an ASCII string, given hexadecimal number.
    * @param {String} hex - the hexadecimal to decode.
    * @returns {String} - the decoded string.
    */
    function decodeHex(hex) {

    var result = '';

    for (var i = 0; i < hex.length; i += 2)
    result += String.fromCharCode(parseInt(hex.substr(i, 2), 16));

    return result;

    };

    /**
    * Returns a hexadecimal string encoding of an ASCII string.
    * @param {String} str - the string to encode.
    * @returns {String} - the hex-encoded string.
    */
    function encodeHex(str) {

    var result = '';

    for (var i = 0; i < str.length; i++) {
    var code = str.charCodeAt(i).toString(16);
    result += (code.length < 2 ? '0' : '') + code;
    }

    return result;

    };

    Edit 2026-05-19: added better error handling and documentation. 

    dublove
    dubloveAuthor
    Legend
    May 18, 2026

    @m1b 

    Your code still hasn't enabled the 'auto resize' option.

    Just turn on this switch.
    Using the system's built-in text conversion is even more secure.
    A shortcut key can switch back and forth

     

     

    Preferences can be opened using this:
    app.preferences.setBooleanPreference("text/autoSizing", true);