sharesheet() {
    if [[ $# -eq 0 ]]; then
        if tty -s; then
            cat <<EOF
Usage: sharesheet [FILE]...
Present share sheet for files and directories. Alternatively you can pipe in text and call it without arguments.
If arguments exist inside the Finder or Files app changes made are written back to the server.
EOF
            return 0;
        fi;
    fi
    FIFO=$(ios_prepareResult);
    OUTPUT=$(awk 'BEGIN {printf "6;sharesheet://?ver=2&respond="}'
ios_printBase64Component "$FIFO"
awk 'BEGIN {printf "&pwd="}'
ios_printBase64Component "$PWD"
awk 'BEGIN {printf "&home="}'
ios_printBase64Component "$HOME"
for var in "$@";
do
    awk 'BEGIN {printf "&path="}'
ios_printBase64Component "$var";
done
if [[ $# -eq 0 ]]; then
    text=$(cat -)
awk 'BEGIN {printf "&text="}'
ios_printBase64Component "$text";
fi);
    ios_sequence "$OUTPUT";
    ios_handleResult "$FIFO"
}