• 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
Wait until window is open
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wait until window is open


  • Subject: Wait until window is open
  • From: Thierry Lavallée <email@hidden>
  • Date: Thu, 20 May 2004 17:49:26 -0400

Hi,
My script fails if the opening of the window takes too long (open
OriginalPath).

How can I manage for AS to wait until each steps are finished before doing
the next?

Can anyone help?

Thanks!
--
Thierry
PS: OS9


---------------------------------------------------------------
set OriginalPath to "20 Go:F1015.jpg"

set ScaledPath to "20 Go:44_M.jpg"
set myRotate to false
set myAngle to 0 -- angle is CCW

set MaxWidth to 760
set MaxHeight to 500

tell application "GraphicConverter"
activate

set x to (open OriginalPath)
-- THIS PREVIOUS STEP SEEMS TO TAKE TOO LONG

set info to (image dimension of window 1)

set imageWidth to (item 1 of info)
set imageHeight to (item 2 of info)

if imageWidth > MaxWidth or imageHeight > MaxHeight then

if imageWidth  imageHeight then
set myscale to (round (MaxWidth / imageWidth * 10000)) / 10000
else
set myscale to (round (MaxHeight / imageHeight * (10000))) /
10000
-- 10000 will round with 2 decimals
end if

set x to (scale window 1 horizontal myscale vertical myscale)
set x to (sharpen edges of window 1 to 12)

end if
save window 1 in (ScaledPath) as JPEG
close window 1 without saving
end tell

tell me to activate
------------------------------------------------------
_______________________________________________
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: Wait until window is open
      • From: Joshua See <email@hidden>
    • Re: Wait until window is open
      • From: Dean Ritchie <email@hidden>
    • Re: Wait until window is open
      • From: BJ Terry <email@hidden>
  • Prev by Date: Indesign CS overriding master page items
  • Next by Date: Disabling Rendezvous
  • Previous by thread: Re: Indesign CS overriding master page items
  • Next by thread: Re: Wait until window is open
  • Index(es):
    • Date
    • Thread