AutoHotkey Community

It is currently May 27th, 2012, 4:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: March 6th, 2010, 9:28 am 
Offline

Joined: March 6th, 2010, 9:26 am
Posts: 15
Location: India
For example

I want to select this text


Code:
    Some text here 


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 March 6th, 2010, 1:24 pm, edited 5 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2010, 9:50 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
- 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 FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2010, 10:12 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2010, 10:54 am 
Offline

Joined: March 6th, 2010, 9:26 am
Posts: 15
Location: India
how to operate this, it's not working


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2010, 10:57 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
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 FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2010, 11:19 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group