Script to create a text file with the path of the current in
Moderators: Hacker, petermad, Stefan2, white
Script to create a text file with the path of the current in
Is there anyway to have a script in TC so that when e.g. you press [enter] on a file in left panel, a text file is created in c:\ with the absolute path of the executed file in left panel written in it?
Is it possible to do this with Tc scripting, or batch commands (.bat) need to be used?
It would be excellent to make this with TC scripts as I'd like it to be as fast as possible and I think batch file would be slower that the native scripts in TC.
So, this is exactly what I what the scrip to do:
1) create a text file with the path to the Entered file in it
2) I want to be able to use it as internal association handler
thanks
Is it possible to do this with Tc scripting, or batch commands (.bat) need to be used?
It would be excellent to make this with TC scripts as I'd like it to be as fast as possible and I think batch file would be slower that the native scripts in TC.
So, this is exactly what I what the scrip to do:
1) create a text file with the path to the Entered file in it
2) I want to be able to use it as internal association handler
thanks
Last edited by msrox on 2015-02-06, 16:01 UTC, edited 2 times in total.
First of what do you mean with "enter on a file"? Press [Enter] or enter a folder?
Please describe exactly what you're trying to accomplish.
There is no "event" system in TC but you can query the current path with external scripts or pass it to them.
If you only enter certain predefined paths you could combine that action with a script and put it on a button or in a user command.
Maybe this will suffice:
Create a new Button with
Command:
Parameter:
Check "Run Minimized" and choose an icon.
*Edit: MVV was faster
Please describe exactly what you're trying to accomplish.
There is no "event" system in TC but you can query the current path with external scripts or pass it to them.
If you only enter certain predefined paths you could combine that action with a script and put it on a button or in a user command.
Maybe this will suffice:
Create a new Button with
Command:
Code: Select all
%comspec% /c
Code: Select all
echo %P%O.%E >c:\CurrentFile.txt
*Edit: MVV was faster

Last edited by ZoSTeR on 2015-02-06, 15:55 UTC, edited 2 times in total.
If you only need to write current path to some file when you run some command, try this from e.g. buttonbar:
Code: Select all
Command: cmd.exe
Parameters: /c "echo %P>>"c:\path.log""
If you need to write path to some file to log when you press Enter on it, try internally associating (File - Internal Associations) following bat file with desired extension:
You need to paste path to batch and then "%1" in order to pass path to file to it.
E.g. I saved it as d:\1.bat and added an internal association for *.sss type with command d:\1.bat "%1". Now when I press Enter on any .sss file, batch appends a line to log.
Code: Select all
@echo off
echo %~1>>c:\log.txt
E.g. I saved it as d:\1.bat and added an internal association for *.sss type with command d:\1.bat "%1". Now when I press Enter on any .sss file, batch appends a line to log.