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,