Re: What's the easy way to do this?
Re: What's the easy way to do this?
- Subject: Re: What's the easy way to do this?
- From: "Stockly, Ed" <email@hidden>
- Date: Fri, 28 Jun 2002 11:50:24 -0700
Hmmm... I might have missed part of this thread so I hope I'm not repeating things...
>
> > I have a script controlling Xpress 4.11
>
> >
>
> > It brings in some artwork into a picture box and then does this...
>
> >
>
> >
>
> > tell image 1
>
> > set scale to {"70", "70"}
>
> > set bounds to centered
>
> > set tempbnds to the bounds of me as list
The bounds of "me"? That makes no sense to me. "Me" in appleScript always refers to the process running the script, right?
The best way to get the bounds of an image is to run a command that sets the scale of the image to exact fit.
Then get the scale of the image and do the math with the width and the height. Shane showed me that and a couple years ago and it works like a charm. (If you like I can send you a script or post a snippet)
>>>>You bet it is -- I was going to suggest roughly what you did below, but tried it in SD first because I know how Xpress is...
>>>It won't get left, or top of bounds.
>>>What's really interesting is that if I convert *any* bounds to a "fixed rectangle", then I can't use Xpress to get the individual pieces via 'top' or 'left'.
>>>>There also doesn't seem to be any way to pull out strings from this either, pretty much anything I try to do with that errors.
>>>I'd love to know how the original poster is managing to treat that as a list of strings, because I can't manage to do even that much.
As for coercing Quark bounds and measurements, that can also be tricky. If you get the class of bounds, although it looks like a list, it tells you it's a measurement rectangle. But you can convert it to a list. Once you've done so if you get the class of an item of that list, although it looks like text or string, it tells you it's a measurement, but you can coerce it to a string. (Again, I have a script or can post a snippet.)
Once you're working with proper strings and lists you don't need to coerce them back into measurements or rectangles to set an object's bounds in Quark.
HTH,
ES
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.