Nautilus Script - pyrenamer in current dir

Asked by 222fbj

I'm trying to create a Nautilus script to open pyrenamer in the current dir (via right click menu).
The following does not work... any suggestions? thanks

#!/bin/bash
exec pyrenamer -r $NAUTILUS_SCRIPT_CURRENT_URI

Question information

Language:
English Edit question
Status:
Solved
For:
pyRenamer Edit question
Assignee:
No assignee Edit question
Solved by:
222fbj
Solved:
Last query:
Last reply:
Revision history for this message
222fbj (222fbj) said :
#1

Solution:

#!/usr/bin/env bash
pyrenamer -r ./

this came from Tony http://tonyagudo.net/ who has some Nautilus scripts at gnome-look.org -> http://xrl.in/1e5z

Revision history for this message
zajc (jesenice) said :
#2

#!/bin/bash

#Open pyrenamer with the currentdir of nautilus as workdir.
#Don't need to select any file in the currentdir.
##########################################################################
# Nautilus "pyRenamer" Script #
##########################################################################
if [ "$1" = "" ];then
wdir=${NAUTILUS_SCRIPT_CURRENT_URI#file://}
wdir=${wdir//%20/ }
else
filetype=$(file "$1")
filetype=${filetype##*: }

if [ "$filetype" = "directory" ];then
wdir=${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS%%$1*}
wdir=$wdir$1
else
wdir=${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS%%$1*}
fi
fi
pyrenamer "$wdir"