-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_sessions_code
More file actions
74 lines (62 loc) · 2.15 KB
/
start_sessions_code
File metadata and controls
74 lines (62 loc) · 2.15 KB
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
on run argv
tell application "iTerm"
activate
set myterm to (make new terminal)
tell the first terminal
launch session "Default Session"
tell the last session
write text "cd " & item 1 of argv
write text ". bin/activate"
write text "cd src/doula"
write text "pserve development.ini"
end tell
end tell
tell the first terminal
launch session "Default Session"
tell the last session
write text "cd " & item 1 of argv
write text ". bin/activate"
write text "cd src/bambino"
write text "pserve development.ini"
end tell
end tell
tell the first terminal
launch session "Default Session"
tell the last session
write text "cd " & item 1 of argv
write text ". bin/activate"
write text "cd src/doula"
write text "retools-worker main"
end tell
end tell
end tell
tell application "Google Chrome"
activate
set theUrl to "http://localhost:6543"
if (count every window) = 0 then
make new window
end if
set found to false
set theTabIndex to -1
repeat with theWindow in every window
set theTabIndex to 0
repeat with theTab in every tab of theWindow
set theTabIndex to theTabIndex + 1
if theTab's URL = theUrl then
set found to true
exit repeat
end if
end repeat
if found then
exit repeat
end if
end repeat
if found then
tell theTab to reload
set theWindow's active tab index to theTabIndex
set index of theWindow to 1
else
tell window 1 to make new tab with properties {URL:theUrl}
end if
end tell
end run