Object Sorter

Object Sorter

Script for Adobe Illustrator

✦ Available exclusively on Patreon for Pro supporters.

ㅤ

Description

Object Sorter changes the stacking order of selected Illustrator artwork without changing its position on the artboard. Choose a spatial, distance, name, reverse, or seeded shuffle method, preview the result, and apply the order when it looks right.

ㅤ

Features

Object Sorter combines flexible sorting with safeguards that keep complex documents intact.

  • Flexible reordering – Sort selected artwork in ten spatial, distance, name, reverse, and seeded shuffle arrangements.
  • Selection-safe results – Sort each immediate parent separately while preserving the stacking slots of unselected sibling objects.
  • Transactional processing – Preview changes safely and restore the original order if you cancel or if any sorting operation fails.
  • Spatial clustering – Adjust how generously objects are grouped into rows or columns with a precise tolerance setting.
  • Repeatable randomization – Reuse a seed to reproduce a shuffle or generate a new seed for another arrangement.
  • Natural name ordering – Sort names without case sensitivity and keep numeric sequences intuitive, such as Item 2 before Item 10.
  • Artwork-aware geometry – Use visible bounds, clipping paths, and group contents to calculate reliable object centers.

ㅤ

Installation

1. Download the Object Sorter.jsx script file.

2. Place the script in your Adobe Illustrator Scripts folder:

⮑ Mac: /Applications/Adobe Illustrator (Version)/Presets/(Language)/Scripts

⮑ Windows: C:\Program Files\Adobe\Adobe Illustrator (Version)\Presets(Language)\Scripts

3. Restart Adobe Illustrator if it's already running

4. Access the script via File > Scripts > Object Sorter

5. Alternatively, run it directly via File > Scripts > Other Script... and browse to the file location

Tip: You can also drag and drop the .jsx file directly onto the Illustrator workspace to run the script instantly – no installation needed.

ㅤ

Using the Script

ㅤ

Launch the Script

Open a document, select the artwork to reorder, and start Object Sorter from Illustrator's Scripts menu. The script changes stacking order only, so objects stay in place.

  1. Open a document – Open the Illustrator file that contains the artwork you want to reorder.
  2. Select artwork – Select at least two objects that share an immediate parent; selections from several layers or groups are processed as separate batches.
  3. Run Object Sorter – Choose File > Scripts > Object Sorter, or use File > Scripts > Other Script... to browse to the file.
  4. Review the first-run tour – The quick tour opens automatically the first time this release runs and can be closed or completed before sorting.

If a document, selection, or sortable batch is missing, the script shows a warning and leaves the document and current tool unchanged.

ㅤ

ㅤ

image gallery

ㅤ

ㅤ

➊ Choose the New Stacking Order

Choose the direction or rule that should determine the selected objects' new front-to-back order. Each parent is sorted independently, and a batch containing only one selected object is skipped.

  • Rows: Top-Left → Bottom-Right – Read objects across each row from left to right, beginning with the highest row.
image gallery
Row-Based Sorting

ㅤ

  • Columns: Top-Left → Bottom-Right – Read objects down each column from top to bottom, beginning with the leftmost column.
image gallery
Column-Based Sorting

ㅤ

  • Bottom → Top · Right → Left – Read objects across each row from right to left, beginning with the lowest row.
  • Right → Left · Bottom → Top – Read objects up each column from bottom to top, beginning with the rightmost column.

Choose one of these additional methods when rows or columns are not the best description of the arrangement.

  • Distance: Center → Edge – Order objects from nearest to farthest from the average center of the selected batch, keeping the original stack order when distances match.
  • Distance: Edge → Center – Order objects from farthest to nearest to the average center of the selected batch, keeping the original stack order when distances match.
image gallery
Distance: Center → Edge and Edge → Center

ㅤ

  • Alphabetical: A → Z – Sort names in ascending natural order without case sensitivity, with unnamed objects given a temporary fallback name.
image gallery
Alphabetical: A → Z

ㅤ

  • Alphabetical Z → A – Sort names in descending natural order without case sensitivity, with unnamed objects given a temporary fallback name.
  • Reverse Selected Stack – Reverse only the selected objects within their existing stacking slots.
image gallery
Reverse Selected Stack

ㅤ

  • Seeded Shuffle – Create a repeatable shuffled order from the current seed; this is the default stacking order on first use.
image gallery
Seeded Shuffle

ㅤ

ㅤ

➋ Refine the Chosen Method

Use the Settings area to control how row and column groups are detected or how a shuffle is generated. Controls that do not apply to the chosen stacking order are grayed out.

  • Tolerance – Set a value from 0 to 200 points for the four row and column methods; the sensible default is 10 points.
  • Seed – Enter any text to define a repeatable Seeded Shuffle; the default is 1, and an empty field is treated as 0.

ㅤ

