Jump to content

How do I make a timestamp macro


 Share

Recommended Posts

  • Moderators

Begin with looking in the help file under the Date Management section. Look at _Now(), _NowDate(), and _NowTime() and see which works best for you. Then we can go from there.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I agree with reading the manual, its helped me a little with my project, then I can ask further for clarification, I have learned more by trying myself and failing rather than asking here for someone to do it for me

but I am too a beginner and using the help of the help file and the internet I have come up with this 

 

Example()

Func Example()

Run("notepad.exe")

   AutoItSetOption("WinTitleMatchMode", 4)
    WinWaitActive( "Untitled - Notepad", "", 5 )
 ControlFocus ( "Untitled - Notepad","" , "Edit1" )
 ControlSend ( "Untitled - Notepad", "" , "Edit1","{F5}" )


Sleep(500)
Send("+{UP 2}")
Sleep(500)

Send("!f")
Send("x")

WinWaitActive("Notepad")
Send("y")
Sleep(500)
Send("+{UP 2}")
Sleep(500)

Send("!f")
Send("x")

WinWaitActive("Notepad")
Send("{ENTER}")
Sleep(500)
Send("heeeeeeee.txt")
Sleep(500)
Send("{ENTER}")
WinWaitClose("Untitled - Notepad")

EndFunc   ;==>Example

 

Link to comment
Share on other sites

  • Moderators

@mrmacro That is the exact reason we suggest new folks look at the help file. You could take your 37 lines, and boil it down to a simple:

#include <Date.au3>

FileWrite(@DesktopDir & "\Output.txt", _Now())

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

16 hours ago, JLogan3o13 said:

@mrmacro That is the exact reason we suggest new folks look at the help file. You could take your 37 lines, and boil it down to a simple:

#include <Date.au3>

FileWrite(@DesktopDir & "\Output.txt", _Now())

 

thought i could help another beginner with what i had worked out but , i got loads to learn still , seem i not worked that one out yet but thanks

Link to comment
Share on other sites

You want hotkey or even hotstrings.

I like the use of hotstrings for things like this.

when you type the word timestamp it will automatically put the time stamp if the file you are working with.

#Include <HotString.au3>
#Include <Date.au3>

HotStringSet("timestamp{space}", inserttime)
HotKeySet("{Escape}", terminate)

While 1
    Sleep(10)
WEnd

Func inserttime()
    Send("{Backspace 10}")
    Send (_Now())
EndFunc

Func terminate()
    Exit
EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...