Wait until window is open
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.