Share Pastebin
Guest
Public paste!

brandizzi

By: a guest | Nov 22nd, 2009 | Syntax: Bash | Size: 0.54 KB | Hits: 109 | Expires: Never
Copy text to clipboard
  1. #!/bin/sh
  2. title=Conversor
  3. for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
  4. do
  5.         size=$(zenity --entry --title="$title" --text='Size:')
  6.         if [ -z "$size" ]
  7.         then
  8.                 return
  9.         fi
  10.         converted=$(zenity --entry --title="$title" --text='Output file:')
  11.         if [ -z "$converted" ]
  12.         then
  13.                 return
  14.         fi
  15.         convert -resize "$size" "$file" "$converted"
  16.         if [ "$?" == "0" ]
  17.         then
  18.                 zenity --info --title="$title" --text="$file converted to $converted!"
  19.         else
  20.                 zenity --error --title="$title" --text="The $file conversion to $converted failed!"
  21.         fi
  22. done