• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What's the easy way to do this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the easy way to do this?


  • Subject: Re: What's the easy way to do this?
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 27 Jun 2002 08:23:15 +1000

On 26/6/02 10:42 PM +1000, Steve, email@hidden, wrote:

> 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

Be warned that the bounds of an image is unreliable.
>
> (* 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?

set theLeft to left of bounds as centimeters as real
set theLeft to theLeft + 1
set left of bounds to theLeft as centimeters

--
Shane Stanley, email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: What's the easy way to do this?
      • From: email@hidden (Michael Sullivan)
References: 
 >What's the easy way to do this? (From: Steve <email@hidden>)

  • Prev by Date: Re: puzzled with script syntax error
  • Next by Date: Re: puzzled with script syntax error
  • Previous by thread: What's the easy way to do this?
  • Next by thread: Re: What's the easy way to do this?
  • Index(es):
    • Date
    • Thread