Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set x to isAppLoaded("Python")
- if x then
- tell application "System Events"
- tell application process "Terminal"
- set frontmost to true
- keystroke "c" using control down
- end tell
- end tell
- tell application "Terminal" to quit
- else
- tell application "Terminal"
- do script "sh /PATH TO YOUR AAFMTRIGGERHELPER FILE/aafmtriggerhelper.sh"
- end tell
- tell application "System Events"
- tell application process "Terminal"
- set frontmost to true
- keystroke "h" using command down
- end tell
- end tell
- repeat
- tell application "System Events"
- if (exists (application process "Python")) then
- exit repeat
- end if
- end tell
- end repeat
- repeat
- tell application "System Events"
- if visible of process "Python" is false then
- set visible of process "Python" to true
- end if
- end tell
- tell application "System Events"
- if visible of process "Python" is true then
- exit repeat
- end if
- end tell
- end repeat
- repeat
- tell application "System Events"
- if application process "Python" is frontmost then
- exit repeat
- else
- tell application process "Python"
- set frontmost to true
- end tell
- end if
- end tell
- end repeat
- end if
- on isAppLoaded(app_name)
- tell application "System Events"
- set app_list to every application process whose name contains app_name
- if the (count of app_list) > 0 then
- return true
- else
- return false
- end if
- end tell
- end isAppLoaded
Advertisement
Add Comment
Please, Sign In to add comment