Re: Basic Handler question
Re: Basic Handler question
- Subject: Re: Basic Handler question
- From: Laine Lee <email@hidden>
- Date: Tue, 02 May 2006 10:51:21 -0500
- Thread-topic: Basic Handler question
On 5/2/06 10:41 AM, "Sam" <email@hidden> wrote:
> I am using one of Hanaan's Handlers from his book in my script. In a nutshell,
> here it is:
>
> on round_number(the_number_to_round, the_decimal_precision)
> set multiplier to 10 ^ the_decimal_precision
> the_number_to_round * multiplier
> round result
> result / multiplier
> end round_number
>
> tell application "QuarkXPress"
> tell image 1
>
> set scalarx to rouset scalarx to round_number(item 1 of (get scale as list) as
> real, 2)
>
> end tell
> end tell
>
> watching the event log, I see that it's getting the item list, the number as
> real and it pulls in the handler round_number(99.99999, 2)
> But the error then is "QuarkXpress got an error: image 1 of current box
> doesn't understand the round_number message."
>
> Looking through the resources, I would think that Quark will get a value, but
> it's still seeing the handler being called.
>
> This is probably something simple but I'm not seeing it, thanx, sam
Getting the command that calls the handler out of the tell blocks is the
preferred way, I think. Something like this, maybe:
tell application "QuarkXPress"
tell image 1
set scalarx_number to (item 1 of (get scale as list))
end tell
end tell
set scalarx to round_number ((scalarx_number as real), 2)
(there seemed to be a small typo in your snipped, too.)
--
Laine Lee
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden