Re: creating a dmg
Re: creating a dmg
- Subject: Re: creating a dmg
- From: Richard Mayer <email@hidden>
- Date: Thu, 03 May 2007 11:10:56 +0200
hi stevan,
thanks for the tips, but yes i've already got that far. the script that
i'm using basically works (the .dmg is already created and mounted from
a shell script, before calling AS):
on run {volName , appName }
tell application "Finder"
activate
make new Finder window to disk volName
set win to window volName
-- position window at x, y, size w*h
set x to 10
set y to 50
set w to 564
set h to 365
set toolbar visible of win to false -- disable toolbar before
setting window pos!!
set bounds of win to {x, y, x + w, y + h}
-- set layout
set current view of win to icon view
set p to icon view options of win
set icon size of p to 70
set arrangement of p to not arranged
set label position of p to bottom
set position of item 1 of win to {290, 170}
set position of item 2 of win to {460, 170}
set background picture of p to (item ".background.jpg" of disk
volName)
-- set app name
set name of application file "Application.app" of disk volName
to AppName & ".app"
end tell
set result to volName & "_" & AppName
return result
end run
The problem is that the window postion doesn't get saved (the layout is
otherwise fine), unless I manually click the window before it's closed
again from the shell script.
I've tried stuff like;
tell application "System Events" to click grow area 1 of window volName
of process "Finder"
but no trifle.
Anyone any ideas? I'm sure I can't be the only person to come up agaist
this problem?
Cheers,
Rich
Reese, Stevan schrieb:
Do you know how to get the dmg you want using hdiutil? http://www.osxfaq.com/tips/unix-tricks/week104/friday.ws
Are you know how to use " do shell script "? http://developer.apple.com/technotes/tn2002/tn2065.html
Once you have your terminal commands figured out, you can then make an AppleScript that repeats thru the folders sending the appropriate commands to the terminal.
I hope this is helpful...
stevan
On 05/02/07 8:58 AM, "Richard Mayer" <email@hidden> wrote:
hello,
has anybody got a working solution please, for creating a .dmg and (most
poignantly) setting it's layout, via AS/hdiutil?
my problem, as i hope many of you know is that the .dmg fails to
remember it's position without some sort of physical user interaction
(which isn't a option for me). i've read various suggestions based
around simulating a user click, but I haven't managed to get any to work
for me. it "looks like" they work until you try and create a .dmg with a
different volume name. there's some wierd voodoo going on that i don't
understand.
i need to create 200+ dmg's (same basic layout, just different
file/volume names) so need a fully scriptable solution, which can be
left to run overnight with no human interaction. the script itself only
creates 1 dmg, from a specified folder, another app is preparing the
folder/files and calling the script. what i've got would work, if only
the window position would get saved!!!
cheers,
rich
_______________________________________________
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