@RP_Schmidt I solved it for you the way you want it to work.
Reading through your conversation with @Bobby Henderson , I understood how useful it would be to you to have a single keyboard shortcut that zooms to the selected object, and that the built-in Illustrator method I described above isn't the most convenient for you. That made me think there must be a way to create the functionality you want by scripting Illustrator. And there was. I scripted a zoom to selected object function for you. You can even bind it to a keyboard shortcut with the below instructions (which are also in the script's download ZIP).
First, download my script and the installation instructions, then follow these instructions to add it to Illustrator and to bind it to a keyboard shortcut:
Zoom to Selected Object in Adobe Illustrator
Version 1.0 | 2025-04-06
by Pariah Burke https://iampariah.com
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
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
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!