These additional controls make precise adjustments faster.

  • Decrease tolerance – Click the minus button to subtract 1 point, or Shift-click it to subtract 10 points.
  • Increase tolerance – Click the plus button to add 1 point, or Shift-click it to add 10 points.
  • Drag / Shift-drag / Option-drag / Alt-drag – Drag the tolerance value horizontally for normal adjustment, hold Shift for ten-times adjustment, or hold Option or Alt for fine 0.1-point adjustment.
  • Double-click – Double-click the tolerance value to reset it to 10 points.
  • New Seed – Generate a different seed for Seeded Shuffle without typing one yourself.

Leave Tolerance at 10 unless objects that should share a row or column are being separated or combined incorrectly.

ㅤ

ㅤ

➌ Preview and Inspect the Result

Turn on preview when you want to compare stacking orders before committing them. Preview changes only the selected objects' stack positions and can always be restored.

  • Preview OFF / Preview ON – Toggle live sorting in the document; preview is off by default, and turning it off restores the original order.

ㅤ

Use the view controls when overlapping objects make the result difficult to inspect.

  • Edges visible / Edges hidden – Show or hide Illustrator's selection edges without losing the stored selection; edges are visible by default.
  • Zoom to fit selection – Fit the current selection in the active view without changing its stacking order.

ㅤ

ㅤ

➍ Apply or Cancel the Sort

Commit the arrangement when it is correct, or leave the document exactly as it was before opening the dialog. Any failure during processing restores the complete original stack and removes the temporary sorting group.

  • Apply – Commit the selected stacking order, save the current mode, tolerance, seed, and dialog position, and show a confirmation with the processed result.
  • Cancel – Restore any previewed order and selection-edge state, close the dialog, and discard unsaved setting changes.

ㅤ

These keyboard shortcuts work when the Seed text field is not active.

  • Enter / Return – Apply the current settings.
  • Escape – Cancel the operation and close the dialog.

ㅤㅤ

ㅤㅤ

☻ Summary

You can now reorder selected artwork by position, distance, name, current stack, or a repeatable shuffle while leaving object coordinates and unselected stacking slots intact. Preview the result, refine the relevant settings, and apply with confidence because cancellation and processing failures restore the original order.

ㅤ

ㅤ

Leave a comment

Object Sorter

Version: 2.0.0

Updated:

    • 2.0.0 – Redesigned the interface and guide, added transactional mixed-parent sorting, preserved unselected stacking slots, and expanded preview, shuffle, keyboard, and reliability features.
    • 1.1.0 – Added hierarchy-safe mixed-selection handling with independent parent batches and unchanged singleton batches.
    • 1.0.9 – Moved persistent settings to validated system user-data storage with safe writes, migration, and window restoration.
    • 1.0.8 – Added the searchable, resizable built-in guide with offline documentation, mode pages, resource cards, and Scripts-folder detection.
    • 1.0.7 – Added deterministic shuffle, natural name sorting, stable preview restoration, hierarchy protection, robust bounds, spatial clustering, persistent settings, and the compact interface.
    • 1.0.6 – Introduced custom card-style sorting controls and refreshed mode iconography.
    • 1.0.5 – Refined the action bar, preview controls, and footer presentation.
    • 1.0.4 – Added theme-aware footer controls and updated resource links.
    • 1.0.3 – Improved selection preservation across preview and sorting operations.
    • 1.0.2 – Updated footer behavior and external resource actions.
    • 1.0.1 – Improved result messaging and the sorting workflow.
    • 1.0.0 – Delivered the initial stable release of Object Sorter.
      ㅤ

    ㅤ

    ㅤ

    Tested on MacOS:

    ㅤ

    • Adobe Illustrator 2023 (27.0)
    • Adobe Illustrator 2024 (28.1)
    • Adobe Illustrator 2025 (29.0)
  • Supported Versions:

    • Compatible with Adobe Illustrator CS6 and later, including Adobe Illustrator CC versions.

    Operating Systems:

    • Works on both macOS and Windows platforms.
  • End User License Agreement (EULA)

    Last Updated: 21.12.2024

    ㅤ

    This End User License Agreement (“Agreement”) is a legal agreement between you (“User” or “Licensee”) and Samolevsky.com (“Licensor”) regarding the use of the Adobe Illustrator scripts (“Software”). By downloading, installing, or using the Software, you agree to be bound by the terms of this Agreement.

    ㅤ

    1. Grant of License

    Licensor grants the User a non-exclusive, non-transferable, and revocable license to use the Software in accordance with this Agreement.

    • Free Software: If the Software is provided for free, you may use it for personal or commercial purposes without payment, subject to the restrictions outlined in this Agreement.
    • Paid Software: If the Software is provided for a fee, you may use it only after payment has been made in full.

    ㅤ

    2. Usage Rights

    You are permitted to:

    • Install and use the Software on devices you own or control.
    • Use the Software in your personal or commercial projects, subject to compliance with this Agreement.

    ㅤ

    3. Restrictions

    You may NOT:

    • Reverse engineer, decompile, or otherwise attempt to discover the source code, underlying ideas, or algorithms of the Software.
    • Reuse, incorporate, or integrate any portion of the Software into any other software, product, or project, except as expressly permitted by the Licensor in writing.
    • Resell, redistribute, or share the Software, whether in its original or modified form, without prior written consent from the Licensor.
    • Claim ownership of the Software or its underlying code.
    • Use the Software in any way that violates applicable laws or regulations.

    ㅤ

    4. Ownership

    The Software and all intellectual property rights therein remain the exclusive property of the Licensor. This Agreement does not transfer ownership of the Software or any intellectual property rights to the User.

    ㅤ

    5. Disclaimer of Warranties

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    ㅤ

    6. Limitation of Liability

    To the maximum extent permitted by law, Licensor shall not be liable for any damages, including but not limited to direct, indirect, incidental, special, or consequential damages, arising out of or related to the use or inability to use the Software.

    ㅤ

    7. Termination

    This Agreement is effective until terminated. Licensor may terminate this Agreement immediately if you breach any term of this Agreement. Upon termination, you must cease all use of the Software and destroy any copies in your possession.

    ㅤ

    8. Updates and Support

    Licensor is not obligated to provide updates, support, or maintenance for the Software. However, updates may be provided at the sole discretion of the Licensor.

    ㅤ

    9. Governing Law

    This Agreement shall be governed by and construed in accordance with the laws of the State of New York, without regard to its conflict of law principles.

    ㅤ

    10. Entire Agreement

    This Agreement constitutes the entire agreement between you and the Licensor concerning the Software and supersedes all prior or contemporaneous understandings regarding such subject matter.

    By using the Software, you acknowledge that you have read this Agreement, understand it, and agree to be bound by its terms.

    ㅤ

    For any questions or concerns regarding this Agreement, please contact us at hello@samolevsky.com

