Well, for one I suspect you're doing it wrong
What's your rationale for driving Terminal.app to do this simple task (launch an application) vs. some of the other Automator actions such as Execute New UNIX Task, or even just Run Shell Script. Both of these can run without needing Terminal.app
If you insist on using Terminal, I suspect your problem has something to do with paths - if wine isn't in the standard system directories (e.g. /bin, /sbin, /usr/bin, etc.) then the OS won't find it unless you use the full path to the wine executable (e.g. /usr/local/wine, /opt/wine, or wherever you've installed it on your machine).
Thank you I will try this.
My rational is that when one drags and drops a file onto an application, that application tries to open it. I can get the drag and drop action to copy the files location and turn it into an argument. Just no clue and how to insert it into "wine (Argument goes here)" just as if I typed wine /Users/Nicks/Desktop/putty.exe
Then that would run putty.exe on my mac using wine.
Here is what ive got
tell application "Terminal"
do script "/opt/local/bin/wine"
This runs nicely. Ok so now how to I get the output from the last action to insert into this. This is an applescript.
I want it to look like
tell application "Terminal"
do script "/opt/local/bin/wine /Users/Nicks/Desktop/putty.exe"
I still think you're on a losing track by using Terminal.app.
Recreate your workflow as an application (Automator applications accept files drag/dropped on the app icon). In the workflow add the 'Run Shell Script' action with the script:
That should do what you need (error handling notwithstanding (e.g. you drop a directory or non .exe file on the app)
Wait...if I run any exe from the desktop it works...anywhere else it fails...
So I have all exe files set to open with that application. Everything from the desktop works. I dun get it.!?!?!
Ok so problem solved. Anything with a space in it will not work because the shell wont except them without \\. I had a folder called Windows Applications.
Any Idea on how to bypass the space issue without doing Windows\\ Applications
The "..." will protect the white space, but still allow $variable subsitutions.
The $@ will substitute all the files you drag as a group to your Automator app.
The notation "$@" does the substitution with each file properly quoted to protect the white space in the file path, but provide each file as its own quoted argument to the 'wine' command line.
If you need to invoke 'wine' once for each file of a group of files you drag on to your automator app, then use
for f in "$@" do /opt/local/bin/wine "$f" done
This will loop through each file of a group of files you drag onto your automator app, and invoke 'wine' once for each file in the group.
It works, it gives an error at the end of each run saying automator didnt run properly but everything works.
/opt/local/bin/wine "$@" which did work without errors but when i tried putty.exe (An ssh client) it said could not connect to host ~/Desktop. Which is just a strange error if you ask me. Especially if Its a startup error for the program. Dont know what thats about but Thank you for all the help I can deal with an error at the end of each run.
YOU SIR ARE A GENIOUS