Zoom to Selected Object Illustrator (Free Script)
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
- 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.)
- Restart Illustrator
- If Illustrator is running, close and reopen it to load the new script.
----------------------------------------
For Windows
- 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
- Restart Illustrator
----------------------------------------
Bind the Script to a Keyboard Shortcut
----------------------------------------
- Open the Actions Panel:
Go to Window > Actions.
- 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.
- Run the Script:
- Navigate to File > Scripts and select PSBZoomToSelected.
- The script will execute, and the action will record this step.
- 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!

