(1) CAUTION , this script is a Smile 's one.
(2) CAUTION, this script is designed to drive Dreamweaver so if like me you don't own this app, you will be forced to fool AppleScript using an other app as a fake Dreamweaver.
tell application "Finder"
set wdw to Finder window 1
select wdw -- in case the window was not selected
-- resize window so changes will hold - first
tell application "Finder" to tell wdw -- get original size (bounds)
set {leftSide, topSide, rightSide, bottomSide} to bounds
set bottomSide to bottomSide + 10 -- add 10 px to bottom
set bounds to {leftSide, topSide, rightSide, bottomSide}
end tell
-- then Zoom
tell application "Finder" to tell wdw
set z to zoomed
if not z then
tell application "System Events" to tell (first process whose frontmost is true) to try
click button 2 of window 1
end try
end if
end tell
tell application "Finder" to tell wdw
set {leftSide, topSide, rightSide, bottomSide} to bounds -- get original size (bounds)
set xSize to rightSide - leftSide -- width of window
set bottomSide to bottomSide + 10 -- add 10 px to bottom
end tell
…
I don't understand why you are coding :
tell application "Finder" to tell wdw
when you are already in a tell application "Finder" block.
Yvan KOENIG (VALLAURIS, France) dimanche 31 janvier 2010 18:41:31