[NTLUG:Discuss] nautilus script (was: Simple bash shell question)
. Daniel
xdesign at hotmail.com
Fri Mar 30 18:05:03 CDT 2007
>. Daniel wrote:
> > But when I'm ready, this will be a Nautilus script and anything that
> > currently references the likes of *.mpg will become something like "cat
> > $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" which shouldn't, in theory, break
> > bash's expansion buffer since there's no expansion going on.
>
>What you are trying to do sounds interesting. Can you explain a bit
>more? What is a Nautilus script? Can you give a bit more example of
>what you are trying to do?
>
>Regards,
>- Robert
Well here's an example of what I have already done:
----
#!/bin/sh
echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while read filename ; do
if [ -n "$filename" ]; then
# echo "~/bin/vid2bb.sh \"$filename\"" >> ~/.vid2bb.out
echo "~/bin/vid2bb.sh \"$filename\"" | sh
fi
done
----
I have another script that processes named files into other files with
similar derivative filenames. It's just a few lines of code that calls
mencode to re-encode video files to fit onto my blackberry pearl phone.
So when I want to process a batch of files, I do a multiple select of files
in Nautilus, right-click on them, go down to "scripts..." and select the
one I want to run. Nautilus passes variables to whatever it calls scripts
indicating a variety of things like URIs and stuff like that. One of them
is the one I indicated and it is in the form of pathlists separated by
carriage returns.
Ultimately, I want to merge all the scripts and have a progress dialog pop
up so I can see what it's doing and even cancel the activity.
_________________________________________________________________
ブロガー必見!かわいい鳥「キャロル」をあなたのブログで飼ってみませんか。
http://www.live-carol.jp/
More information about the Discuss
mailing list