Page 1 of 2
Three problems
Posted: Tue Nov 18, 2008 11:36 am
by alemrantareq
Hi everybody, pls solve my three problems in detail.
1. How to make a timed dialog message which will automatically closed after 5 seconds. Is that possible with answer command?
2. In "autorun.inf" file, there may be written "open=autorun.exe" or "open=myFile.txt" or "open=Readme.pdf" etc. I need to verify what filename is written after "open=" and to delete that file. What'll be the script? Is it possible with lineoffset function?
3. How to delete only the hidden files from a directory?
Pls, help me...
Posted: Tue Nov 18, 2008 12:17 pm
by Klaus
Hi tareq,
1. Yes you could use the answer dialog (and any other stack):
Create another handler in the same script or in the message hierarchy that will close the dialog and "send" this handler in X seconds:
...
send "close_dialog" to me in 5 secs
answer "This dialog will self-destruct in 5 seconds!"
...
command close_dialog
if "Answer dialog" is in the openstacks then
close stack "Answer dialog"
end if
end close_dialog
## Tested and works!
2. and 3. see the Rev-list
Best from germany
Klaus
Posted: Tue Nov 18, 2008 12:44 pm
by alemrantareq
For problem 2 and 3, I need clearcut solution. Pls...
Posted: Tue Nov 18, 2008 1:17 pm
by Klaus
What exactly is not clear enough in my answers to 2 and 3 on the Rev list?
Posted: Tue Nov 18, 2008 9:04 pm
by Garrett
Yes, can you please make my program for me Klaus? please!

Posted: Tue Nov 18, 2008 9:06 pm
by Klaus
Garrett wrote:Yes, can you please make my program for me Klaus? please!

LOL
Well, something like this was also in my mind

Posted: Wed Nov 19, 2008 7:11 am
by alemrantareq
What do you mean by rev list?
Is it
http://lists.runrev.com/ or
http://www.mail-archive.com/ ????
Give me the link, pls.................

Posted: Wed Nov 19, 2008 9:30 am
by Klaus
Oh geeez!
You posted a mail to the "How to use Revolution" mailing list (
use-revolution@lists.runrev.com) yesterday and I replied to your mail on the same list. What's the matter with you?
Regards
Klaus
Posted: Thu Nov 27, 2008 9:54 am
by alemrantareq
Hi klaus,
Thanks for your replies. Your solution for no. 1 really works. For solution no. 2 & 3, I've reviewed the use-revolution archives as your suggestion. But it takes long times. I'll be very thankful if you provide the exact month & subject name. pls, pls ...

Posted: Thu Nov 27, 2008 2:39 pm
by Klaus
It was exactly 22 minutes after your post and had the same subject as your post only with "Re:" in front of it.
Hint:
Check the docs before you post here. (e.g. default cursor!)
Posted: Sat Nov 29, 2008 7:32 am
by alemrantareq
Hi Klaus,
Thanks for your reply. I've two files "autorun.inf" and "test.exe" in D: drive and "open=test.exe" is written in the autorun file. I made a script for a btn -
Code: Select all
on mouseUp
put "D:/autorun.inf" into my_file
put url ("file:" & my_file) into my_autorun
put lineoffset("open=", my_autorun) into tLine
if tLine <> 0 then
put line tLine of my_autorun into my_line
replace "open=" with "" in my_line
delete file my_line
end if
end mouseUp
This code doesn't work to delete that file. Is there any mistake or I've to do more?
Posted: Sat Nov 29, 2008 3:29 pm
by Janschenkel
Unless you specify a full path "D:/test.exe" the 'delete file' commadn will look for a file "test.exe" in the 'defaultFolder' - usually the directory of your standalone executable, or while you're in the IDE, the directory where Revolution is installed.
So I would go for something like:
Code: Select all
put "D:/" into theDirectory
put theDirectory & "autorun.inf" into theAutorunFile
put URL ("file:" & theAutorunFile into theAutorunData
repeat for each line theLine in theAutorunData
if theLine begins with "open=" then
put theDirectory & char 6 to -1 of theLine into theFileToDelete
delete file theFileToDelete
exit repeat
end if
end repeat
Note that you can only delete files if the user has the right privileges to do so, and you won't be able to delete files from read-only media like CDs or DVDs.
Jan Schenkel.
Posted: Sun Nov 30, 2008 8:32 am
by alemrantareq
Hi Janschenkel,
Thanks for your reply. I solved my problem last night. I made the script-
Code: Select all
on mouseUp
put "D:/autorun.inf" into my_file
put url ("file:" & my_file) into my_autorun
put lineoffset("open=",my_autorun) into tLine
if tLine <> 0 then
put line tLine of my_autorun into my_line
replace "open=" with "" in my_line
put "D:/" & my_line into tpath
if there is a file tpath then
delete file tpath
end if
end if
end mouseUp
This script works nicely. And your scripts too. Thanks again.
Posted: Mon Dec 01, 2008 7:09 am
by alemrantareq
Hi Janschenkel,
sorry to infrom you that when I try to apply your script, it shows a error message " if: missing 'then' " at the line (if theLine begins with "open=" then"). Why its happen? Doesn't this error show you?
Posted: Mon Dec 01, 2008 10:33 am
by Mark
Hi alemrantareq,
Probably, you have an older version of Revolution, which doesn't understand "begins with".
Best,
Mark