|
|
Close Window Script
|
|
|
|
Sotremolo
|
|
So I've posted this question once or twice at Resexcellence and no one ever gave any real anwser. See, I'm too lazy to hold down the damned option button while i'm flipping folder to folder. Just as option works, I'd like to know if I can just write or download an applescript to do this to all folders once another is activated. I've only gotten to being able to do those to one route; say harddrive to system folder. It seems that I would need to make a seperate script for each folder, which I just won't do. The whole "this_folder" tag isn't working for me either (though I'm probably going about that the wrong way). So I just want to know this and I'll be gleefully satisfied. I mean, does this need to be turned into an app or extension to automatically do this to every folder? My option button needs a rest.
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status:
Offline
|
|
I don't have time to try this since I am getting married in two days.
I know this first part could be done easily.
Just thinking out loud I would say this is a job for folder action scripts. When the folder opens it closes its parent.
This second part sounds easy, but I have never tried it so I don't want to say for sure.
It would be a pain to have to set the folder action of each of your folders to the "close behind me" script. Could this assignment be scripted?
I am not at my own machine now and I won't be for about a week. I haven't tried any of this, but this is how I would start working on it.
-numero
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Mar 2000
Location: toronto, canada
Status:
Offline
|
|
Code:
(*
Save this as a stay-open applet.
It will check every 5 seconds and
close every container window excepting the frontmost.
If you want more than one open,
you'll have to quit this applet.
*)
on idle
tell application "Finder"
set x to container windows whose popup is false
set c to count of x
-- frontmost window will occur at beginning of list
-- because it's sorted by index
if c > 1 then close items 2 thru c of x
end tell
set x to {}
return 5 -- seconds before next check
end idle
Have fun!
p.s. numero, congratulations!
[This message has been edited by lycaon (edited 06-30-2000).]
|
|
|
|
|
|
|
|
|
RGS
|
|
Having an Applet idling just to close all windows other than the front is (IMO) excessive and will eventually create chaos. Why not a simple script under the OSA Menu or a script activated using a keyboard command using T-Minus Ten or similar?
-----
tell application "Finder"
activate
close (every window whose index is not 1)
end tell
--or--
tell application "Finder"
activate
close (every window whose index > 1)
end tell
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Mar 2000
Location: toronto, canada
Status:
Offline
|
|
You could always remove the "on idle" wrapper. I do.
p.s. it only closes "container windows".
[This message has been edited by lycaon (edited 07-02-2000).]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|