Re: [gedit-list] save current file



At 17:29 -0500 12/24/08, John Kitzmiller wrote:

For an External Tool, how to save/overwrite the current file with same
name before running command on it?

e.g. (You may have seen this before...):

#!/bin/sh
---> what goes in here to save current file? <---
mpost "$GEDIT_CURRENT_DOCUMENT_NAME"

The result I seek is what happens with the LaTeX plugin: when a .tex
file is modified, it is saved prior to processing.

It is possible to select "current document" to be sent to the tool using the edit tools option at the bottom of the tools window but you can get the same result with appropriate comment lines in the tool itself right under the #! line.

Have a look at a tool in $HOME/,genome2/gedit/tools/ to see the format.

For a really big document that might be painful but you should be able to read standard in and just rewrite $GEDIT_CURRENT_DOCUMENT_NAME.

But using the path variable would remove the possibility that your tool is using the wrong directory - did it read a shell startup script for you?


--

--> A fair tax is one that you pay but I don't <--


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]