-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject_workspace_two_windows
More file actions
executable file
·160 lines (125 loc) · 5.76 KB
/
project_workspace_two_windows
File metadata and controls
executable file
·160 lines (125 loc) · 5.76 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/osascript
on run argv
-- Parse branch name (default: greg)
set branchName to "greg"
if (count of argv) ≥ 1 then
set branchName to item 1 of argv
end if
tell application "Terminal"
-- Get random profiles for visual distinction
set allProfiles to name of every settings set
set serverProfileIndex to random number from 1 to count of allProfiles
set claudeProfileIndex to random number from 1 to count of allProfiles
set serverProfile to item serverProfileIndex of allProfiles
set claudeProfile to item claudeProfileIndex of allProfiles
-- ===================================
-- WINDOW 1: SERVERS (git + yarn)
-- ===================================
set defaultSettings to default settings
set default settings to settings set serverProfile
-- Create first server window with BUGS workspace
set bugsPath to "/Users/gregorywhiteside/Projects/.staff/BUGS"
-- Start with navigation only
set serverWindow to do script "cd " & quoted form of bugsPath
tell serverWindow
set custom title to "Servers"
end tell
delay 1
-- Then run git setup
do script "echo '=== Setting up BUGS workspace ===' && git stash && git checkout " & branchName & " 2>/dev/null || git checkout -b " & branchName & " && git pull" in serverWindow
delay 3
-- Update HTML title
do script "sed -i '' 's|<title>.*</title>|<title>bugs</title>|' index.html 2>/dev/null" in serverWindow
delay 1
-- Finally start server
do script "echo 'Starting server on port 8081...' && DEV_PORT=8081 yarn run start" in serverWindow
delay 3
-- Add MEDIUM tab
activate
delay 0.5
tell application "System Events"
tell process "Terminal"
keystroke "t" using command down
end tell
end tell
delay 2 -- Increased delay for tab to be ready
set mediumPath to "/Users/gregorywhiteside/Projects/.staff/MEDIUM"
-- First navigate to directory
do script "cd " & quoted form of mediumPath in selected tab of front window
delay 1
-- Then run git setup
do script "echo '=== Setting up MEDIUM workspace ===' && git stash && git checkout " & branchName & " 2>/dev/null || git checkout -b " & branchName & " && git pull" in selected tab of front window
delay 3
-- Update HTML title
do script "sed -i '' 's|<title>.*</title>|<title>medium</title>|' index.html 2>/dev/null" in selected tab of front window
delay 1
-- Finally start server
do script "echo 'Starting server on port 8082...' && DEV_PORT=8082 yarn run start" in selected tab of front window
delay 3
-- Add QUICK tab
activate
delay 0.5
tell application "System Events"
tell process "Terminal"
keystroke "t" using command down
end tell
end tell
delay 2 -- Increased delay for tab to be ready
set quickPath to "/Users/gregorywhiteside/Projects/.staff/QUICK"
-- First navigate to directory
do script "cd " & quoted form of quickPath in selected tab of front window
delay 1
-- Then run git setup
do script "echo '=== Setting up QUICK workspace ===' && git stash && git checkout " & branchName & " 2>/dev/null || git checkout -b " & branchName & " && git pull" in selected tab of front window
delay 3
-- Update HTML title
do script "sed -i '' 's|<title>.*</title>|<title>quick</title>|' index.html 2>/dev/null" in selected tab of front window
delay 1
-- Finally start server
do script "echo 'Starting server on port 8083...' && DEV_PORT=8083 yarn run start" in selected tab of front window
-- ===================================
-- WINDOW 2: CLAUDE AGENTS
-- ===================================
delay 3 -- Wait for servers to start initializing
set default settings to settings set claudeProfile
-- Create first Claude window with BUGS
set claudeBugsCommand to "cd " & quoted form of bugsPath & " && claude"
set claudeWindow to do script claudeBugsCommand
tell claudeWindow
set custom title to "Claude Agents"
end tell
delay 1
-- Add MEDIUM Claude tab
activate
tell application "System Events"
tell process "Terminal"
keystroke "t" using command down
end tell
end tell
delay 1
set claudeMediumCommand to "cd " & quoted form of mediumPath & " && claude"
do script claudeMediumCommand in selected tab of front window
delay 1
-- Add QUICK Claude tab
activate
tell application "System Events"
tell process "Terminal"
keystroke "t" using command down
end tell
end tell
delay 1
set claudeQuickCommand to "cd " & quoted form of quickPath & " && claude"
do script claudeQuickCommand in selected tab of front window
-- Restore default settings
set default settings to defaultSettings
-- Switch to first tab of Claude window
delay 0.5
activate
tell application "System Events"
tell process "Terminal"
keystroke "1" using command down
end tell
end tell
activate
end tell
end run