Page 1 of 1
How to use Execute Command?
Posted: Tue Sep 13, 2016 4:31 pm
by TheCaptain
Another day, another part of Switch I know nothing about!
I have a Script saved down appropriately with the following :
#!/bin/bash
growlnotify -H 192.168.XXX.XX -t "Notice" -m "COMPLETE" -P password
Which runs perfectly if called in Terminal. But how do I get the Switch '
Exectue Command' to set it in motion? I'm failing hard on this one
Any pointers gratefully recieved
Name :
Description :
Execution mode :
Command or path :
Arguments :
Output :
Fail if exit code is :
Fail if stdout contains :
Fail if stderr contains :
Re: How to use Execute Command?
Posted: Tue Sep 20, 2016 11:51 am
by bens
How are you setting up the Execute command, and which error are you getting?
You may need to fix the path to the script, or point Execute command to bash with the script as parameter (I think it's the -c option for bash).
Re: How to use Execute Command?
Posted: Tue Sep 20, 2016 3:45 pm
by TheCaptain
I've had the below in the '
Command or path' section :
Code: Select all
/Users/Studio/Documents/Storage/050-HDD Add-on/Switch-SCRIPT/Notify
In the layout as here :

- Screen Shot 2016-09-20 at 14.39.43.png (24.01 KiB) Viewed 12251 times
But it doesn't trigger anything to run.
Re: How to use Execute Command?
Posted: Tue Sep 20, 2016 4:15 pm
by TheCaptain
Sometimes Switch throws up this error :
Message: Job failed because outcode is nonzero, outcode = [127]
Re: How to use Execute Command?
Posted: Wed Sep 21, 2016 12:48 pm
by loicaigon
If you don't care about the return code, you can choose t simply ignore it. Otherwise you can set the error code to be ≠ from 127 so this code deosn't raise an error.
Loic
Re: How to use Execute Command?
Posted: Wed Sep 21, 2016 4:34 pm
by TheCaptain
I've managed to ignore the error.
But not invoke the Script!

Re: How to use Execute Command?
Posted: Wed Sep 21, 2016 5:04 pm
by Chris De Clercq
Hi Captain,
Please check the following link:
http://qwephotos.com/2013/10/batch-enco ... -mac-os-x/
Probably adding the path where the application is located, this will resolve the problem.
Let us know if this was helpful!
Greetz
Chris De Clercq
Lab9 - Belgium
Re: How to use Execute Command?
Posted: Thu Sep 22, 2016 4:24 pm
by TheCaptain
Thanks for that link. Not entirely sure whether I've done exactly what your guide stated but here's how I found a '
solution'. This is FAR from elegant, and I'm hoping somebody picks it apart and explains why I've had to run one script, to then run another!
However, it does mean that I can use Switch to produce executable .TXT files with Variables on a whim without changing the original 'Action' Script.
The
Execute Command has been set up :
Name :
Description :
Execution mode : Concurrent
Command or path : /Users/Studio/Documents/Switch Storage/050-HDD Add-on/Switch-SCRIPT/NotifyV02
Arguments :
Output :
Fail If exit code is : Nonzero
Fail If stdout contains :
Fail If stderr contains :
The contents of
NotifyV02 :
Code: Select all
#!/bin/bash
cd /Users/Studio/Documents/Switch\ Storage/050-HDD\ Add-on/Switch-SCRIPT/
open Notify
The contents of
Notify :
Code: Select all
growlnotify -H 192.168.XXX.XX -t "Notice" -m "COMPLETE" -P password