Can anyone tell me why the second stNmbrs(thNm, bnds1, bnds2) script does not work when the first one does?
Thanks
set thNm to "Numbers"
set bnds1 to {0, 64, 400, 600}
set bnds2 to {420, 64, 820, 600}
stNmbrs(thNm, bnds1, bnds2)
on stNmbrs(thNm, bnds1, bnds2)
-- gets win specs, returns nothing
tell application thNm
activate
set wCnt to count (the windows of application "Numbers" whose visible is true)
tell application "System Events"
repeat (2 - wCnt) times
keystroke "n" using command down
delay 0.2
end repeat
set bounds of (window 1 of application "Numbers") to bnds1
set bounds of (window 2 of application "Numbers") to bnds2
end tell
end tell
end stNmbrs
on stNmbrs(thNm, bnds1, bnds2)
-- gets win specs, returns nothing
tell application thNm
activate
set wCnt to count (the windows of application thNm whose visible is true)
tell application "System Events"
repeat (2 - wCnt) times
keystroke "n" using command down
delay 0.2
end repeat
set bounds of (window 1 of application thNm) to bnds1
set bounds of (window 2 of application thNm) to bnds2
end tell
end tell
end stNmbrs