Created
July 26, 2012 12:43
-
-
Save anonymous/3181819 to your computer and use it in GitHub Desktop.
Run Gideros from within Vim.
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
" If the folder contains atleast one .gproj file. | |
if ! empty(glob('*.gproj')) | |
" Run Gideros by pressing <Up> key. | |
noremap <Up> :!bash ~/bin/run-gideros.sh <CR> | |
endif | |
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
#!/bin/bash | |
osascript <<- APPLESCRIPT | |
on appIsRunning(appName) | |
tell application "System Events" to (name of processes) contains appName | |
end appIsRunning | |
on selectAppMenuItem(app_name, menu_name, menu_item) | |
try | |
tell application "System Events" | |
tell process app_name | |
tell menu bar 1 | |
tell menu bar item menu_name | |
tell menu menu_name | |
click menu item menu_item | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
return true | |
end try | |
end selectAppMenuItem | |
if appIsRunning("Gideros Studio") then | |
tell application "Gideros Studio" to activate | |
tell application "System Events" | |
keystroke "r" using command down | |
end tell | |
tell application "Gideros Player" to activate | |
else | |
tell application "Gideros Player" to activate | |
tell application "Gideros Studio" to activate | |
tell application "System Events" | |
keystroke "o" using command down | |
end tell | |
end if | |
APPLESCRIPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment