Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

Zoom to Selected Object Illustrator (Free Script)

Community Expert ,
Apr 06, 2025 Apr 06, 2025

I'm reposting this as a standalone post to make it easier for anyone to find and use.

 

A user asked in this thread about a keyboard shortcut to zoom to a selected object in Adobe Illustrator the way many 3D drawing tools can. Of course, Illustrator will zoom toward/away from a selected object using CMD/CTRL plus/minus, which is what I initially told the original poster. I learned that wasn't as convenient as the OP wanted, so I built the way they wanted.

 

Using my below script you can...

  • zoom Illustrator's view port directly to any selected object, 
  • whether that object is in view or not, 
  • whether you're already zoomed to Fit to Artboard, 64,000%, or any other zoom level.

 

And, you can assign the function a keyboard shortcut to make it work as easily as CMD+0/CTRL+0.

 

Thanks to @RP_Schmidt for giving me an interesting challenge to solve, especially since JavaScript programming is decidedly not my forte.

 

----------------------------------------

Zoom to Selected Object in Adobe Illustrator

Version 1.0 | 2025-04-06

by Pariah Burke, Adobe Community Professional, https://iampariah.com

 

First, download the script and the installation instructions, then follow the below (or included) instructions to add it to Illustrator and to bind it to a keyboard shortcut:

 

This script centers the view on the currently selected object(s) and adjusts the zoom so that the selection fits within the active artboard.

 

----------------------------------------

Installation

----------------------------------------

For Mac

 

  1. Install the Script
  • Move the Script:

Place the PSBZoomToSelected.jsx file into the Illustrator Scripts folder located at:

/Applications/Adobe Illustrator 2025/Presets.localized/en_US/Scripts

(Adjust the language folder if needed.)

  1. Restart Illustrator
  • If Illustrator is running, close and reopen it to load the new script.

 

----------------------------------------

 

For Windows

 

  1. Install the Script
  • Move the Script:

Place the PSBZoomToSelected.jsx file into the Illustrator Scripts folder, typically located at:

C:\Program Files\Adobe\Adobe Illustrator 2025\Presets\en_US\Scripts

  1. Restart Illustrator

 

----------------------------------------

Bind the Script to a Keyboard Shortcut

----------------------------------------

 

  1. Open the Actions Panel:

Go to Window > Actions.

  1. Create a New Action:
    • Click the New Action button at the bottom of the panel.
    • Name the action (e.g., “Zoom to Selection”) and assign a function key (with optional modifier keys) for the shortcut.
    • Click Record.
  2. Run the Script:
    • Navigate to File > Scripts and select PSBZoomToSelected.
    • The script will execute, and the action will record this step.
  3. Stop Recording:
    • Click the Stop button in the Actions panel.
    • Your new keyboard shortcut is now active.

 

----------------------------------------

Run the Script

----------------------------------------

 

You can now execute the script either via the assigned keyboard shortcut or by navigating to File > Scripts > PSBZoomToSelected.

 

----------------------------------------

By following these instructions, you’ll have the PSBZoomToSelected.jsx script installed and accessible via your custom keyboard shortcut in Adobe Illustrator 2025 on both Mac and Windows. Enjoy better zooming!

 

- Author: InDesign Masterclass: Type & Tables, InDesign Masterclass: Text Techniques, ePublishing with InDesign. Consultant & Trainer: ID, IC, AI, PS, Au, PDF, #508 Accessibility
TOPICS
How-to
125
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 10, 2025 Apr 10, 2025

Here are the usage and installation instructions in video form:

 

 

 

Translate
Adobe
Advocate ,
Apr 06, 2025 Apr 06, 2025

Thank you for sharing your scrpt!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 10, 2025 Apr 10, 2025

Wow, thank you very much!!!!

 

I've been on a development sprint for the last two weeks trying to catch up on projects, but I will definitely be adding this to illustrator and saving the installation instructions and script to my external folder for safekeeping (and in the event I have to reinstall).

 

I really appreciate the time you put into this and the consideration!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2025 Apr 10, 2025

You're welcome! I hope it makes Illustrator a little easier to work with.

 

 

- Author: InDesign Masterclass: Type & Tables, InDesign Masterclass: Text Techniques, ePublishing with InDesign. Consultant & Trainer: ID, IC, AI, PS, Au, PDF, #508 Accessibility
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2025 Apr 10, 2025
LATEST

Here are the usage and installation instructions in video form:

 

 

 

- Author: InDesign Masterclass: Type & Tables, InDesign Masterclass: Text Techniques, ePublishing with InDesign. Consultant & Trainer: ID, IC, AI, PS, Au, PDF, #508 Accessibility
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines