This commit is contained in:
Michael Taboada 2020-12-16 11:45:33 -08:00
commit 6cf37c10d4
2 changed files with 36 additions and 0 deletions

36
mac-launcher.applescript Normal file
View File

@ -0,0 +1,36 @@
# Allows you to select a wine prefix to run with audiogame manager
#Get Working Directory
tell application "Finder"
set currentPath to container of (path to me) as alias
end tell
#format Converters
on convertPathToAlias(thePath)
tell application "System Events"
try
return (path of disk item (thePath as string)) as alias
on error
return (path of disk item (path of thePath) as string) as alias
end try
end tell
end convertPathToAlias
on convertPathToPOSIXString(thePath)
tell application "System Events"
try
set thePath to path of disk item (thePath as string)
on error
set thePath to path of thePath
end try
end tell
return POSIX path of thePath
end convertPathToPOSIXString
set currentPath to convertPathToPOSIXString(currentPath)
set folderPath to POSIX file "~/.local/wine/"
set folderPath to convertPathToAlias(folderPath)
set gameFolder to choose folder with prompt "Choose your game and press enter:" default location folderPath
set gameFolder to convertPathToPOSIXString(gameFolder)
set gameFolder to quoted form of gameFolder
set gameName to do shell script ("basename " & gameFolder)
do shell script "/usr/local/bin/bash -l " & currentPath & "audiogame-manager.sh -l " & gameName & " &> /dev/null &"
do shell script "say -v alex Launching " & gameName & ", please wait..."

Binary file not shown.