Script help

I am trying to write a simple script and need someone to point me in the right direction. I need to create some text, apply a gradient to it and then rotate the gradient 90degrees. My script looks like this: tell application “Intaglio” activate set myText to {make new text block with properties {font:“Impact”, size:24, text color:{linear gradient, 0.0, {rgb, 1.0, 1.0, 1.0, 1.0}, 0.5, 1.0, {rgb, 1.0, 0.0, 0.0, 1.0}}} with data “MyTestString”} set {X, Y, textWidth, textHeight} to the bounds of myText set gradient points of myText to {{X, Y}, {X, Y + textHeight}} end tell However this fails because it cannot get the bounds from myText. Any Help would be appreciated. Rob

I have got a result for this problem, although I am not really sure
why this method works and not the first example:

tell application “Intaglio”
activate
set thisDoc to the front document
set myText to {make new text block with properties {font:“Impact”,
size:24, text color:{linear gradient, 0.0, {rgb, 1.0, 1.0, 1.0, 1.0},
0.5, 1.0, {rgb, 1.0, 0.0, 0.0, 1.0}}} with data “MyTestString”}
myText convert to path
set theSelection to the selection of thisDoc
set myPath to item 1 of theSelection
set {X, Y, textWidth, textHeight} to the bounds of myPath
set gradient points of myPath to {{X, Y}, {X, Y + textHeight}}
end tell

My apologies for the formatting.

I know the problem has something to do with the way I reference the
graphics (and a lack of applescript knowledge).
I suspect there is a very simple solution/explanation?
Can anyone help?

Rob

On 11/03/2008, at 3:33 PM, Rob Carruthers wrote:

I am trying to write a simple script and need someone to point me in
the right direction. I need to create some text, apply a gradient to
it and then rotate the gradient 90degrees. My script looks like
this: tell application “Intaglio” activate set myText to {make new
text block with properties {font:“Impact”, size:24, text color:
{linear gradient, 0.0, {rgb, 1.0, 1.0, 1.0, 1.0}, 0.5, 1.0, {rgb,
1.0, 0.0, 0.0, 1.0}}} with data “MyTestString”} set {X, Y,
textWidth, textHeight} to the bounds of myText set gradient points
of myText to {{X, Y}, {X, Y + textHeight}} end tell However this
fails because it cannot get the bounds from myText. Any Help would
be appreciated. Rob


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I had to look at this for a while before it made sense. The problem is that you’re setting the variable myText to a list and trying to treat the list as a reference. You’re saying:

set myText to {make new text …}

so the brackets here are creating a list containing a reference to the text object. You can’t get the bounds property of a list so the script is failing.

To fix this you should remove the brackets:

set myText to make new text block with properties {font:”Impact”, size:24, text color: {linear gradient, 0.0, {rgb, 1.0, 1.0, 1.0, 1.0}, 0.5, 1.0, {rgb, 1.0, 0.0, 0.0, 1.0}}} with data “MyTestString”


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options