Plugin: Save Copy As

Browse, download and discuss plugins for Blumentals code editors

Plugin: Save Copy As

Postby Aivars » Thu Feb 14, 2013 11:43 am

Saves copy of document without affecting the original. Use menu customization to move it under File menu.
Attachments
save copy as.zip
(526 Bytes) Downloaded 892 times
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Plugin: Save Copy As

Postby Aivars » Thu Feb 14, 2013 12:04 pm

Plugin code to use as an example:

Code: Select all
function SaveCopyAs(Sender) {
  var s = Editor.Text;
  var enc = Document.Encoding;
  Documents.NewDocument(ExtractFileExt(Document.FileName));
  Document.Encoding = enc;
  Editor.Text = s;
  Document.Save("");
  Document.Close(True);
}

Script.RegisterDocumentAction("", "Save Copy As", "", &SaveCopyAs);
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Plugin: Save Copy As

Postby FrankC » Fri May 31, 2013 9:29 pm

Nice, it further smooths the work flow. Thanks.
FrankC
 
Posts: 126
Joined: Thu Aug 18, 2011 3:28 pm

Re: Plugin: Save Copy As

Postby jhonmoral » Mon Nov 04, 2013 11:18 am

Use menu customization to move it under File menu.
.......Em Crazy..........
jhonmoral
 
Posts: 1
Joined: Mon Nov 04, 2013 10:33 am

Re: Plugin: Save Copy As

Postby pmk65 » Tue Apr 10, 2018 1:29 pm

Can be simplified by using the build in "Save As.." action, like this:

Code: Select all
function SaveCopyAs(Sender) {
    var fn = Document.FileName;
    Actions.Execute("ActFileSaveAs");
    Document.Filename = fn;
}


Then no extra documents needs to be created. ;)
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Plugin: Save Copy As

Postby Aivars » Tue Apr 10, 2018 9:36 pm

That might work, except with files opened from FTP.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to Plugins for HTMLPad / Rapid CSS / Rapid PHP / WeBuilder

Who is online

Users browsing this forum: No registered users and 2 guests

cron