AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

random or sequencial name or number

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
bulgara
Guest





PostPosted: Wed Mar 23, 2005 11:37 am    Post subject: random or sequencial name or number Reply with quote

Hi everybody.
My problem is: I select and copy some text from a document or html page, I want to save in a txt file with a random or sequencial name or number. (every new file must have different name)
I use this:
Fileappend, %Clipboard%, F:\Hotkey\File Append.txt

How I can make File Append.txt > 10000.txt and 10001.txt ecc
Thanks.
Back to top
ILL.1



Joined: 29 Sep 2004
Posts: 84

PostPosted: Wed Mar 23, 2005 1:09 pm    Post subject: Reply with quote

Use a variable name for the filename and then increment the counter.

Code:
count = 1

Mbutton::
FileAppend, %Clipboard%, F:\Hotkey\File Append %count%.txt
count++
Return


Look at SetFormat to change the zero padding of the number.
_________________
===============
----------ILL.1-----------
===============
Back to top
View user's profile Send private message
bulgara
Guest





PostPosted: Wed Mar 23, 2005 6:03 pm    Post subject: Can you make a example? Reply with quote

Hi, ILL.1
I try, but (I'm very newbie) every time I start the script, send in file append 1 the contain of clipboard; I need different file every time; (excuse my very poor English).
Can you make a example?

Thank you
Back to top
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Mar 23, 2005 6:47 pm    Post subject: Reply with quote

You could use IfExist to check if the file already exists, and skip it if it does:

Code:
count = 10000

Mbutton::
Loop
{
  IfExist,F:\Hotkey\%count%.txt
    count++
  Else
    break
}
FileAppend, %Clipboard%, F:\Hotkey\%count%.txt
count++
Return
Back to top
View user's profile Send private message
bulgara
Guest





PostPosted: Wed Mar 23, 2005 11:21 pm    Post subject: great! Reply with quote

Thank you very much!!!

is perfect!!

Bye
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group