| View previous topic :: View next topic |
| Author |
Message |
bulgara Guest
|
Posted: Wed Mar 23, 2005 11:37 am Post subject: random or sequencial name or number |
|
|
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
|
Posted: Wed Mar 23, 2005 1:09 pm Post subject: |
|
|
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 |
|
 |
bulgara Guest
|
Posted: Wed Mar 23, 2005 6:03 pm Post subject: Can you make a example? |
|
|
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
|
Posted: Wed Mar 23, 2005 6:47 pm Post subject: |
|
|
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 |
|
 |
bulgara Guest
|
Posted: Wed Mar 23, 2005 11:21 pm Post subject: great! |
|
|
Thank you very much!!!
is perfect!!
Bye |
|
| Back to top |
|
 |
|