PageRenderTime 47ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

AppleScript | 28 lines | 16 code | 6 blank | 6 comment | 4 complexity | 50670891aa86a6168e1c7881e3d62139 MD5 | raw file
Possible License(s): LGPL-2.1
  1. -- First, convert the disk image to "read-write" format with Disk Utility or hdiutil
  2. -- Mount the image, open the disk image window in the Finder and make it frontmost, then run this script from inside Script Editor
  3. -- After running the script, unmount the disk image, re-mount it, and copy the .DS_Store file off from the command line.
  4. tell application "Finder"
  5. set foo to every item in front window
  6. repeat with i in foo
  7. if the name of i is "Applications" then
  8. set the position of i to {391, 165}
  9. else if the name of i ends with ".app" then
  10. set the position of i to {121, 166}
  11. end if
  12. end repeat
  13. -- There doesn't seem to be a way to set the background picture with applescript, but all the saved .DS_Store files should already have that set correctly.
  14. set foo to front window
  15. set current view of foo to icon view
  16. set toolbar visible of foo to false
  17. set statusbar visible of foo to false
  18. set the bounds of foo to {100, 100, 600, 449}
  19. -- set the position of front window to {100, 100}
  20. -- get {name, position} of every item of front window
  21. get properties of front window
  22. end tell