-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathiterm_launcher00.applescript
executable file
·87 lines (72 loc) · 2.76 KB
/
iterm_launcher00.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/osascript
-- luismartingil 2013
-- Applescript to launch an specific terminal configuration
-- Run from terminal with `osascript` or just ./<<script>>
-- Dont unfocus with the mouse/keyboard while executing. the script.
--
--
-- Update. Check iterm_launcher02.applescript for a clean and DRY way of doing this.
--
--
launch "iTerm"
tell application "iTerm"
activate
-- make a new terminal
set myterm to (make new terminal)
tell myterm
set number of columns to 140
set number of rows to 80
--set theMessages to {"red", "blue", "yellow"}
repeat with n from 1 to 3
set sessionList to {}
-- launch a default shell in a new tab in the same terminal
launch session n
tell i term application "System Events" to key code 30 using command down
-- zoom out
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "d" using command down
-- zoom out
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "D" using command down
-- zoom out
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "d" using command down
-- zoom out
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "-" using command down
tell i term application "System Events" to keystroke "52" using command down
tell first item of sessions
set name to "name1"
set background color to "blue"
set transparency to "0.1"
write text "ls -lrt"
end tell
tell second item of sessions
set name to "name2"
set background color to "blue"
set transparency to "0.1"
write text "ls -lrt"
end tell
tell third item of sessions
set name to "name3"
set background color to "blue"
set transparency to "0.1"
write text "ls -lrt"
end tell
tell fourth item of sessions
set name to "name4"
set background color to "blue"
set transparency to "0.1"
write text "ls -lrt"
end tell
return sessionList
end repeat
end tell
end tell