home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / Resource / Iconator < prev    next >
Encoding:
Text File  |  1999-03-04  |  876 b   |  35 lines  |  [TEXT/ToyS]

  1. on run
  2.     ShowAlert("Drop 1 item on this Applet to preserve its icon for future application.")
  3. end run
  4.  
  5.  
  6. on open fsObjs
  7.     if the number of items in fsObjs is 1 then
  8.         if AskUser("Do you wish to apply an icon to this item or save its icon for future application?", {"Save", "Apply"}) is "Save" then
  9.             set the icon of (path to me) to (the icon for (item 1 of fsObjs))
  10.             return
  11.         end if
  12.     end if
  13.     
  14.     -- Get our icon
  15.     set myIcon to (the icon for (path to me))
  16.     
  17.     repeat with fsObj in fsObjs
  18.         set the icon of fsObj to myIcon
  19.         tell application "Finder" to update fsObj
  20.     end repeat
  21. end open
  22.  
  23.  
  24. on ShowAlert(msgStr)
  25.     display dialog msgStr buttons {"Yo!"} ¬
  26.         default button 1 with icon stop
  27. end ShowAlert
  28.  
  29.  
  30. on AskUser(question, choices)
  31.     return button returned of ¬
  32.         (display dialog question buttons choices ¬
  33.             default button (number of items in choices) with icon note)
  34. end AskUser
  35.