[Pythonmac-SIG] make locations with aeve

has hengist.podd at virgin.net
Mon Dec 1 20:22:15 EST 2003


Bob wrote:

>>Okay, I've got another question now about the make() command.  I'm 
>>still trying to execute this applescript, and I've got all the 
>>properties working.  But I need to specify this "at end of 
>>graphics"  argument.
>>
>[...]
>It doesn't look like the scripting terminology actually says that 
>you  can get graphics from a document..

It does - see OmniGraffle suite > document class > Elements > graphic


>You could try AppScripting until then.

You can, but mind it's still very rough and nowhere near ready for 
primetime. Right now its major problem is lousy handling of enums, 
and this'll cause some stuff to barf. (This'll be sorted by the next 
release, once I've figured out a decent solution.)

Anyway, using v0.2.0:

     import AppScripting as AS

     omnigraffle = AS.app('OmniGraffle.app')

     omnigraffle.documents[0].graphics.end.make(
             new='shape',
             with_properties={
                     'origin': [100, 100],
                     'size': [20, 20]})


Note here that AS provides a special-case for the 'make' command, 
whereby it can use the reference upon which it's called as its 'at' 
parameter (see Manual.txt for details). But if that freaks you out, 
you can still use the 'traditional' form:

     omnigraffle.make(
             new='shape',
             at=omnigraffle.documents[0].graphics.end
             with_properties={
                     'origin': [100, 100],
                     'size': [20, 20]})


HTH

has
-- 
http://freespace.virgin.net/hamish.sanderson/



More information about the Pythonmac-SIG mailing list