The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   Can you set page-zoom percent globally? (http://forums.omnigroup.com/showthread.php?t=9103)

sugarfreejones@gmail.com 2008-07-30 01:43 PM

Can you set page-zoom percent globally?
 
Sometimes I want to go through all my canvases to see flows, but they are all at various settings of zoom. Is there a way to set the zoom globally?

Cheers

Rob

fjordaan 2008-07-31 05:21 AM

I'd like this too. As a special option, though -- most of the time, it's useful that OG remembers the zoom level on each canvas.

Joel 2008-07-31 10:38 AM

We do have an existing feature request for this, it seems to me that it would be possible to select multiple canvases in the sidebar and have the zoom setting affect all of them, does that sound like a good solution?

fjordaan 2008-07-31 11:30 AM

That sounds like a very elegant solution, Joel. My first guess was to have a new submenu group in the Zoom menu, so you'd have:
View: Zoom: All canvases: Zoom to Actual Size / Fit in Window

But I think I prefer your solution.

I'm not sure it'd make sense for all Zoom operations to affect multiple selected canvases. What would "Zoom in" do? Zoom them all in from their current setting, or zoom them all to the level of the currently-viewed canvas? Ditto for Zoom to Selection.

Joel 2008-07-31 11:51 AM

I was initially thinking that only the Zoom popup would work in this case, however that's a good point -- Using the Zoom Tool or View Menu should have some sort of impact on a multiple canvas selection, or I dunno, maybe it shouldn't.

Will have to chat up the UI team about this as a sanity check.

Auraelius 2008-08-05 05:36 PM

Applescript to set all windows or canvases to same zoom level?
 
While you are discussing adding the "set all/set selected canvases to same zoom" feature with the UI team, can you give us an applescript to accomplish it?

I'm not an applescripter, but looking into the Omnigrafle dictionary with the script editor, it appears that the zoom level is a factor of the window, not the canvas. This is confusing to me.

Thanks!

marc 2008-09-07 08:51 AM

[QUOTE=Joel;43234]I was initially thinking that only the Zoom popup would work in this case, however that's a good point -- Using the Zoom Tool or View Menu should have some sort of impact on a multiple canvas selection, or I dunno, maybe it shouldn't.

Will have to chat up the UI team about this as a sanity check.[/QUOTE]

I would very much like this feature.

While selecting all of the Canvases to set a Zoom level feels elegant, and direct, I wonder if it might not be terribly obvious to all users, esp. given that the Zoom pop-up control is on the opposite side of the window..?

Using the Zoom Menu items helps, in that it's the 'global' location, but is still distant from the Canvas thumbnails, so still could be missed.

Perhaps one way to make this feature slightly more evident to some users could be to add Canvas Zoom options to the Thumbnail Contextual Menu (i.e. when I Ctrl/Right-Click on the Canvas Thumbnails?

That way the control is directly related to the Canvas representations, and while not ideal (in that they're initially invisible, Contextual Menus are widely used, esp. by users with Windows experience.)

Andrew N 2008-10-26 12:27 PM

An applescript to do this would be very useful.... I can't work it out.

I have so far:
[CODE]tell application "OmniGraffle Professional 5"
set theDocument to front document
set canvasCount to count of canvases of theDocument
repeat with canvasNumber from 1 to canvasCount
set oCanvas to canvas canvasNumber of theDocument
set zoom of the window to 100
end repeat
end tell[/CODE]

RobTrew 2008-10-27 03:51 AM

In the OG Applescript dictionary, the zoom state is a property of windows rather than canvases.

You could reset the zoom level of all open windows:

[CODE]tell application "OmniGraffle Professional 5"
repeat with oWin in windows
tell oWin
if zoomable then set zoom to 2
end tell
end repeat
end tell[/CODE]

Vincer 2011-07-20 03:13 PM

Global "Fit in Window"
 
Has this feature been added?

CAgirl 2011-08-05 03:43 PM

I would LOVE LOVE LOVE a global zoom!

john.gersh 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[/CODE]

kirs10m 2011-09-01 10:03 AM

thank you john.gersh!!!!

Nigelw 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.

RobTrew 2011-12-19 03:46 PM

Here is a rough Zoom to Fit:

[B]NOTE[/B] Now replaced by an improved script in its [URL="http://forums.omnigroup.com/showthread.php?p=105291#post105291"]own thread[/URL].

[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
[/CODE]

Nigelw 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.

whpalmer4 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.

RobTrew 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 ...

RobTrew 2011-12-19 11:45 PM

I also have keyboard assignments to a simple OmniGraffle [B]Zoom OUT[/B] (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]

and a corresponding [B]Zoom IN[/B]

[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[/CODE]

RobTrew 2011-12-20 07:13 AM

I've started a [URL="http://forums.omnigroup.com/showthread.php?p=105291#post105291"]new thread[/URL] with a slightly better all canvas zoom to fit,
to make it easier to find.


All times are GMT -8. The time now is 10:31 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.