-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject_workspace_simple
More file actions
executable file
·64 lines (51 loc) · 2.14 KB
/
project_workspace_simple
File metadata and controls
executable file
·64 lines (51 loc) · 2.14 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
#!/usr/bin/osascript
on run argv
-- Default values
set projectPath to ""
set runCommand to "start" -- default: start, or preview, or startProd
set windowTitle to "Project Workspace"
-- Parse arguments
if (count of argv) ≥ 1 then
set projectPath to item 1 of argv
else
error "Usage: ./project_workspace_simple /path/to/project [start|preview|startProd] [window-title]"
end if
if (count of argv) ≥ 2 then
set runCommand to item 2 of argv
end if
if (count of argv) ≥ 3 then
set windowTitle to item 3 of argv
end if
-- Build commands
set yarnCommand to "yarn run " & runCommand
tell application "Terminal"
-- Get random profiles for each window
set allProfiles to name of every settings set
-- Random profile for Claude window
set randomIndex1 to random number from 1 to count of allProfiles
set profile1 to item randomIndex1 of allProfiles
-- Different random profile for Server window
set randomIndex2 to random number from 1 to count of allProfiles
set profile2 to item randomIndex2 of allProfiles
-- Window 1: Claude with random profile
set claudeCommand to "cd " & quoted form of projectPath & " && claude"
set defaultSettings to default settings
set default settings to settings set profile1
set claudeWindow to do script claudeCommand
tell claudeWindow
set custom title to windowTitle & " - Claude"
end tell
-- Window 2: Yarn server with different random profile
set serverCommand to "cd " & quoted form of projectPath & " && " & yarnCommand
set default settings to settings set profile2
set serverWindow to do script serverCommand
tell serverWindow
set custom title to windowTitle & " - Server"
end tell
-- Restore original default
set default settings to defaultSettings
-- Bring Claude window to front
set frontmost of window 1 to true
activate
end tell
end run