Re: Close the script window in the Script Editor
Re: Close the script window in the Script Editor
- Subject: Re: Close the script window in the Script Editor
- From: Emile Schwarz <email@hidden>
- Date: Sun, 05 Oct 2008 17:52:55 +0200
Hi all,
as it happens sometimes, asking a question lead in some alternate
answers. I get this after some readings (The it and me Kkeywords, page
40) that make my brain working and getting a solution: get the window id
at the beg of the script and use the reference to close the window. In
the prior tries, I really have one window closed, but I didn't realized
'till I needed it!
I reply to my own question: [but the trick does not work :( ]
before the first tell statement line:
-- Get a reference to this window [in order to close it later]
set RefThisWindow to front window
before the main end tell statement line:
-- close me, I am now useless!
close RefThisWindow saving ask
and I get an error: unable to close this script while it is running
(translated from French)...
Emile
OK, saving ask is not mandatory and if the script have unsaved changes,
I get an error sheet window anyway, but the main purpose of that window
is not to be saved in standard run.
Emile Schwarz wrote:
Hi all,
I am at a loss of idea here.
I create (with a little help from my friend) a script who load some
other scripts that works together.
I want to close that script automatically when it is no more needed.
I placed just before the end tell statement line:
close
close front window
tell current application to close front window saving ask
(one at a time) and nothing work (but the line just before that one
who loads the AppleScript Language Guide pdf works fine; I even tried
with that line as comment) at all, I still can see my window.
I can see, in the Event History log (translated from French):
activate
close window 1 saving ask
[I added an activate line without success too]
Any idea ?
TIA,
Emile
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden