Posted By

dbug13 on 06/03/08


Tagged

textmate ruby


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

zegenvs
inkdeep
webstic


Displaying an alert box with TextMate's tm_dialog command


 / Published in: Ruby
 

  1. SUPPORT = ENV['TM_SUPPORT_PATH']
  2. DIALOG = ENV['DIALOG']
  3.  
  4. require SUPPORT + '/lib/escape'
  5. require SUPPORT + '/lib/osx/plist'
  6.  
  7. title = "My Alert"
  8. message = "This is my alert Box"
  9. buttons = ['OK', 'Close']
  10.  
  11. params = {
  12. 'alertStyle' => 'informational',
  13. 'messageTitle' => title,
  14. 'informativeText' => message,
  15. 'buttonTitles' => buttons
  16. }
  17.  
  18. opts = params.to_plist
  19.  
  20. puts `#{e_sh(DIALOG)} -ep #{e_sh(opts)}`

Report this snippet  

You need to login to post a comment.