-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathAppLauncher.applescript
executable file
·43 lines (34 loc) · 1.26 KB
/
AppLauncher.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(*
## Instructions:
Open Applications
1. Enter the name of the application you would like to launch.
2. Press "Go" or the enter button on your keyboard
3. Be amazed as your application probably launches
Close Applications
1. Enter "kill" and then the name of the application you would like to close.
- For example: "kill iTunes"
2. Press "Go" or the enter button on your keyboard
3. Be relieved as your application closes
If you opened the script by accident, you can close it by simply pressing the enter button on your keyboard.
*)
set applaunch to text returned of (display dialog "" default answer "" buttons {"Go"} default button "Go")
if applaunch contains "kill" then
set originString to applaunch
set {TID, text item delimiters} to {text item delimiters, {"kill "}}
set resultString to text item 2 of originString
set text item delimiters to TID
set killapp to resultString
tell application killapp
quit
end tell
else if applaunch contains "" then
error number -128
else if applaunch contains applaunch then
tell application applaunch
activate
end tell
end if
end
--- This script should be bound to a key combo for max usefulness
--- i use Control + Space because it is similar to Alfred and Spolight key combos
--- http://www.github.com/unforswearing