| View previous topic :: View next topic |
| Author |
Message |
jitendravyas
Joined: 06 Mar 2010 Posts: 15 Location: India
|
Posted: Sat Mar 06, 2010 8:28 am Post subject: How to convert selected text into comment (including date) w |
|
|
For example
I want to select this text
then with ahk shortcut want to convert like this
| Code: | /* ======================================================================= */
/* = Some text here - added by Jitendra (Date and time here from system) = */
/* ======================================================================= */ |
Last edited by jitendravyas on Sat Mar 06, 2010 12:24 pm; edited 5 times in total |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Sat Mar 06, 2010 8:50 am Post subject: |
|
|
- You need a hotkey
- Send ^x will cut text to clipboard
- Look at builtin variables for date & time
- Send commenttext, clipboard + date variables
Try some things, post code if you get stuck. Note there are various methods of doing this, one may be more efficient than the other, but if you try something I'm sure you will learn more from it. _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 2214 Location: switzerland
|
Posted: Sat Mar 06, 2010 9:12 am Post subject: |
|
|
had just an example
can also create a GUI with dropdownlist, see command formattime... etc
| Code: | ;--- mark text s1 and press F7 -----------
;--- send to notepad and display msgbox ---
$F7::
S1=added by Jitendra
Formattime,TS,,longdate
Formattime,TT,T12,time
clipboard=
Send ^c
clipwait
C2:=clipboard
clipboard=
if C2 contains %s1%
{
e4=
(
/* ====================================================== */
/* = added by Jitendra %ts% %tt% = */
/* ====================================================== */
)
run, notepad,,,pid
aa=ahk_class Notepad
WinActivate, %aa%
WinWaitActive, %aa%,,5
ControlSend,, %e4%, ahk_pid %PID%
msgbox,%e4%
e4=
return
}
else
return
|
|
|
| Back to top |
|
 |
jitendravyas
Joined: 06 Mar 2010 Posts: 15 Location: India
|
Posted: Sat Mar 06, 2010 9:54 am Post subject: |
|
|
| how to operate this, it's not working |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Sat Mar 06, 2010 9:57 am Post subject: |
|
|
You really need to start with the tutorials and some coding yourself otherwise you will never learn. Really try something yourself and you will see that the example by garry will work. But start with the basics first. This is ask for help, not ask for scripts. _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 2214 Location: switzerland
|
Posted: Sat Mar 06, 2010 10:19 am Post subject: |
|
|
for example above,
save as xy.ahk, start script , see nothing
mark your text (added by Jitendra) , then press F7
starts notepad and it writes your text with date (e4) to notepad and shows a messagebox |
|
| Back to top |
|
 |
|