Applescript 'border element' Q

chris denesha cmd-list at 99main.com
Tue Sep 26 13:11:09 CDT 2006


At 04:07 PM 9/25/2006 -0500, you wrote:
>On Sep 25, 2006, at 15:00:21, chris denesha wrote:
>
>>Technical Q: Is there a reason why I cannot GET the fill gradient  
>>of a border, when I know there is one?
>>
>>-- Applescript
>>set myPageBorder to page border of page 1 of document 1
>>set myGradient to fill gradient of myPageBorder
>>-- end Applescript
>
>It will probably work if you rephrase it:
>
>set myGradient to fill gradient of (page border of page 1 of document 1)
>
>If that doesn't work:
>
>set myGradient to fill gradient of (get page border of page 1 of  
>document 1)
>
>The important part is that the parenthesized part actually *executes*  
>before you attempt to get the gradient out of it. Creator needs to  
>return the *record* that contains the page border, then you can get  
>the fill gradient out of that record. This sort of thing is not  
>uncommon.

First option crashes C7 with error 15 under OS9.

Second option says 'Can't get fill gradient of {class:rectangle element, id:656, ... }'.  This is also what happens if I first assign a variable to (page border of page 1 of document 1) OR (get page border of page 1 of document 1). 

So it seems that you can SET an option that you cannot directly GET.

I think I'll start using parenthesis more often, and start using the 'get' structure as well. :)

thanks again,

chris



More information about the Creator mailing list