update credits
[librepilot.git] / package / osx / create-dmg / support / template.applescript
blob2a7f2aa0b6c384ee8e982ab62ff5f77e35a41676
1 on run (volumeName)
2 tell application "Finder"
3 tell disk (volumeName as string)
4 open
6 set theXOrigin to WINX
7 set theYOrigin to WINY
8 set theWidth to WINW
9 set theHeight to WINH
11 set theBottomRightX to (theXOrigin + theWidth)
12 set theBottomRightY to (theYOrigin + theHeight)
13 set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""
15 tell container window
16 set current view to icon view
17 set toolbar visible to false
18 set statusbar visible to false
19 set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
20 set statusbar visible to false
21 REPOSITION_HIDDEN_FILES_CLAUSE
22 end tell
24 set opts to the icon view options of container window
25 tell opts
26 set icon size to ICON_SIZE
27 set text size to TEXT_SIZE
28 set arrangement to not arranged
29 end tell
30 BACKGROUND_CLAUSE
32 -- Positioning
33 POSITION_CLAUSE
35 -- Hiding
36 HIDING_CLAUSE
38 -- Application Link Clause
39 APPLICATION_CLAUSE
40 close
41 open
43 update without registering applications
44 -- Force saving of the size
45 delay 1
47 tell container window
48 set statusbar visible to false
49 set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
50 end tell
52 update without registering applications
53 end tell
55 delay 1
57 tell disk (volumeName as string)
58 tell container window
59 set statusbar visible to false
60 set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
61 end tell
63 update without registering applications
64 end tell
66 --give the finder some time to write the .DS_Store file
67 delay 3
69 set waitTime to 0
70 set ejectMe to false
71 repeat while ejectMe is false
72 delay 1
73 set waitTime to waitTime + 1
75 if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true
76 end repeat
77 log "waited " & waitTime & " seconds for .DS_STORE to be created."
78 end tell
79 end run