The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   OmniGraffle current font bug (scripting) (http://forums.omnigroup.com/showthread.php?t=23246)

RobTrew 2012-01-19 08:34 AM

OmniGraffle current font bug (scripting)
 
If you change the font of shape text [B]through the GUI[/B]:
[LIST=1][*]Any subsequent scripting will incorrectly report the current font (returning the name of the font in use when the file was last opened).[*]If the font size is changed by script, the current font will be lost - replaced by the font in use when the file was last opened.[/LIST]
It seems that GUI font changes are only seen by script (and only safe from being lost by script) when the file has been closed and reopened. Simply saving the file is not enough ...

This seems analogous to (perhaps consanguineous with) the [URL="http://forums.omnigroup.com/showthread.php?t=23152"]Peter Pan[/URL] abandoned shadow bug.

[CODE]tell application id "OGfl"
tell front window
set lstSeln to selection
if length of lstSeln < 1 then return
set oShape to item 1 of lstSeln

-- FAILS TO REPORTS THE CURRENT FONT ...
-- (Reports the font in use when file last closed & reopened)
font of text of oShape
end tell
end tell[/CODE]

RobTrew 2012-02-09 01:40 AM

The twin sibling of this bug is that if you change the formatting of a piece of text [B]through script[/B]:
[LIST=1][*]The change will not be visible in the GUI until you adjust the zoom level, and[*]strangest of all, if you then return to the original zoom level, you will find yourself staring into the past, and looking at an earlier snapshot of the document's state ...[/LIST]
(This certainly applies to the font, size, and shadow of text - I haven't tested it for other properties, but it may well apply to them too ...)

[I][UPDATE it even applies to the wording of text itself - what you see on the editing screen may not be what shows on the Presentation screen, or in print ...][/I]

Something is architecturally amiss here ...
[LIST][*]Sometimes the screen is deceiving users about the state of their data, [*]and sometimes the Applescript interface is deceiving them ...[/LIST]
Good enough for idle play, but is it good enough for professional work ?

[COLOR="White"]--[/COLOR]

whpalmer4 2012-02-09 04:24 AM

What is placed on the clipboard if you do a copy operation (incl. copy as AppleScript) of one of these treacherous objects? What you see, or what you get?

RobTrew 2012-02-09 04:49 AM

2 Attachment(s)
Good question !

What you copy is not what you see ...

If you create this shape,
[IMG]http://forums.omnigroup.com/attachment.php?attachmentid=2251&stc=1&d=1328795131[/IMG]

and run this script,
[CODE]tell application id "OGfl"
tell canvas of front window
tell text of first shape
set last word to "fool"
end tell
end tell
end tell[/CODE]

And then copy and paste the apparently unchanged shape, you get a potentially baffling result:
[IMG]http://forums.omnigroup.com/attachment.php?attachmentid=2252&stc=1&d=1328795131[/IMG]

Copy as Applescript also gets something at variance with what you see ...

[COLOR="White"]--[/COLOR]

RobTrew 2012-02-09 04:58 AM

And the fact that you can see two different versions sitting next to each other on the same canvas at the same zoom level does seem to confirm that the fault lies somewhere deeper than a neglected screen refresh ...


All times are GMT -8. The time now is 08:37 PM.

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