Re: container window
Re: container window
- Subject: Re: container window
- From: kai <email@hidden>
- Date: Mon, 06 Oct 2003 01:34:10 +0100
on Wed, 01 Oct 2003 08:49:04 -0600, david <email@hidden> wrote:
>
Is there a way to set the container window position and size without opening
>
it first?
Not that I know of in OS 9, David. As Rob pointed out, it appears to be
possible in OS X - but the Finder in OS 9 seems to insist on having a
container window open before consenting to modify it.
>
I read that there is a folder window property, but can't seem to get at it.
>
>
Here's what I have working in os9 (I need to keep this one in 9).
>
>
--
>
set foldername to "jibberish"
>
if not (exists folder foldername of desktop) then
>
make folder at desktop with properties {name:foldername}
>
set preflightpath to (path to desktop as text) & foldername & ":" as alias
>
make folder at folder preflightpath with properties {name:"Customer"}
>
make folder at folder preflightpath with properties {name:"Working"}
>
else
>
display dialog "A folder by that name already exists." buttons {"Sorry"}
>
end if
>
>
--the following is the part I want to change--
>
>
open preflightpath
>
set view of container window 1 to name
>
set position of container window 1 to {711, 187}
>
close container window 1
>
open ((preflightpath as text) & "Working" & ":") as alias
>
set view of container window 1 to name
>
set position of container window 1 to {711, 187}
>
close container window 1
>
open ((preflightpath as text) & "Customer" & ":") as alias
>
set view of container window 1 to name
>
set position of container window 1 to {711, 187}
>
--
>
>
Any help would be appreciated.
If you just want to avoid showing the windows opening, you might consider a
workaround that involves hiding the Finder while it does its stuff.
(Obviously, if any other Finder windows happen to be open at the time,
they'll appear to close and reopen but, hey - this *is* a workaround.) I've
also suggested a few other minor modifications:
-------------------------------------------------------
(Any wrapped lines abutting the left edge of the window
should be reconnected to the end of the previous line)
-------------------------------------------------------
--=============================
set foldername to "jibberish"
tell application "Finder"
if exists folder foldername then display dialog "A folder by that
name already exists." buttons {"Cancel"} default button 1
set f to make folder at desktop with properties {name:foldername}
set l to f's container window as list
repeat with n in {"Customer", "Working"}
set l's end to (make folder at f with properties {name:n})'s
container window
end repeat
set visible to false
open l
repeat with w in l
set w's view to name
set w's position to {711, 187}
end repeat
close l
set visible to true
select f
end tell
--=============================
The last statement, 'select f', may not be necessary for you - but I found
it helps to refresh the screen OMM. (If you want to deselect the folder, use
'select' - without the 'f'. If you prefer to return to whatever was
previously selected, insert something like 'set s to selection' at the
beginning of the tell block, and amend the last statement to 'select s'.)
---
kai
_______________________________________________
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.