[TxMt] Default "Save As..." filename...

Hans-Jörg Bibiko bibiko at eva.mpg.de
Fri Oct 26 16:32:22 UTC 2007


On 26.10.2007, at 17:04, Hans-Jörg Bibiko wrote:
>
> On 26.10.2007, at 16:33, Thomas Aylott wrote:
>> On Oct 26, 2007, at 10:15 AM, Hans-Jörg Bibiko wrote:
>>> do saveWithFilename '{name=XXX;overwriteMode;}'
>>>
>>> without reopen it AND if the current document is unsaved AND the  
>>> current document is not a "untitled" document meaning it was  
>>> already saved before?
>>>
>>> Then it could be used like:
>>> "$TMTOOLS" do saveWithFilename '{name=$TM_FILEPATH;overwriteMode;}'
>>> <further code>
>>>
>> Yeah, that sounds great.
>> I guess I'd need to throw some logic in there for allowing them to  
>> saveas if it is untitled.
>> What's the best way to do that?
>> 	Or could you work that in there too? ;)
>
> "$TMTOOLS" do saveCurrentDocument
> This command is the same command like APPLE+S. Fine, but if the  
> document is 'untitled' then this command would invoke the  
> NSSavePanel and TM will freeze.
>
> To avoid this one could do to the following:
> RETURN=$("$TMTOOLS" do saveCurrentDocument '{avoidPanel;}')
> This would mean that if the current document is an 'untitled'  
> document it will return '0' without showing the save panel AND  
> without saving, otherwise it'll return '1'; and it is up to you  
> what do you want to do.

I just uploaded the new version supporting this. Please read the help  
for that!! ;)
TMTOOLS version 0.905
Download:
http://email.eva.mpg.de/~bibiko/downloads/textmate/TMTools.tmplugin.zip
Help:
http://email.eva.mpg.de/~bibiko/downloads/textmate/tmtoolshelp.html
or
"$TMTOOLS" help me

--Hans




More information about the textmate mailing list