forked from luismartingil/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiterm_launcher01.applescript
executable file
·57 lines (43 loc) · 1.21 KB
/
iterm_launcher01.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
#!/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.
--
--
tell application "iTerm"
set colorList to {"blue", "red", "yellow", "green", "blue"} as list
--activate
set myterm to (make new terminal)
tell myterm
repeat with colorItem in colorList
set Lsession to (make new session)
tell Lsession
set name to colorItem
set background color to colorItem
set transparency to "0.1"
--delay 0.5
end tell
end repeat
end tell
set mytermcount to count of terminal
repeat with i from 1 to mytermcount by 1
set myterm to (terminal i)
tell myterm
-- Count the number of sessions/tabs
-- open in this terminal window
set mytabcount to count of session
-- Open each session in turn
repeat with j from 1 to mytabcount by 1
set mysession to (session j)
-- If we find irssi, go to it
--tell mysession
-- write text "ls -lrt"
--end tell
end repeat
end tell
end repeat
end tell