topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 10:54 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Document code : number-year  (Read 4207 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Document code : number-year
« on: December 11, 2008, 01: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
    • View Profile
    • Donate to Member
Re: Document code : number-year
« Reply #1 on: December 11, 2008, 04:33 PM »
You can use this AutohotKey script (activate with windows key + i)

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
    • View Profile
    • Donate to Member
Re: Document code : number-year
« Reply #2 on: December 11, 2008, 10:02 PM »
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.autohotke.../Tutorial.htm#Create
2b. Replace step 5 of those instructions with the script above...

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Document code : number-year
« Reply #3 on: December 12, 2008, 07:22 AM »
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,940
    • View Profile
    • Donate to Member
Re: Document code : number-year
« Reply #4 on: December 12, 2008, 09:26 AM »
Compile and running.

 ;D