Browse More Scripts

  1. Explore Gradient Type Switcher
    Gradient Type Switcher

    Gradient Type Switcher

    Gradient Type Switcher converts gradient fills and strokes between linear and radial types in Adobe Illustrator. 

    Explore
  2. Explore Sequential Text Numbering
    Sequential Text Numbering

    Sequential Text Numbering

    Sequential Text Numbering automates numbering and labeling across selected text frames in Adobe Illustrator.

    Explore
  3. Explore Quick Resize
    Quick Resize

    Quick Resize

    Quick Resize is a floating panel for Adobe Illustrator that resizes selected objects to an exact width or height.

    Explore

Introducing ScriptBox

Your Complete Adobe Illustrator Productivity Hub

Required Software

Adobe Illustrator

Adobe Illustrator is a professional vector graphics software developed by Adobe Inc. It is widely used by designers, illustrators, and artists for creating a variety of digital artwork, including logos, icons, illustrations, typography, and complex design layouts. Illustrator is known for its precision and scalability, allowing users to create high-quality graphics that can be resized without losing clarity. Its features include powerful drawing tools, customizable brushes, advanced typography options, and seamless integration with other Adobe Creative Cloud applications. Illustrator is a go-to tool for creative professionals working on projects for print, web, and multimedia platforms.

  • 🅰 Locating the Scripts Folder

    To install a Object Sorter.jsx script in Adobe Illustrator, you need to place it in the correct directory where Illustrator
can recognize it. Follow these steps to locate the Scripts folder:

    1. MacOS:
      Open Finder and navigate to:
      Applications/Adobe Illustrator <Version>/Presets/<Language>/Scripts
    2. Windows:
      Open File Explorer and navigate to:
      C:\Program Files\Adobe\Adobe Illustrator <Version>\Presets\<Language>\Scripts
    3. Replace <Version> with your Adobe Illustrator version (e.g., 2025).
    4. Replace <Language> with your language folder (e.g., "de_DE" for German, "en_US" for English).

    ㅤ

    🅱 Installing the Script

    1. Copy the Script File: Copy the Object Sorter.jsx file to the Scripts folder located in the path above.
    2. On some systems, you may need administrator permissions to modify the Scripts folder.
    3. Restart Adobe Illustrator: To refresh the scripts menu, close and reopen Adobe Illustrator.

    ㅤ

    Explore our complete guide to mastering Adobe Illustrator scripts.

    1. Open Adobe Illustrator and ensure a document is active.
    2. Go to the top menu bar and select File > Scripts.
    3. If the script is installed in the Scripts folder, it will appear in the dropdown list.
    4. Click the Object Sorter script to run it.
    5. The Object Sorter script will execute, and any dialog boxes or results will appear based on the script’s functionality.

    ☻ Before running any scripts, it’s strongly advised to save your work — especially when working with complex or large documents.

Got questions?

Need help or have an idea to share? We’d love to hear from you! Whether you have questions, found a bug, have a feature request, or just want to share your feedback, reach out to us—we’re here for you!