I would LOVE LOVE LOVE a global zoom!
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!
|
|
FAQ | Members List | Calendar | Today's Posts | Search |
Can you set page-zoom percent globally? | Thread Tools | Search this Thread | Display Modes |
Member
2011-08-05, 03:43 PM
I would LOVE LOVE LOVE a global zoom!
Post 11
|
Member
2011-08-08, 10:23 AM
Here's a quick and dirty Applescript for setting zoom globally. It's true that the script-accessible zoom is a property of the window, though canvasas obviously retain a zoom level. This script just asks for a new zoom level (default is the current one) and then cycles the canvases through the window to set their zoom level.
Code:
tell application "OmniGraffle Professional 5" set currentZoom to the zoom of the front window set theDialog to display dialog "Zoom all canvases to:" default answer 100 * currentZoom set theZoom to the text returned of theDialog set currentCanvas to the canvas of the front window repeat with theCanv in every canvas in the document of the front window set the canvas of the front window to theCanv set the zoom of the front window to theZoom / 100 end repeat set the canvas of the front window to currentCanvas end tell Last edited by john.gersh; 2011-08-08 at 11:47 AM..
Post 12
|
Member
2011-09-01, 10:03 AM
thank you john.gersh!!!!
Post 13
|
Member
2011-12-19, 08:11 AM
Thanks John. Do you know if there's a way to set the zoom level to "Fit in Window" (or some way of calculating in the script what the zoom level should be in order to set this?)
Often times after I've been editing a document and left different canvases at different levels, I want to set every page to fit in window so I can look over everything. Can't figure out how to do this.
Post 14
|
Guest
2011-12-19, 03:46 PM
Here is a rough Zoom to Fit:
NOTE Now replaced by an improved script in its own thread. Code:
-- ROUGH OMNIGRAFFLE ZOOM TO FIT -- VER 0.3 -- ADJUST pZoomFactor up or down to suit property pZoomFactor : 0.8 tell application id "OGfl" tell front window set {rX, rY, rX1, rY1} to bounds set {rWinWidth, rWinHeight} to {rX1 - rX, rY1 - rY} try set oFrontCanvas to its canvas on error return end try repeat with oCanv in canvases of its document set {lstOrigin, lstSize} to {origin, size} of graphics of oCanv set lngGraphics to length of lstOrigin if lngGraphics > 0 then set {rXMax, rYMax} to {0, 0} repeat with i from 1 to lngGraphics set {rX, rY} to item i of lstOrigin set {rWidth, rHeight} to item i of lstSize set {rXPosn, rYPosn} to {rX + rWidth, rY + rHeight} if rXPosn > rXMax then set rXMax to rXPosn if rYPosn > rYMax then set rYMax to rYPosn end repeat set {rXScale, rYScale} to {rWinWidth / rXMax, rWinHeight / rYMax} set canvas of it to oCanv if rXScale < rYScale then set zoom to rXScale * pZoomFactor else set zoom to rYScale * pZoomFactor end if end if end repeat set its canvas to oFrontCanvas end tell end tell Last edited by RobTrew; 2011-12-20 at 07:29 AM.. Reason: Edited code to avoid division by zero with empty canvases
Post 15
|
Member
2011-12-19, 05:03 PM
Thanks a bunch Rob. Really appreciate it. This doesn't seem to be working for me at the moment, but I'll hopefully get a chance tomorrow to look more thoroughly to find out what's breaking.
Post 16
|
Member
2011-12-19, 06:11 PM
If you've got an empty canvas in your document, the script will crash. Changing the line "set {rXMax, rYMax} to {0, 0}" to "set {rXMax, rYMax} to {1, 1}" is one way to eliminate that issue.
Post 17
|
Guest
2011-12-19, 11:12 PM
Thank you for spotting that :-)
(I've made an edit above to version 0.2) It's a very rough sketch and may evolve ...
Post 18
|
Guest
2011-12-19, 11:45 PM
I also have keyboard assignments to a simple OmniGraffle Zoom OUT (zooms a bit further out on each keypress)
Code:
property pTitle : "OG Zoom OUT" property pFactor : 20 tell application id "OGfl" tell front window set dblZoom to zoom - (pFactor / 100) if dblZoom < 0.05 then set dblZoom to 0.05 set zoom to dblZoom end tell end tell Code:
property pTitle : "OG Zoom IN" property pFactor : 20 tell application id "OGfl" tell front window to set zoom to (zoom + pFactor / 100) end tell
Post 19
|
Guest
2011-12-20, 07:13 AM
I've started a new thread with a slightly better all canvas zoom to fit,
to make it easier to find.
Post 20
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Disable Full Page Zoom | Intel iMac | OmniWeb General | 1 | 2011-04-11 09:35 AM |
Full page zoom? | Juan Lupion | OmniWeb Feature Requests | 4 | 2010-06-05 07:52 AM |
Turning on Page Zoom in OmniWeb 5.9.2 Sneaky Peeks | dave_m | OmniWeb General | 2 | 2009-03-11 11:14 AM |
Change default page zoom? | Leon Starr | OmniGraffle General | 2 | 2007-05-19 12:42 PM |