Re: dictionary collision
Re: dictionary collision
- Subject: Re: dictionary collision
- From: KOENIG Yvan <email@hidden>
- Date: Wed, 01 Jun 2011 18:34:24 +0200
Le 1 juin 2011 à 17:23, David Jacopille a écrit :
>
> In the context of a tell "Adobe Illustrator CS5" command the following scripting addition function doesn't work:
>
> set r to round counter / 2
>
> It throws an error of type -30002 which I'm guessing means there is some collision with some Illustrator vocabulary (although round isn't in the Illustrator dictionary - rounded is though). Whether I'm right about that or not, the function works outside of Illustrator but not inside.
>
> Unfortunately the command is buried deep inside the tell Illustrator statement and I don't want to back out for that. It would be annoying to create a handler just for this problem.
>
> Is there a way to explicitly clarify what dictionary to use to interpret a function name like "round"? Something like
>
> set r to (using scripting additions round (counter) / 2)
If there is no round function in the application, you aren't facing a conflict.
I assume that tou are in fact facing what I described two or three times:
calling an OSAX function in a tell block issue an error.
Sometimes it's automatically filtered but sometimes it's not.
If I am right, you must replace :
set r to round counter / 2
by
set r to my round_it (counter/2)
on round_It(nbr)
return round nbr
end round_it
Yvan KOENIG (VALLAURIS, France) mercredi 1 juin 2011 18:32:47
_______________________________________________
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