Copy link to clipboard
Copied
With a lot of help from Jongware, here's a little script to change the view zoom level for an AI document window.
////////////
var ZF = prompt ("Enter the zoom factor you wish to use, 1.00 = 100%", 1.00, "Zoom to New Level");
if ( app.documents.length > 0 ) {
app.documents[0].views[0].zoom = ZF;
}
////////////////
Larry G. Schneider wrote:
With a lot of help from Jongware, here's a little script to change the view zoom level for an AI document window. ...
If you know the difference between your own screen and Illustrator's "100%", you can even get an 'actual' size! (Or a percentage thereof.)
Draw a rectangle and make it an easy, rounded size -- not something like 322.5367pt x 574.322pt, but, for example 5" x 5". Then set the scale to 100% according to Illustrator. Hold a ruler next to the object -- one in yo
...Copy link to clipboard
Copied
well done Larry
Copy link to clipboard
Copied
Larry G. Schneider wrote:
With a lot of help from Jongware, here's a little script to change the view zoom level for an AI document window. ...
If you know the difference between your own screen and Illustrator's "100%", you can even get an 'actual' size! (Or a percentage thereof.)
Draw a rectangle and make it an easy, rounded size -- not something like 322.5367pt x 574.322pt, but, for example 5" x 5". Then set the scale to 100% according to Illustrator. Hold a ruler next to the object -- one in your hand, of course, not the one on your screen! -- and measure the actual size of the 5" object. That might give you, for example, a distance of 3.85". Now fill in your values in the next script, and hey! actual scaling is enabled!
Note: the LEFT value of the scale is what you entered in Illustrator, the RIGHT value is what you actually measured. Both should be in the same measurement units, obviously.
(Now isn't it a shame Illustrator does not allow you to add a hotkey to your own scripts?)
var scale = 5/3.85; // FILL IN *YOUR OWN* VALUES!
if ( app.documents.length > 0 )
{
var ZF = prompt ("Enter the zoom factor you wish to use, in percents", 100, "Zoom to New Level");
if (ZF != undefined)
app.documents[0].views[0].zoom = (ZF * scale)/100;
}
This teeny tiny script contains 3 more improvements over Larry's:
1. It doesn't show the dialog if there are no documents open (switched the prompt and the Document Open test.)
2. It doesn't give an error if you cancel the dialog (tested for "undefined" return result)
3. You can enter a percentage as usual (divided the entered value by 100).
Copy link to clipboard
Copied
If app.redraw() actually worked as you would want it to… you could possibly take an on screen tour of your art in some animated fashion…
Copy link to clipboard
Copied
Thanks for the improvements. I keep learning from the best.
Copy link to clipboard
Copied
that is Jongware/Mark in no particular order
Copy link to clipboard
Copied
Do you think I can apply this technique to the slider image of my 2 sites:
I would really appreciate some help.
or
Sorry but I am kind of a newbie
Regards
Alessandro
Find more inspiration, events, and resources on the new Adobe Community
Explore Now