• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Illustrator Artboard Ruler Origin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Illustrator Artboard Ruler Origin


  • Subject: Re: Illustrator Artboard Ruler Origin
  • From: has <email@hidden>
  • Date: Fri, 26 Jul 2013 19:31:02 +0100

Shane Stanley wrote:

> If you paste in «class bAl8» instead of page origin, it will compile and work. Once. As soon as you recompile, it will fail again.

Yes, AppleScript's pretty printer is annoying like that. Not as annoying as having conflicting keywords/AE codes in the first place... though that's ultimately AS's fault as well for not providing application developers with basic validation tools to check their dictionaries are correct.


Type and constant name keyword clashes are easy enough to work around. Just write the raw representation in a string (which AS can't mess up) and use 'run script' to compile and return it:

property rulerOrigin : run script "«class ABCD»"


Other keyword clashes not so much, but still doable. The trick is to use 'run script' to compile and return a script object containing handlers that perform the relevant work, for example:

property AIShim : run script "
    script -- workarounds for problem artboard properties in AI6
       
        on getRulerOrigin(artboardRef)
            return «class bAl8» of artboardRef
        end
       
        on setRulerOrigin(artboardRef, newValue)
            set «class bAl8» of artboardRef to newValue
        end
       
        on getName(artboardRef)
            return «class bAl9» of artboardRef
        end
       
        on setName(artboardRef, newValue)
            set «class bAl9» of artboardRef to newValue
        end
       
    end"


You can then call those handlers as needed, for example:

tell application "Adobe Illustrator"
    set artboardRef to artboard 1 of document 1
    set rulerOrigin to AIShim's getRulerOrigin(artboardRef)
end tell
rulerOrigin --> {0.0, 0.0}


Feel free to file a bug report with Adobe on the 'artboard' class's 'name' and 'ruler origin' properties.

Regards,

has
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: mail
  • Next by Date: Re: Recording AppleEvent Class Codes
  • Previous by thread: Re: Recording AppleEvent Class Codes
  • Next by thread: viewing fan speed
  • Index(es):
    • Date
    • Thread