#!/bin/bash ## Anime Studio file information nautilus script. ## version 0.0.6 (100205) ## Created by David Rylander, 2009, www.rylanderanimation.se ## Creative Commons Attribution-Share Alike 3.0 licenced (http://creativecommons.org/licenses/by-sa/3.0/) ## Dependencies of this script; zenity. ##### Variables ##### mypath="`pwd`" #get current path. for filename in "$@" do startframe=$(grep frame_range "$mypath/$filename" | cut -d ' ' -f 2) endframe=$(grep frame_range "$mypath/$filename" | cut -d ' ' -f 3) filelength=`echo "($endframe - $startframe) + 1" | bc -l` fps=$(grep -m 1 fps "$mypath/$filename" | cut -d ' ' -f 2) soundtrack=$(grep soundtrack "$mypath/$filename" | cut -d ' ' -f 2 | sed 's/"//g') width=$(grep dimensions "$mypath/$filename" | cut -d ' ' -f 2) height=$(grep dimensions "$mypath/$filename" | cut -d ' ' -f 3) creationdate=$(grep "### Created:" "$mypath/$filename" | cut -d ' ' -f 3,4,5,6,7,8) layertotal=$(grep "layer_type" "$mypath/$filename" -c) vectorlayers=$(grep "layer_type 1" "$mypath/$filename" -c) imagelayers=$(grep "layer_type 2" "$mypath/$filename" -c) grouplayers=$(grep "layer_type 3" "$mypath/$filename" -c) bonelayers=$(grep "layer_type 4" "$mypath/$filename" -c) switchlayers=$(grep "layer_type 5" "$mypath/$filename" -c) particlelayers=$(grep "layer_type 6" "$mypath/$filename" -c) notelayers=$(grep "layer_type 7" "$mypath/$filename" -c) tredelayers=$(grep "layer_type 8" "$mypath/$filename" -c) done zenity --info --title="AS-file info." --text "$filename \n\nLast Modified: $creationdate\n\nFile length: $filelength frames ($startframe - $endframe)\nDimensions: $width x $height\nFramerate: $fps \nSoundtrack: $soundtrack\n\nNumber of Layers: $layertotal;\nVector Layers: $vectorlayers\nImage Layers: $imagelayers\nGroup Layers: $grouplayers\nBone Layers: $bonelayers\nSwitch Layers: $switchlayers\nParticle Layers: $particlelayers\nNote Layers: $notelayers\n3D Layers: $tredelayers"