brandizzi
By: a guest | Nov 22nd, 2009 | Syntax:
Bash | Size: 0.54 KB | Hits: 109 | Expires: Never
#!/bin/sh
title=Conversor
for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
size=$(zenity --entry --title="$title" --text='Size:')
if [ -z "$size" ]
then
return
fi
converted=$(zenity --entry --title="$title" --text='Output file:')
if [ -z "$converted" ]
then
return
fi
convert -resize "$size" "$file" "$converted"
if [ "$?" == "0" ]
then
zenity --info --title="$title" --text="$file converted to $converted!"
else
zenity --error --title="$title" --text="The $file conversion to $converted failed!"
fi
done