Skip to content

Commit 53c343d

Browse files
Leitetclaude
andcommitted
patch: extract DMG layout AppleScript to tools/ (heredoc ≠ YAML)
The inline `osascript <<APPLESCRIPT` heredoc in the previous commit broke YAML parsing — the end-marker has to live at column 0 for bash to recognise it, but that falls below the block-scalar indent and closes the `run:` block early. Workflow failed at load time in 0 s. Move the AppleScript to `tools/dmg-layout.applescript` and invoke it with the volume name as an argument. Same behaviour, no YAML grief. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 8b30774 commit 53c343d

2 files changed

Lines changed: 40 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -280,28 +280,9 @@ jobs:
280280
mkdir "$MOUNT/.background"
281281
cp Resources/dmg-background.png "$MOUNT/.background/background.png"
282282
283-
# 3. Finder layout — 640×400 window, icons at positions that
284-
# frame the background arrow.
285-
osascript <<APPLESCRIPT
286-
tell application "Finder"
287-
tell disk "$VOL_NAME"
288-
open
289-
set current view of container window to icon view
290-
set toolbar visible of container window to false
291-
set statusbar visible of container window to false
292-
set the bounds of container window to {400, 150, 1040, 550}
293-
set viewOptions to the icon view options of container window
294-
set arrangement of viewOptions to not arranged
295-
set icon size of viewOptions to 128
296-
set background picture of viewOptions to file ".background:background.png"
297-
set position of item "Arc Transcriber.app" of container window to {128, 260}
298-
set position of item "Applications" of container window to {388, 260}
299-
update without registering applications
300-
delay 1
301-
close
302-
end tell
303-
end tell
304-
APPLESCRIPT
283+
# 3. Finder layout — script lives in tools/ so the YAML
284+
# block doesn't have to deal with heredoc indentation.
285+
osascript tools/dmg-layout.applescript "$VOL_NAME"
305286
306287
# Flush and unmount
307288
sync

tools/dmg-layout.applescript

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
-- Sourceful Arc Transcriber DMG installer-window layout.
2+
--
3+
-- Called from `.github/workflows/release.yml` during the "Package .dmg"
4+
-- step, with the volume name passed as an argument. Finder writes the
5+
-- layout it applies here into the volume's .DS_Store, so any user who
6+
-- mounts the published DMG sees the same window.
7+
--
8+
-- The arrow in the background image runs horizontally between the two
9+
-- icon slots; icon positions below are aligned to the arrow endpoints
10+
-- (app on the left at 128,260; Applications symlink on the right at
11+
-- 388,260 inside a 640×400 window).
12+
13+
on run argv
14+
set volName to item 1 of argv
15+
16+
tell application "Finder"
17+
tell disk volName
18+
open
19+
set current view of container window to icon view
20+
set toolbar visible of container window to false
21+
set statusbar visible of container window to false
22+
set the bounds of container window to {400, 150, 1040, 550}
23+
24+
set viewOptions to the icon view options of container window
25+
set arrangement of viewOptions to not arranged
26+
set icon size of viewOptions to 128
27+
set background picture of viewOptions to file ".background:background.png"
28+
29+
set position of item "Arc Transcriber.app" of container window to {128, 260}
30+
set position of item "Applications" of container window to {388, 260}
31+
32+
update without registering applications
33+
delay 1
34+
close
35+
end tell
36+
end tell
37+
end run

0 commit comments

Comments
 (0)