Jump to content
Sign in to follow this  
b0x4it

Multi line and Tabbed lines in message box

Recommended Posts

b0x4it

I put couple of URLs in the clipboard. I'd like to show a messagebox that has a line followed by a line break and then all the URLs tabbed. This is what I tried but it doesn't work (the tabbing part):

$bak = ClipGet()
MsgBox(0, "Dropbox URL generator", "URL(s) that have successfully been copied in clipboard:" & @CRLF & @Tab & $bak)

the desired message box should looks like this:

the appropriate explanatory line:

http://www.autoitscript.com

http://www.autoitscript.com

http://www.autoitscript.com

is there any easy way to do this or I have to manually add a tab at the beginning of all lines of the clipboad?

Share this post


Link to post
Share on other sites
taietel

Try this:

$bak = ClipGet()
$bak = StringSplit($bak,@LF,2)
$sText = ""
For $i=0 To UBound($bak)-1
 If $bak[$i]<>@CRLF Or $bak[$i]<>@CR Or $bak[$i]<>@LF Then $sText &= @TAB & $bak[$i]&@LF
Next
MsgBox(0, "Dropbox URL generator", "URL(s) that have successfully been copied in clipboard:" & @CRLF & $sText)

[EDIT] Replaced @CRLF with @LF

Edited by taietel

Share this post


Link to post
Share on other sites
smartee

hi,

You can try something like:

$sURLs = ",www.google.com,www.autoitscript.com,www.youtube.com"
MsgBox(64, "Demo1", "The list of URLs you requested is below:" & StringReplace($sURLs, ",", @CRLF & @TAB))

Hope this helps :)

-smartee

Share this post


Link to post
Share on other sites
b0x4it

hi,

You can try something like:

$sURLs = ",www.google.com,www.autoitscript.com,www.youtube.com"
MsgBox(64, "Demo1", "The list of URLs you requested is below:" & StringReplace($sURLs, ",", @CRLF & @TAB))

Hope this helps :)

-smartee

thanks for the reply, but urls are generated by totalcommander, so I can't make them in one line separated with ","

Share this post


Link to post
Share on other sites
b0x4it

thank you for your replies, I found this very simple way to do this:

$bak = ClipGet()
MsgBox(64, "Demo1", "The list of URLs you requested is below:" & @CRLF & @TAB & StringReplace($bak, @LF, @TAB))
Edited by b0x4it

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.