automator run console app

Please, help. I have two questions.


1) I have a dsd console application. So here. Through input in the terminal in any directory / or ~ / with the "dsd" command, the application starts. Also, for example, the ping application is launched. But here in the automator, when you enter "dsd", the directory for this application opens, but if you enter "ping", then the application "ping" starts. Why is that?


2) How to run the console application "dsd -i pa: 4 -o pa: 3 -fa" in the automator with the transfer of such parameters?





iMac 21.5", macOS 10.15

Posted on Mar 11, 2020 1:38 PM

Reply

Similar questions

6 replies

Mar 11, 2020 10:28 PM in response to Nick_Wanhalen

This is likely a $PATH issue - the shell can't find the dsd executable as indicated by the 'dsd: command not found' response.


For various reasons, the shell launched via Automator does not have the same environment variables as terminal.app so you need to be more explicit.


The solution is simple - add the full path to the executable so that the shell knows where to look. If you're not sure, just open Terminal.app and run:


which dsd


and it will return the full path which you can include in your Automator Action.

Mar 12, 2020 6:26 AM in response to BobHarris

Thanks! It turned out to be very simple. What I just did not do)

cd ~ / dsd / build
open dsd -i pa: 4


and


open dsd --args i = pa: 4


And so on.


As a result of the command that you prompted me to "/ what / ever / the / which / command / output / dsd -i pa: 4" the terminal window did not open. Had to create AppleScript


on run {input, parameters}

     tell application "Terminal"
         activate
         do script "/ what / ever / the / which / command / output / dsd -i pa: 4"
     end tell

     return input
end run


And the application now works with the open terminal as it should.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

automator run console app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.