When I create a new droplet application and ask to zip a file, Platypus won't execute the command.
In the following code, Platypus will create the concatenated file in XML, but won't execute the code after, to zip the XML and remove the 2 files File1.txt and File2.txt
It works perfectly when using Automator.
#! /bin/sh
for f in "$@"
do
NAME=$(basename -- "$f") ; NAME="${NAME%.*}" ; NAME=$( echo "$NAME" | sed 's/_/ /g');
# Concatenate File 1 & 2
cat "$HOME"/File1.txt "$HOME"/File2.txt > "$HOME"/"$NAME".xml
# Create swatchbook file
zip "$NAME".zip "$NAME".xml
rm -f File1.txt File2.txt "$NAME".xml
done
The default current working directory when script is launched is [AppName].app/Contents/Resources within the application bundle. You seem to be assuming it's the user's home folder.
When I create a new droplet application and ask to zip a file, Platypus won't execute the command.
In the following code, Platypus will create the concatenated file in XML, but won't execute the code after, to zip the XML and remove the 2 files File1.txt and File2.txt
It works perfectly when using Automator.