git clone git://gist.github.com/4012751.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/AutomaticClosePurchaseDialog
Created
November 4, 2012 17:48
-
-
Save hanachin/4012751 to your computer and use it in GitHub Desktop.
Sublime Text 2 Plugin AutomaticClosePurchaseDialog (works only osx)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import subprocess, os | |
class AutomaticClosePurchaseDialog(sublime_plugin.EventListener): | |
def on_post_save(self, edit): | |
close_purchase_path = os.path.join( | |
sublime.packages_path(), | |
'AutomaticClosePurchaseDialog', | |
'close_purchase.scpt' | |
) | |
subprocess.Popen(['osascript', os.path.abspath(close_purchase_path)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
tell process "Sublime Text 2" | |
if exists button "Purchase" of window 1 then | |
click button "Cancel" of window 1 | |
end if | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment