From 4f82197528dd9560d88779f761ca74abfb6c6e96 Mon Sep 17 00:00:00 2001 From: Matthew Wellings Date: Wed, 20 Mar 2024 07:43:35 +0000 Subject: [PATCH] macOS GitHub Action now runs Apple Script to set appearance of the DMG in Finder. Also creates the Applications directory alias. --- .github/workflows/macos-build.yml | 1 + setupDMGAppearance.applescript | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 setupDMGAppearance.applescript diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 1e3d42c..eb55118 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -55,6 +55,7 @@ jobs: cp images/background.png WordSearchCreator-Staging/.background/ hdiutil create -volname "WordSearchCreator" -srcfolder WordSearchCreator-Staging -ov -format UDRW WordSearchCreator-RW.dmg hdiutil attach WordSearchCreator-RW.dmg + osascript setupDMGAppearance.applescript hdiutil detach /Volumes/WordSearchCreator/ hdiutil convert WordSearchCreator-RW.dmg -format UDZO -o WordSearchCreator.dmg diff --git a/setupDMGAppearance.applescript b/setupDMGAppearance.applescript new file mode 100644 index 0000000..a290d42 --- /dev/null +++ b/setupDMGAppearance.applescript @@ -0,0 +1,17 @@ +tell application "Finder" + tell disk "WordSearchCreator" + open + + set the bounds of container window to {100, 100, 650, 425} + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set arrangement of icon view options of container window to not arranged + set background picture of icon view options of container window to file ".background:background.png" + make new alias to POSIX file "/Applications" at POSIX file "/Volumes/WordSearchCreator/" + set position of item "Word Search Creator.app" of container window to {145, 180} + set position of item "Applications" of container window to {410, 180} + + close + end tell +end tell \ No newline at end of file