DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Document code : number-year  (Read 6,083 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,947
Document code : number-year
« on: December 11, 2008, 07:52 PM »
Document code : number-year
I need an independant script for asigning codes to the document I make.
When I have the cursor over a text field, a word processor like word, notepad, wordpad, field notes on many programs, a database text field, etc , I might be able to invoke the script and write the code in that document. Just where the cursor is.
The code is formed by a sequantial number and the year : 000125-2008
Next time I invoke the script will be 000126-2008

Do you know a script doing this ?

Thanks
Excuse my language. I'm from Canary Islands

argv

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 45
Re: Document code : number-year
« Reply #1 on: December 11, 2008, 10:33 PM »
You can use this AutohotKey script (activate with windows key + i)

Code
number=1
format=000000

#i::

len_number := StrLen(number)
len_format := StrLen(format)
len_padding := len_format - len_number
StringLeft, padding, format, len_padding
SendInput,%padding%%number%-%A_YYYY%
number ++
return

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
Re: Document code : number-year
« Reply #2 on: December 12, 2008, 04:02 AM »
I haven't used AutoHotkey for a while (well, I haven't used the program, I do use one of my old scripts several times a day though) so I can't give any personal pointers as far as making it work, but hopefully this site will get you at least as far as making argv's script work...

1. Download and install AutoHotkey
2a. Follow the instructions here: http://www.autohotkey.com/docs/Tutorial.htm#Create
2b. Replace step 5 of those instructions with the script above...

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,947
Re: Document code : number-year
« Reply #3 on: December 12, 2008, 01:22 PM »
I was looking for AutoHotkey to compile the Thanks
Excuse my language. I'm from Canary Islands and proof

Thanks

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,947
Re: Document code : number-year
« Reply #4 on: December 12, 2008, 03:26 PM »
Compile and running.

;D

Original address: https://www.donationcoder.com/forum/index.php?topic=16134.0