Re: Hiding OE's window
Re: Hiding OE's window
- Subject: Re: Hiding OE's window
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 01 Mar 2002 13:15:24 -0800
On 3/1/02 12:31 PM, "Gnarlodious" <email@hidden> wrote:
>
Entity Paul Berkowitz spoke thus:
I did not. ;-)
>
>
This trick works:
>
property oew : 0
>
tell application "Outlook Express"
>
activate
>
if oew = 0 then
>
set oew to 1
>
tell application "Finder"
>
open "Apple:Applications:Internet:Outlook Express:Outlook
>
Express" as alias
>
>
Is there any shorter way to say it,since the app is already open?
>
Is there any shorter way to do what? Obviously you don't need the Finder to
open OE since it's open already.
You're trying to open the main window if it's not open? Entourage has a
'main window' property, precisely for this reason, but OE doesn't. Even if
you know the name of the window ("Outlook Express" or "Outlook Express
Main Identity", or "Outlook Express Gnarlodious" or whatever) you can't
tell it to open when it doesn't exist, as you probably discovered.
I don't think you can do this, except maybe with some fancy footwork.
What happens if you try this:
set currIden to current identity
set current identity to currIden
That should work, but it will first want to close every open window, and ask
you if you want to save unsaved windows. so, if you want to deal with this,
you can try this:
tell application "Outlook Express"
save (every window whose class is draft window)
try
set openMsgList to displayed message of (every window whose class is
draft window)
on error
set openMsgList to {}
end try
close (every window whose class is draft window)
set currIden to current identity
set current identity to currIden
repeat with i from (count openMsgList) to 1 by -1
set theMsg to item i of openMsgList
open theMsg
end repeat
end tell
But honestly, I think you should just keep a stay-open applet anywhere on
your hard disk, which does simply this:
tell application "Outlook Express" to activate -- just in case
type text "1" holding down command -- Sigma's Commands, toggles main
window in OE
Your script in OE would be like this:
property windowApplet : ""
if windowApplet = "" then
set windowApplet to choose file of type {"APPL"} with prompt "Where is
your OE Window applet?"
end if
set appletPath to windowApplet as string
ignoring application responses
tell application appletPath
launch -- will open in background if not open
end tell
end
I can't test this from OS X. I forget whether a stay-open applet needs a
reopen handler to run again if it's already open, (launch may do nothing if
it's already open).
[or else just get Entourage and do this:
tell application "Microsoft Entourage" to open main window
]
--
Paul Berkowitz
_______________________________________________
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.