What's the easy way to do this?
What's the easy way to do this?
- Subject: What's the easy way to do this?
- From: Steve <email@hidden>
- Date: Wed, 26 Jun 2002 13:42:44 +0100
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
(* Other code *)
end tell
What this does is centers the picture in the box and I want to move it down
1cm. Tempbnds contains
get offset of image 1 of generic box 62 of spread 1 of document
"Document3"
--> {
"0.906 cm",
"0.298 cm"
}
So I'm trying to write a script that takes the numeric value out of item 1,
adds 1 to it and then turns it back into a string and adds the " cm" back
on. And at the moment, that's what my script does but it does it the long
way - it goes through each character to make sure it's in "0123456789." and
recomposes the number.
Also, because of the " cm" I can't cheat and just add 1 to the number part
of the item. I.e. "0.906 cm" + 1 = "1.006 cm"
Is there a better way to achieve this? "1.234 cm" - " cm" = "1.234" than
checking each character?
Thanks,
Steve
_______________________________________________
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.