pase Posted December 30, 2004 Share Posted December 30, 2004 Hello, I'm trying to write a script which uses the command line tool "wget" to download files. The script should work as follows: - copy the URL to the clipboard - run the script -> it determines the filename and uses "wget" Dim $file_temp = "", $clipboard = ClipGet(), $char = "", $count = 0, $file = "" If StringLower(StringLeft($clipboard,3)) <> "htt" AND StringLower(StringLeft($clipboard,3)) <> "ftp" then Exit ;no URL -> Exit While StringLeft($char,1) <> "/" ;determine filename $char = StringRight($clipboard,$count) $count = $count + 1 $file_temp = $file_temp + $char WEnd $file = StringRight($file_temp,$count) ;filename without "/" msgbox(0,"Debug",$file) [...] My problem: the last msgbox doesn't print the filename on the screen; It just prints "0"! I can't find the bug. I hope that somebody can help me Thanks in advance pase Link to comment Share on other sites More sharing options...
Josbe Posted December 30, 2004 Share Posted December 30, 2004 $clipboard = ClipGet() Msgbox(0, "", $clipboard) $clipboard = value? Before, you verified this variable? Which is the value? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
pase Posted December 30, 2004 Author Share Posted December 30, 2004 $clipboard = ClipGet() Msgbox(0, "", $clipboard)$clipboard = value?Before, you verified this variable? Which is the value?<{POST_SNAPBACK}>I verified the variable withIf StringLower(StringLeft($clipboard,3)) <> "htt" AND StringLower(StringLeft($clipboard,3)) <> "ftp" then ExitIt contains the complete URL (e.g. http://fakeurl.org/files/afile.exe or ftp://lullaby.com/file.exe) and the file which is intended to be downloaded. As I wrote before, the complete URL must be copied to clipboard, before the script starts. Then the clipboard will be read with "ClipGet()": its content will be saved in $clipboard.I hope you could understand me.Sorry for my bad English greetspase Link to comment Share on other sites More sharing options...
Developers Jos Posted December 30, 2004 Developers Share Posted December 30, 2004 change: $file_temp = $file_temp + $char to $file_temp = $file_temp & $char SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
pase Posted January 4, 2005 Author Share Posted January 4, 2005 change:$file_temp = $file_temp + $charto$file_temp = $file_temp & $char <{POST_SNAPBACK}>Woohoo it works! Thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now