package.applescript 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. on run (volumeName)
  2. tell application "Finder"
  3. tell disk (volumeName as string)
  4. open
  5. set theXOrigin to 100
  6. set theYOrigin to 100
  7. set theWidth to 540
  8. set theHeight to 380
  9. set theBottomRightX to (theXOrigin + theWidth)
  10. set theBottomRightY to (theYOrigin + theHeight)
  11. set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""
  12. tell container window
  13. set current view to icon view
  14. set toolbar visible to false
  15. set statusbar visible to false
  16. set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
  17. set statusbar visible to false
  18. set position of every item to {theBottomRightX + 100, 100}
  19. end tell
  20. set opts to the icon view options of container window
  21. tell opts
  22. set icon size to 96
  23. set text size to 16
  24. set arrangement to not arranged
  25. end tell
  26. set background picture of opts to file ".background:background.tiff"
  27. set position of item "OBS.app" to {124, 180}
  28. set position of item "Applications" to {416, 180}
  29. close
  30. open
  31. -- Force saving of the size
  32. delay 1
  33. tell container window
  34. set statusbar visible to false
  35. set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
  36. end tell
  37. end tell
  38. delay 1
  39. tell disk (volumeName as string)
  40. tell container window
  41. set statusbar visible to false
  42. set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
  43. end tell
  44. end tell
  45. --give the finder some time to write the .DS_Store file
  46. delay 3
  47. set waitTime to 0
  48. set ejectMe to false
  49. repeat while ejectMe is false
  50. delay 1
  51. set waitTime to waitTime + 1
  52. if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true
  53. end repeat
  54. log " > Waited " & waitTime & " seconds for .DS_STORE to be created."
  55. tell disk (volumeName as string)
  56. close
  57. end tell
  58. end tell
  59. end run