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 Search Today's Posts Mark Forums Read

 
Scripting text alignment - Peter Pan effect Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
The alignment of text in OG shapes can be changed by script (code below), but the screen display is not updated until the file is closed and reloaded, or, less reliably, the zoom level is changed.

Oddly, different levels of zoom show different stages of update. At 85% on my system, I am seeing a curious Peter Pan effect, in which the text has moved, but has left its shadow behind ...

In case the effect looks useful, you should be able to reproduce it by:
  1. Setting a starting zoom level (say 85%),
  2. running the alignment-toggling script once,
  3. manually changing the zoom level to 100%,
  4. then manually changing it back to 85% ...



Code:
tell application id "OGfl"
	tell front canvas of front document
		set refRuns to a reference to attribute runs of text of shapes
		set lstAlign to alignment of refRuns
		if first item of lstAlign = {left} then
			set alignment of refRuns to right
		else
			set alignment of refRuns to left
		end if
		alignment of refRuns
	end tell
end tell
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2012-01-07 at 10.26.45.png
Views:	905
Size:	81.7 KB
ID:	2212  

Last edited by RobTrew; 2012-01-07 at 11:13 AM.. Reason: Added steps for reproducing the effect. Sadly it doesn't print - but there is always screen dump ...
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default text alignment perfectmacsolutions OmniGraffle General 4 2010-08-24 10:42 AM
the action “halo effect” bigcloits Applying OmniFocus 14 2009-08-15 06:24 PM
Text Alignment Default? tmeehan OmniGraffle General 4 2008-03-06 04:40 PM
Setting Due Date - No Effect Hawkcode OmniFocus 1 for Mac 5 2007-07-28 12:25 PM
Object reflection effect hardcoreUFO OmniGraffle General 3 2007-07-23 02:15 PM


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


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