Re: How do I get the Finder window layout correct?
Re: How do I get the Finder window layout correct?
- Subject: Re: How do I get the Finder window layout correct?
- From: Wayne Linder <email@hidden>
- Date: Wed, 14 Jun 2006 10:43:37 -0600
- Thread-topic: How do I get the Finder window layout correct?
Title: Re: How do I get the Finder window layout correct?
Yep, you found the same Finder bug we did. It doesn't seem to want to save the settings unless you click the grow box or sizing widget. Here is what we did to get around it:
-- Create the window as the final user sees it
on mkWindow()
msg("Set up Finder window for user to see")
tell application "Finder"
close every window
reveal "Solutions:REV Installer.mpkg"
set current view of window 1 to icon view
set icon size of icon view options of window 1 to 128
set toolbar visible of window 1 to false
set statusbar visible of window 1 to false
set background picture of icon view options of window 1 to file "Solutions:InstallBKG.jpg"
set these_files to every item of window 1
repeat with i from 1 to the count of these_files
set position of (item i of these_files as alias) to {86, 151}
end repeat
set position of package 1 of window 1 to {341, 139}
set the extension hidden of file "REV Installer.mpkg" of window 1 to true
set bounds of window 1 to {425, 215, 874, 474}
-- this poop is to fix a Finder bug. It wont record the size of the window without a mouseclick
set loop to true
activate
repeat while loop is true
display dialog "click grow box" giving up after 2
if button returned of result is "ok" then
set loop to false
else
delay 2
end if
end repeat
-- mark the main window to open up when mounted
do shell script "bless -openfolder /Volumes/Solutions"
close window 1
end tell
end mkWindow
And yes, I DO like AppleScript. Enjoy!
Wayne
> From: Mike Fischer <email@hidden>
> Date: Wed, 14 Jun 2006 18:23:46 +0200
> To: Wayne Linder <email@hidden>
> Cc: Installer-DEV ML <email@hidden>
> Subject: Re: How do I get the Finder window layout correct?
>
> Hi Wayne!
>
> Am 14.06.2006 um 17:04 schrieb Wayne Linder:
>
>> The way I do it is to create a disk image first, copy all the
>> components to
>> that image and then lay out all of the stuff - installer package,
>> documentation folders, background image, icon size, position, etc.
>> and then
>> eject the disk image. When remounted, you should be all set,
>> including the
>> .DS_Store which makes the magic happen.
>
> Thanks for this hint. I tried it and it works somewhat better than
> what I had before.
>
> Now some of the layout options are honored whan mounting the disk
> image. The window size and the fact that I want icon view are ignored
> though. I get a window without sidebar or toolbar in list view (my
> default) at the size of another open Finder window (much too large
> for the installer). I want a small(er) window without any tool- ar
> sidebar in icon view.
>
> So this is a good first step it seems.
>
> BTW: I'm creating all of this from a shell script which calls an
> AppleScript to set the Finder options.
>
> It basically does this:
>
> PKGNAME="MYPACKAGE"
> cd ... # my base directory
> hdiutil create -ov -format UDRW -srcfolder "." -volname "$PKGNAME" -
> attach "../${PKGNAME}_rw.dmg"
> osascript "../../../srcroot/Tools/SetFinderWindow_${PKGNAME}_DI.scpt"
> hdiutil detach "/Volumes/$PKGNAME"
> hdiutil convert "../${PKGNAME}_rw.dmg" -ov -format UDCO -o "../
> $PKGNAME.dmg"
>
> The AppleScript creates a new Finder window, sets its target to the
> mounted disk image volume then tells it to set a number of attributes
> of the window:
> tell application "Finder"
> set f to disk "MYPACKAGE"
> set w to make new Finder window
> tell w
> set target to f
> set current view to icon view
> set statusbar visible to false
> set sidebar width to 0
> set toolbar visible to false
> set position to {100, 100}
> set bounds to {100, 100, 100 + 290, 100 + 105}
> end tell
> -- Now position the items on the volume at specific positions.
> -- - Code ommitted because it's probably irrelevant to my question.
>
> -- But these don't seem to have any effect at all:
> update every item of f
> update f
> end tell
>
>
> Mike
> --
> Mike Fischer Softwareentwicklung, EDV-Beratung
> Schulung, Vertrieb
> Address: Bundesstrasse 9, D-20146 Hamburg, Germany
> Phone: +49 (0)40/45038886, Fax: +49 (0)40/45038887
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden