Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use textpad as a command liner

 
Post new topic   Reply to topic    Community Forum Index -> Tips
View previous topic :: View next topic  
Author Message
OnlyTextPad



Joined: 20 May 2006
Posts: 41
Location: Helsinki

PostPosted: Thu Nov 02, 2006 1:43 pm    Post subject: Use textpad as a command liner Reply with quote

Textpad could be configured with Tools – e.g. Textpad could call externals programs, to which even a Textpad parameters (currently selected text, current opened file, current directory).The idea is to configure the cmd.exe – the Windows XP‘s command interpreter and pass to it any Textpad specific parameters or any cmd commands.
The following actions have to be performed in order to get this functionality:
- Display Preferences dialog box ( Alt + C , P)
- Select Tools , Add DOS Program
- type the full path to the cmd.exe (C:\WINNT\cmd.exe ) on Windows XP Profeccional (C:\Windows\cmd.exe ) on Windows XP Home
- Initial folder “$FileDir” the currently opened file’s directory
- Check “Prompt for parameters”
- Check “Save all documents first”
- Check “Capture output”
A simply shortcut could be assigned to this tool (herewith Ctrl + 4 used). So after pressing Ctrl + 4 , a text field for providing the parameters to the cmd.exe appears. Now by typing any command (for example dir /s /b ) textpad will provide the output of the command in the Command Results window, which could be saved instantly to a text file.
Textpad has the powerful feature to search for files (recursively) containing text or even regular expressions from the “Find in Files” or Ctrl + F5, yet sometimes one remembers only part of the filename and would not wait for the long lasting full directory searching by Textpad and would rather browse the names of the files (recursively) and open the result by simply opening it. This could be achieved by configuring textpad to run dos commands (see above)and simply Ctrl + 4 , type:
where /R \\my_network\file_folderToStartSearchFrom\ *stringToSearch*
This would require the Microsoft’s where.exe command line utility.


Other usefull commands might be the help for all dos / *nix gnu commands

for example

Tools - command
set /?

Not not mention ...
With shortcuts (Set first the shortcut )
Ctrl + 4 (or whatever you have set )
type :
perldoc perlfunc

needs perl ; )


Last edited by OnlyTextPad on Thu Apr 12, 2007 1:16 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
OnlyTextPad



Joined: 20 May 2006
Posts: 41
Location: Helsinki

PostPosted: Thu Feb 15, 2007 6:44 am    Post subject: Open recursively set of files Reply with quote

Put the exec.bat into your path
http://www.bristle.com/Tips/Windows.htm#exec_bat_executing_any_command_on_any_set_of_files
Now with the "Command liner setting" , Press Ctrl + 4 (this happens to be my shortcut for it Very Happy )
and type
Code:

exec *.pl *.txt /s /b do cmd /c start /max textpad

there is space after textpad Exclamation
So this opened all *.txt and *.pl type of files from the current directory and all its subdirectories (the /s switch of the dir command used in exec.bat )

Thanks to Fred Stluka !!!
Back to top
View user's profile Send private message Visit poster's website
OnlyTextPad



Joined: 20 May 2006
Posts: 41
Location: Helsinki

PostPosted: Sat Feb 24, 2007 7:41 pm    Post subject: I am gettingannoyng but ... How to generate numbers... or .. Reply with quote

::GENERATE THE NUMBERS FROM 1 TILL 10 000 with the for command and textpad command liner settings

Ctrl+ 4 (or whatever was your one set ) and type :
Code:
@echo off&for /L %n in (1,1,10000) do @echo %n


will get you
1
2
3
4
...
10000

WELL if you want to get the numbers divisible by 7 change the step so :
Code:
@echo off&for /L %n in (0,7,10000) do @echo %n

will get you :
0
7
14
21
28
35
...
9996


WELL what the ... the for command does ?
Ctrl + 4 type for /? and you will face the worst documented shell on the planet ...
or just simply run this one liner to get allmost all the help needed .... by one liner
Code:
for /f "tokens=1 delims= " %f in ('help') do for /f "delims=" %n in  ("%f") do %n /?
Back to top
View user's profile Send private message Visit poster's website
ben_josephs



Joined: 02 Mar 2003
Posts: 2360

PostPosted: Sun Feb 25, 2007 3:47 pm    Post subject: Reply with quote

You don't need to use an external program to generate sequence numbers.

In TextPad, create the required number of blank lines. You can do this by recording a scratch macro that creates one blank line, and then replaying it the appropriate number of times (Macros | Multi-play...).

Then put a sequence number on each line:
Quote:
Find what: ^
Replace with: \i

[X] Regular expression

Look in TextPad's help, under How To... | Find and Replace Text | Generate Sequence Numbers.
Back to top
View user's profile Send private message
OnlyTextPad



Joined: 20 May 2006
Posts: 41
Location: Helsinki

PostPosted: Thu Mar 15, 2007 9:33 am    Post subject: Open often used files from the Start - Run - dialog Reply with quote

Well this goes already to the Windows Tips and Tricks forums Very Happy
Code:

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "f" /d "textpad \"C:\Temp\Kikkulas\HTML_CHEATSHEET.html\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "g" /d "textpad \"C:\Temp\Kikkulas\cmdCheatSheet.cmd\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "h" /d "textpad \"C:\Temp\Kikkulas\PerlCheatSheat.pl\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "i" /d "textpad \"C:\Temp\UTILS\exctract.pl\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "j" /d "textpad \"C:\Documents and Settings\%userName%\Desktop\\Good_Morning.cmd\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "k" /d "textpad \"C:\temp\regs_and_hacks\\run.cqf\"\1" /f
Back to top
View user's profile Send private message Visit poster's website
OnlyTextPad



Joined: 20 May 2006
Posts: 41
Location: Helsinki

PostPosted: Sat May 05, 2007 7:04 pm    Post subject: Tip obsolete ?! Reply with quote

With the newest TextPad this tip has gotten obsolete ; )
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Tips All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB