Three problems
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Three problems
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...
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...
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
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
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
What do you mean by rev list?
Is it http://lists.runrev.com/ or http://www.mail-archive.com/ ????
Give me the link, pls.................
Is it http://lists.runrev.com/ or http://www.mail-archive.com/ ????
Give me the link, pls.................

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
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
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
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 -
This code doesn't work to delete that file. Is there any mistake or I've to do more?
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
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
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:
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.
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
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Hi Janschenkel,
Thanks for your reply. I solved my problem last night. I made the script-
This script works nicely. And your scripts too. Thanks again.
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
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Hi alemrantareq,
Probably, you have an older version of Revolution, which doesn't understand "begins with".
Best,
Mark
Probably, you have an older version of Revolution, which doesn't understand "begins with".
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode