Skip to content

Instantly share code, notes, and snippets.

@cantpitch
Created November 28, 2022 05:23
Show Gist options
  • Save cantpitch/7b604420ea1e81b47613b434f604247a to your computer and use it in GitHub Desktop.
Save cantpitch/7b604420ea1e81b47613b434f604247a to your computer and use it in GitHub Desktop.
An AppleScript for running a Wine application as a macOS application. Save as an Application in "Script Editor"
on run
set toRun to "$HOME/.wine/drive_c/Program Files/SpritePad v2b1/SpritePad.exe"
set winePrefix to "$HOME/.wine"
set wineLocation to "/usr/local/bin"
set dyldFallbackLibraryPath to "/opt/X11/lib"
set freetypefix to "truetype:interpreter-version=35"
set toRunPath to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; echo \"${TEMPVAR%/*}\""
set toRunFile to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; TEMPVAR2=\"" & toRunPath & "\"; echo \"${TEMPVAR#$TEMPVAR2/}\""
do shell script "PATH=\"" & wineLocation & ":$PATH\"; export WINEPREFIX=\"" & winePrefix & "\"; export DYLD_FALLBACK_LIBRARY_PATH=\"" & dyldFallbackLibraryPath & "\"; export FREETYPE_PROPERTIES=\"" & freetypefix & "\"; cd \"" & toRunPath & "\"; wine \"" & toRunFile & "\" > /dev/null 2>&1 &"
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment