Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c10f686

Browse files
committed
[[ DMG ]] Tweak DMG script position icons
1 parent 9abfa46 commit c10f686

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

tools/make-dmg-pretty.applescript

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ on run argv
3838
-- AppleScript seems to treat "." directories as neither files nor folders so the shell is needed here
3939
do shell script "cp " & quoted form of POSIX path of backgroundImage & " " & quoted form of (diskPath & "/.background/bg.tiff")
4040

41+
-- Configure the Finder window's appearance
42+
set the current view of container window to icon view
43+
set toolbar visible of container window to false
44+
set statusbar visible of container window to false
45+
set the bounds of container window to {100, 100, 646, 493}
46+
set viewOptions to the icon view options of container window
47+
set arrangement of viewOptions to not arranged
48+
set icon size of viewOptions to 128
49+
set text size of viewOptions to 14
50+
set background picture of viewOptions to file "bg.tiff" of item ".background"
51+
4152
-- Set the position of the icons
4253
set fileList to every item of it
4354
repeat with i in fileList
@@ -46,23 +57,14 @@ on run argv
4657
set the position of i to {410, 177}
4758
else if the name of i ends with ".app" then
4859
set the position of i to {137, 191}
60+
else
61+
set the position of i to {700, 700}
4962
end if
5063
end repeat
5164

5265
-- Close and re-open the window to force refresh
53-
close
54-
open
55-
56-
-- Configure the Finder window's appearance
57-
set the current view of container window to icon view
58-
set toolbar visible of container window to false
59-
set statusbar visible of container window to false
60-
set the bounds of container window to {100, 100, 646, 493}
61-
set viewOptions to the icon view options of container window
62-
set arrangement of viewOptions to not arranged
63-
set icon size of viewOptions to 128
64-
set text size of viewOptions to 14
65-
set background picture of viewOptions to file "bg.tiff" of item ".background"
66+
--close
67+
--open
6668

6769
-- According to http://joemaller.com/659/setting-icon-position-and-window-size-on-disk-images/, Finder sometimes does not save the size and position of a window until it detects user interaction on either the window's resizing handle or its zoom button. Simulate two clicks on the zoom button to trigger the save.
6870
--set theWindow to container window

0 commit comments

Comments
 (0)