Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (70 sloc) 1.95 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveModifiedFiles</string>
<key>command</key>
<string>#!/bin/bash
if [[ ${#SKIN} &lt; 1 ]] ; then
SKIN="iPhone"
fi
if [[ ${#SDK_PATH} &gt; 0 ]] ; then
CORONA_SIM_PATH=$SDK_PATH"/Corona Terminal"
else
CORONA_SIM_PATH="/Applications/CoronaSDK/Corona Terminal"
fi
if [[ ${#TM_PROJECT_DIRECTORY} &gt; 0 ]] ; then
TARGET_DIR=$TM_PROJECT_DIRECTORY
else
TARGET_DIR=$TM_DIRECTORY
fi
# In order for the simulator relaunch to work, "Enable access for assistive devices" must be selected in System Preferences &gt; Universal Access.
osascript &lt;&lt;- 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
-- bring the target application to the front
tell application app_name
activate
end tell
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
on error error_message
return false
end try
end selectAppMenuItem
if appIsRunning("Corona Simulator") then
selectAppMenuItem("Corona Simulator","File","Relaunch")
else
tell application "Terminal"
do script "'$CORONA_SIM_PATH' -project $TM_PROJECT_DIRECTORY -skin $SKIN"
end tell
end if
APPLESCRIPT</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@r</string>
<key>name</key>
<string>Run Simulator</string>
<key>output</key>
<string>discard</string>
<key>scope</key>
<string>source.lua</string>
<key>uuid</key>
<string>1831E774-8AF9-4EF0-BE93-11B077CC4DC2</string>
</dict>
</plist>