I want to make an Automator plug-in to hide/unhide a single Finder item. atm i have two plug-ins which are shown below.

how would i change the shell script to have just one plug-in? im thinking this loop
if "hidden"
do chflags hidden "$@"
else
do chflags nohidden "$@"
would do the job but im not too sure on how to do shell script loops.


how would i change the shell script to have just one plug-in? im thinking this loop
if "hidden"
do chflags hidden "$@"
else
do chflags nohidden "$@"
would do the job but im not too sure on how to do shell script loops.