Re: Two things I noticed in a simple Finder script
Re: Two things I noticed in a simple Finder script
- Subject: Re: Two things I noticed in a simple Finder script
- From: David Thorp <email@hidden>
- Date: Mon, 04 Jun 2001 11:03:44 +1000
Hi,
Not a specific answer to your question, but these comments may be useful
anyway.
I have a similar set up with a few popup windows at the bottom of my screen,
and like you, whenever I get a screen resolution change and then return to
the original screen resolution (yes, usually for a game), I get messages
saying that it can't fit them all in anymore.
I have a script that closes them all, and then opens each one up one after
the other, unzooms it, then zooms it, and then sets it to a popup window,
and it arranges them all nicely along the bottom of the screen from the
left. (You've asked how to set them in the middle, and my last comment
addresses that).
A couple of comments:
(1) I had the issue of getting error messages whenever I tried to set a
window as a popup window when it already was set that way. Simple solution
to that: open the parent window of the relevant pop-up window, set that
parent window to list view, and then fold down the folder that is the one to
be opened and made into a popup. This step will automatically close that
window if it's open (regardless of whether it's set to popup or not).
This works nicely for me, since the folders for all my popup windows are in
the same parent folder anyway.
(2) An idea that I just had for helping set up the popup windows in the
center of the bottom of your screen instead of at the left (which I hope is
a correct understanding of one of the things you wanted to address):
Create an empty folder (or more if necessary) with a long enough name of
w's, and set it as the first popup window (which it will put in the bottom
left corner). Then set all the others (which it will do carrying on from
the left, just to the right of the first one) and then at the end of it all
close the first one.
The first one just takes up space so that the others are positioned after
it, in the position(s) where you want them. Depending on how wide your
screen is, and what font you're using as your large system font you may or
may not need more than one. The longest name allowed for a folder is
something like 27 characters, and 27 w's take up quite a bit of space. If
you need more than one, then of course you can make two or more.
Just a thought. I'd be interested to hear back from you as to whether this
idea was useful or not.
Hope this helps.
Regards,
David.
------------------------------------------------------------------------
David Thorp, Sydney Australia email@hidden
------------------------------------------------------------------------
>
From: Jan Pieter Kunst <email@hidden>
>
Date: Sat, 02 Jun 2001 17:47:01 +0200
>
To: Applescript lijst <email@hidden>
>
Subject: Two things I noticed in a simple Finder script
>
>
Hello all,
>
>
I have two windows with frequently accessed aliases opened as pop-up windows
>
at the bottom of my screen. A problem with this is that applications that
>
change the screen resulotion (Quake III for example) cause these pop-up
>
windows to change to normal windows.
>
>
I wrote a script to clean up my desktop after a screen resolution change
>
(icons back in their places, application switcher to the right upper corner,
>
and the two folders back as tabbed windows). I noticed that it is not
>
possible to script the exact position of the folder tabs at the bottom of
>
the screen. I can do this:
>
>
>
set x to container window of folder ...
>
set popup of x to true
>
set pulled open of x to false
>
>
>
and I can even 'get' the position of a tabbed window, but I can't 'set' it.
>
I get an error message that the window has to be a normal open window to
>
'set' its position. The folder tabs appear lined up to the left of the
>
screen by default, and I can slide them to the middle manually, but I can't
>
script them to appear in the middle.
>
>
>
Another thing I noticed is that if there are no windows open, I can't use
>
Applescript to check if a certain window is open without getting into some
>
infinite loop. In other words, this:
>
>
>
set x to container window of folder ...
>
set y to container windows -- gives {} if there are no open windows
>
if y contains x then ... -- script gets stuck in an infinite loop if y = {}
>
>
>
doesn't work if there are no Finder windows open.
>
>
However, if there is any Finder window open, it doesn't matter if it's the
>
one I'm checking for or any other, then the above code executes without
>
problem. So I had to build in an extra step to check for emptyness of the
>
list of open windows first, like this:
>
>
>
set x to container window of folder ...
>
set y to container windows
>
>
if y = {} then
>
>
-- do stuff without checking if there is anything contained in y
>
>
else
>
>
if y contains x then
>
>
-- do stuff
>
>
end if
>
>
end if
>
>
>
>
Any ideas what could be the cause of the infinite loop thing?
>
>
Thanks,
>
Jan Pieter Kunst.-
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users