Outlook Express message window script
Outlook Express message window script
- Subject: Outlook Express message window script
- From: Irwin Poche <email@hidden>
- Date: Thu, 11 Oct 2001 12:36:55 -0500
Outlook Express always opens message windows in the same place and they're
too small. This script below moves and sizes message windows. The window
move is animated - because that's more fun.
The script will distinguish between two different machines, such as your
desktop and laptop, which would have different screen sizes.
To use the script paste it into your Script Editor. Change the strings
LAPTOP_NAME and DESKTOP_NAME to the name of your laptop and desktop.
If you don't know the name of your machines, execute the script "tell
application "Finder" to display dialog computer name".
Save the script to "Documents:Microsoft User
Data:Script Menu Items" with a
script name of your choice.
Open a message window in OE and try the script. If you don't like the
window positions, change the lines that look like
"my moveWindowTo(l,t,r,b,delta)"
to the left, top, right, and bottom coordinates you want. The fifth number,
delta, is number of animation steps to get to the final position. If you
prefer not to have animation, change this number to 1.
-Irwin
Note: The following two lines must end in an option-L character. You might
have to put them there yourself...
set {deltaL,deltaT,deltaR,deltaB} to ,
set {l0,t0,r0,b0} to ,
=====Start of Script =====
tell application "Finder" to set box to computer name
set {desk, lap} to {"DESKTOP_NAME", "LAPTOP_NAME"}
tell application "Outlook Express"
if class of window 1 is not in {draft window, message window} then
display dialog "Unsupported window type."
else
if box = desk then
my moveWindowTo(5, 41, 648, 761, 10)
else if box = lap then
my moveWindowTo(216, 41, 859, 738, 10)
else
display dialog ,
"The Machine name "&box&" is neither "&desk&" nor "&lap
end if
end if
end tell
on moveWindowTo(l,t,r,b,delta)
tell application "Outlook Express"
set {l0,t0,r0,b0} to bounds of window 1
set {deltaL, deltaT, deltaR, deltaB} to ,
{(l-l0)/delta,(t-t0)/delta,(r-r0)/delta,(b-b0)/delta}
repeat delta times
set {l0,t0,r0,b0} to ,
{l0+deltaL,t0+deltaT,r0+deltaR,b0+deltaB}
set bounds of window 1 to {l0,t0,r0,b0}
end repeat
end tell
end moveWindowTo
=====End of Script=====