The Omni Group
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!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Today's Posts

 
OmniGraffle current font bug (scripting) Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
If you change the font of shape text through the GUI:
  1. Any subsequent scripting will incorrectly report the current font (returning the name of the font in use when the file was last opened).
  2. 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.

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 Peter Pan 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

Last edited by RobTrew; 2012-02-09 at 01:41 AM..
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Omnigraffle 5.4 - Apple Script Font Issue marxes OmniGraffle General 6 2012-06-13 09:17 AM
Setting screen font vs. print/export font [A: text zoom coming in OO4.] gmiddleton OmniOutliner 3 for Mac 26 2012-05-06 02:56 AM
Change Page Setup params through AppleScript GUI Scripting for OmniGraffle 5 coswald007 AppleScripting Omni Apps 1 2011-10-13 04:43 AM
Problem Using Scripting Bridge and OmniGraffle pixel OmniGraffle General 1 2009-12-03 08:52 AM
Crashes when scripting "group rank" property in OmniGraffle timcoffman AppleScripting Omni Apps 1 2009-07-09 06:50 AM


All times are GMT -8. The time now is 04:19 AM.


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