You are here: PSPad forum > English discussion forum > Re: Restore last opened FTP files

Re: Restore last opened FTP files

#1 Restore last opened FTP files

Posted by: Andreas | Date: 2014-02-11 23:33 | IP: IP Logged

Hello,

is there a way, to make PSPad restore (open) the FTP files that were open before I closed PSPad?

I'm mostly working with files directly via FTP open and save (found no other editor, that does it that easy way like PSPad). Next day I like to continue my work but unfortunately have to search for the files I was working on.

Uncheck "Store for files from local drives only" and select "Save Work / Desktop" - "All opened files" will not work.

Options: Reply | Quote | Up ^


#2 Re: Restore last opened FTP files

Posted by: pspad | Date: 2014-02-12 06:53 | IP: IP Logged

I am sorry, save file/desktop doesn't allow to restore FTP session yet.
But you can easy write simple script and open all your files from FTP with one click.

const module_name = "FTPfiles" 'this name must be unique !!!
const module_ver = "0.001a" 'version

sub OpenFTPFile
ftpConnect("connection_name")
' file1
set obj = NewEditor()
ftpDownloadFile "/public_html/www/page/page1.php", "C:\Temp\page1.php"
obj.openFile("C:\Temp\page1.php")
' file2
set obj = NewEditor()
ftpDownloadFile "/public_html/www/page/page2.php", "C:\Temp\page2.php"
obj.openFile("C:\Temp\page2.php")
end sub

sub Init
addMenuItem "&Open file from FTP","", "OpenFTPFile"
end sub

Save code content as file with VBS extension into .\Script\VBScript subfolder
Modify connection name, path to your files or add another files to the script
From the Script menu you can now open all your files with one click

Options: Reply | Quote | Up ^


#3 Re: Restore last opened FTP files

Posted by: Andreas | Date: 2014-02-12 23:37 | IP: IP Logged

Hi Jan,

thanks for the quick and detailed reply.

I will try this. But files I'm working on changes dynamicaly. So I will additionaly try to write open ftp-files into this script on closing PSPad. Maybe there's a way to get this done. I don't know much about writing scripts for PSPad. I will reply on effort.

Andreas

Options: Reply | Quote | Up ^


#4 Re: Restore last opened FTP files

Posted by: pspad | Date: 2014-02-13 05:58 | IP: IP Logged

I will add possibility to connect project with FTP in the near future.

Options: Reply | Quote | Up ^


#5 Re: Restore last opened FTP files

Posted by: Andreas | Date: 2014-02-13 11:18 | IP: IP Logged

That would be great. Also great would be, to open (restore) last opened ftp files without working with projects.

Thank you

Options: Reply | Quote | Up ^


#6 Re: Restore last opened FTP files

Posted by: Andreas | Date: 2014-02-16 15:44 | IP: IP Logged

There's no editor attribute (property) that indicates an editor instance as an open ftp file. Am I right? So I'm not able to write open ftp files including their ftp connection and ftp path (starting from the path set in the connection) as an array into a file.

Don't know VBS so I tried with Javascript and can only find the attribute "fileName"


var module_name = 'test';
var module_ver = '0.001a';

function Init(){
addMenuItem('test', '', 'test', 'CTRL+ALT+V');
};

function test(){
logClear();
var tempEditor = newEditor();
for(i = 0; i < editorsCount(); i += 1){
tempEditor.assignEditorByIndex(i);
var filename = tempEditor.fileName();
logAddLine(filename);
}
};

ps The code property in this forum did not work.

Edited 1 time(s). Last edit at 2014-02-16 15:47 by Andreas.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR