Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2012 12:43
Show Gist options
  • Save anonymous/3181819 to your computer and use it in GitHub Desktop.
Save anonymous/3181819 to your computer and use it in GitHub Desktop.
Run Gideros from within Vim.
" 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
#!/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