diff --git a/mac-launcher.applescript b/mac-launcher.applescript new file mode 100644 index 0000000..e8573a9 --- /dev/null +++ b/mac-launcher.applescript @@ -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..." \ No newline at end of file diff --git a/mac-launcher.scpt b/mac-launcher.scpt deleted file mode 100644 index d8030ca..0000000 Binary files a/mac-launcher.scpt and /dev/null differ