Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added helper script to allow editing FTP and archived files #13

Closed
webaschtl opened this issue Nov 17, 2016 · 7 comments
Closed

Added helper script to allow editing FTP and archived files #13

webaschtl opened this issue Nov 17, 2016 · 7 comments
Assignees

Comments

@webaschtl
Copy link

Hi,

a conntected a ftp drive in TC 8.52a, but after pressing F4 eg for a css file only the ftp download starts, but afterwards my assigned editor do not start, nothing happens.

On my local drive F4MiniMenu works (for the same files) perfect!

thanks!
webaschtl

@hi5
Copy link
Owner

hi5 commented Nov 18, 2016

Yes, that is indeed the case. What happens is: it checks if the file(s) you have selected are in an archive or FTP, if so, it completely ignores F4MiniMenu settings and uses the default Total Commander Edit command. It will use the file under the "cursor" if you have selected multiple files.

The reason for this is that Total Commander can re-upload edited files automatically to the server, as soon as they are saved.

It would be possible to allow F4MiniMenu to work with archives and/or FTP folders but in that case the user would have to upload or archive the changed files manually which doesn't seem too convenient. So it is a bit of a trade off. Either download the files and then use F4 with the associated programs, and upload them again or use the default program and have TC take care of it re-archiving / uploading.

@hi5
Copy link
Owner

hi5 commented Nov 19, 2016

What I could try and experiment with is add an additional helper script that you can set as editor in the total commander configuration and launch the preferred editor, it would only use the file under the cursor so if you select multiple files it would actually only edit one. I'll do some experiments.

See also Q&A 3 (Ovg) http://www.ghisler.ch/board/viewtopic.php?p=319787&sid=0f97a4dccba3cc23198a52286e0a891c#319787

@hi5 hi5 changed the title Open FTP file? Added helper script to allow editing FTP and archived files Nov 19, 2016
@hi5 hi5 self-assigned this Dec 24, 2016
@hi5
Copy link
Owner

hi5 commented Jun 30, 2017

α-version - download the zip file and copy the AHK to your F4MiniMenu folder.
If you are using INI change the name to end with an 'i' (so the same as F4MiniMenu method)

Setup: TC, Configuration, Edit/View, Editor:
drive:\path-to\F4TCIE.ahk "%1"

Updated July 3, β-version (fix issue reported by Ovg)
download removed

@hi5
Copy link
Owner

hi5 commented Jul 8, 2017

Updated July 8, β2-version
An experiment using DocumentTemplates for new files (shift+f4 in TC), script name is now F4TCIEx.ahk so don't have to overwrite version 0.2 from the post above.

As mentioned here " the target program has to accept "new or empty files" - for example notepad will allow this, but your graphics program of Office word processor will probably generate an error message."

To solve this problem you can place templates in the DocumentTemplates folder.
Create a new document in your preferred program, say a 100x100 bmp file in MS Paint. Save it as "template.BMP" in the DocumentTemplates folder. At the moment you need to modify a variable in the script (just during the test phase) line 29 "templateExt" and add ",bmp" (so a CSV list of extensions).
Now when you make a new BMP file, that template.bmp will be copied to the active folder/panel first before starting the editor. In the zip below there are three templates included XLSX, PNG and RTF to illustrate how it works.

download removed

@webaschtl
Copy link
Author

Just tried it with a txt file on a ftp site – wonderful! Now my editor (UltraEdit) starts and immediately after saving the file the upload starts.

Thanks!

@hi5
Copy link
Owner

hi5 commented Jul 11, 2017

You're welcome :-)

I'll integrate this into the F4MM repo which will reduce the code size of F4TCIE.

I'll also add some additional safety for the shift+f4 DocumentTemplates and a final resort option that if for some reason it can't open the configuration file it will try to start the editor for the file type associated in Windows (so for txt notepad, for bmp,jpg MS Paint etc) - if there is no editor for the file type it would start notepad.exe as a final resort. 🗒

@hi5
Copy link
Owner

hi5 commented Jul 16, 2017

Integrated in v0.95

@hi5 hi5 closed this as completed Jul 16, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants