dsstore_setup.scpt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. on run argv
  2. set image_name to item 1 of argv
  3. tell application "Finder"
  4. tell disk image_name
  5. -- wait for the image to finish mounting
  6. set open_attempts to 0
  7. repeat while open_attempts < 4
  8. try
  9. open
  10. delay 1
  11. set open_attempts to 5
  12. close
  13. on error errStr number errorNumber
  14. set open_attempts to open_attempts + 1
  15. delay 10
  16. end try
  17. end repeat
  18. delay 5
  19. -- open the image the first time and save a DS_Store with just
  20. -- background and icon setup
  21. open
  22. set current view of container window to icon view
  23. set theViewOptions to the icon view options of container window
  24. set background picture of theViewOptions to file ".background:background.png"
  25. set arrangement of theViewOptions to not arranged
  26. set icon size of theViewOptions to 64
  27. delay 5
  28. close
  29. -- next setup the position of the app and Applications symlink
  30. -- plus hide all the window decoration
  31. open
  32. update without registering applications
  33. tell container window
  34. set sidebar width to 0
  35. set statusbar visible to false
  36. set toolbar visible to false
  37. set the bounds to { 400, 100, 975, 480 }
  38. set position of item "SuperTux.app" to { 140, 235 }
  39. set position of item "Applications" to { 440, 235 }
  40. end tell
  41. update without registering applications
  42. delay 5
  43. close
  44. -- one last open and close so you can see everything looks correct
  45. open
  46. delay 5
  47. close
  48. end tell
  49. delay 2
  50. end tell
  51. end run