Re: Simple Script Request
Re: Simple Script Request
- Subject: Re: Simple Script Request
- From: Malcolm Fitzgerald <email@hidden>
- Date: Fri, 10 Mar 2006 12:49:31 +1100
On 10/03/2006, at 10:44 AM, Joe Lachoff wrote:
One challenge we currently have is that the youngest children often
close the last window in Internet Explorer 5.1, and can't figure out
how to get a new window back. An ideal solution would be a simple
applescript that just quits IE upon the closure of the last open
window in the application. The children know how to launch IE, and
when they launch it again, it will automatically open a new window, as
desired.
This should get you started, save it as a stay-open background
application and put it into the startup folder.
-------------------------------------------
on open
-- do nothing
end open
on run
idle
end run
on idle
if MSIEhasWindows() then
userMoves()
-- or just call the window opener function
-- msieOpenWindow("", 0) -- empty URL string gives us the default
home page
end if
return 60
end idle
on MSIEhasNoWindows()
tell application "Finder" to set msie to name of application file id
"MSIE"
using terms from application "Internet Explorer"
tell application msie to set winList to ListWindows
end using terms from
return length of winList < 1
end MSIEhasNoWindows
on msieOpenWindow(urlStr, winNbr)
tell application "Finder" to set msie to name of application file id
"MSIE"
using terms from application "Internet Explorer"
tell application msie
Activate
OpenURL urlStr toWindow winNbr
end tell
end using terms from
end msieOpenWindow
on userMoves()
tell application "Finder" to set msie to name of application file id
"MSIE"
set s to "You can use " & msie & " if you open a new window." & return
& return
set s to s & "hint: Click OK then select \"New Window\" from the File
menu"
beep
using terms from application "Internet Explorer"
tell application msie
Activate
display dialog s giving up after 40 buttons {"OK"} default button 1
end tell
end using terms from
-- if user didn't respond open a window so we aren't tormented by
beeping Macs
if gave up of result then my msieOpenWindow("", 0)
end userMoves
-------------------------------------------
good luck,
Malcolm
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden