set winepath to exe_path & "wine"
do script winepath
Hmm. I got somewhere then. I had to enclose the "do script" inside a "tell application "Terminal"", but I did get somewhere. Terminal opened and typed up:
~/.wine/drive_c/Program\\ Files/7-Zip/7zFM.exewine
which means a command was spat out, around the wrong way, without a space in between.
Then I tried:
set winepath to "wine " & exe_path
tell application "Terminal"
do scriptwinepath
end tell
I got it to work, so thanks! You pointed me in the right direction! Pretty good guesswork! 😉
As for
All of which raises some questions. What exactly is the file called 'wine'? And why run it in Terminal? Is it an application which runs when double-clicked? - if so you could just open it in Applescript using Finder. Why go to the trouble of entering the path manually? It is not always in the same place?
Okay, 'wine' is a program that runs windows applications on mac. When you run 'wine path/to/exe/file.exe' in terminal, the exe will load on the mac. There is no GUI interface that I can find, so I decided to make a small, easy, one. (I like GUI better than command line. It is cleaner.)
I could also have made an AppleScript application that ran:
tell application 'Terminal'
do script "wine /Users/Ash/.wine/drive_c/Program\\ Files/example/file.exe"
end tell
to run individual applications, but that means a new script for each application.
The '~/.wine/drive_c' folder is equivalent to the emulated windows 'C:\' drive. More information on wine can be found at https://www.winehq.org/, and a simple way to get and compile it can be found at http://www.davidbaumgold.com/tutorials/wine-mac/.
Anyway, thanks, Roger Wilmut1. You were very helpful 🙂